Leaf Blower!

This commit is contained in:
Ellpeck 2015-03-29 15:29:05 +02:00
parent 36f721ed30
commit 0bfb102ca9
59 changed files with 628 additions and 358 deletions

View file

@ -17,7 +17,7 @@ buildscript {
apply plugin: 'forge' apply plugin: 'forge'
version = "1.7.10-0.0.2.1" version = "1.7.10-0.0.2.3"
group = "ellpeck.actuallyadditions" group = "ellpeck.actuallyadditions"
archivesBaseName = "ActuallyAdditions" archivesBaseName = "ActuallyAdditions"

View file

@ -21,12 +21,13 @@ import ellpeck.actuallyadditions.network.PacketHandler;
import ellpeck.actuallyadditions.oredict.OreDictRegistry; import ellpeck.actuallyadditions.oredict.OreDictRegistry;
import ellpeck.actuallyadditions.proxy.IProxy; import ellpeck.actuallyadditions.proxy.IProxy;
import ellpeck.actuallyadditions.tile.TileEntityBase; import ellpeck.actuallyadditions.tile.TileEntityBase;
import ellpeck.actuallyadditions.util.ModUtil;
import ellpeck.actuallyadditions.util.Util; import ellpeck.actuallyadditions.util.Util;
@Mod(modid = Util.MOD_ID, name = Util.NAME, version = Util.VERSION) @Mod(modid = ModUtil.MOD_ID, name = ModUtil.NAME, version = ModUtil.VERSION)
public class ActuallyAdditions{ public class ActuallyAdditions{
@Instance(Util.MOD_ID) @Instance(ModUtil.MOD_ID)
public static ActuallyAdditions instance; public static ActuallyAdditions instance;
@SidedProxy(clientSide = "ellpeck.actuallyadditions.proxy.ClientProxy", serverSide = "ellpeck.actuallyadditions.proxy.ServerProxy") @SidedProxy(clientSide = "ellpeck.actuallyadditions.proxy.ClientProxy", serverSide = "ellpeck.actuallyadditions.proxy.ServerProxy")

View file

@ -1,13 +1,13 @@
package ellpeck.actuallyadditions.achievement; package ellpeck.actuallyadditions.achievement;
import ellpeck.actuallyadditions.util.Util; import ellpeck.actuallyadditions.util.ModUtil;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.stats.Achievement; import net.minecraft.stats.Achievement;
public class AchievementAA extends Achievement{ public class AchievementAA extends Achievement{
public AchievementAA(String name, int x, int y, ItemStack displayStack, Achievement hasToHaveBefore){ public AchievementAA(String name, int x, int y, ItemStack displayStack, Achievement hasToHaveBefore){
super("achievement." + Util.MOD_ID_LOWER +"." + Util.MOD_ID_LOWER + "." + name, Util.MOD_ID_LOWER + "." + name, x, y, displayStack, hasToHaveBefore); super("achievement." + ModUtil.MOD_ID_LOWER + "." + name, ModUtil.MOD_ID_LOWER + "." + name, x, y, displayStack, hasToHaveBefore);
InitAchievements.achievementList.add(this); InitAchievements.achievementList.add(this);
if(hasToHaveBefore == null) this.initIndependentStat(); if(hasToHaveBefore == null) this.initIndependentStat();
this.registerStat(); this.registerStat();

View file

@ -4,6 +4,7 @@ import ellpeck.actuallyadditions.blocks.InitBlocks;
import ellpeck.actuallyadditions.items.InitItems; import ellpeck.actuallyadditions.items.InitItems;
import ellpeck.actuallyadditions.items.metalists.TheFoods; import ellpeck.actuallyadditions.items.metalists.TheFoods;
import ellpeck.actuallyadditions.items.metalists.TheMiscItems; import ellpeck.actuallyadditions.items.metalists.TheMiscItems;
import ellpeck.actuallyadditions.util.ModUtil;
import ellpeck.actuallyadditions.util.Util; import ellpeck.actuallyadditions.util.Util;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.stats.Achievement; import net.minecraft.stats.Achievement;
@ -53,7 +54,7 @@ public class InitAchievements{
achievementCraftFishNChips = new AchievementAA("craftFishNChips", 4, 2, new ItemStack(InitItems.itemFoods, 1, TheFoods.FISH_N_CHIPS.ordinal()), achievementCraftFrenchFry); achievementCraftFishNChips = new AchievementAA("craftFishNChips", 4, 2, new ItemStack(InitItems.itemFoods, 1, TheFoods.FISH_N_CHIPS.ordinal()), achievementCraftFrenchFry);
theAchievementPage = new AchievementPage(StatCollector.translateToLocal("achievement.page." + Util.MOD_ID_LOWER), achievementList.toArray(new Achievement[achievementList.size()])); theAchievementPage = new AchievementPage(StatCollector.translateToLocal("achievement.page." + ModUtil.MOD_ID_LOWER), achievementList.toArray(new Achievement[achievementList.size()]));
AchievementPage.registerAchievementPage(theAchievementPage); AchievementPage.registerAchievementPage(theAchievementPage);
} }

View file

@ -9,7 +9,9 @@ import ellpeck.actuallyadditions.items.ItemMisc;
import ellpeck.actuallyadditions.items.metalists.TheMiscItems; import ellpeck.actuallyadditions.items.metalists.TheMiscItems;
import ellpeck.actuallyadditions.tile.TileEntityCompost; import ellpeck.actuallyadditions.tile.TileEntityCompost;
import ellpeck.actuallyadditions.util.IName; import ellpeck.actuallyadditions.util.IName;
import ellpeck.actuallyadditions.util.Util; import ellpeck.actuallyadditions.util.ItemUtil;
import ellpeck.actuallyadditions.util.KeyUtil;
import ellpeck.actuallyadditions.util.ModUtil;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
@ -147,12 +149,12 @@ public class BlockCompost extends BlockContainerBase implements IName{
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
if(Util.isShiftPressed()){ if(KeyUtil.isShiftPressed()){
list.add(StatCollector.translateToLocal("tooltip." + Util.MOD_ID_LOWER + "." + ((IName)theBlock).getName() + ".desc.1")); list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((IName)theBlock).getName() + ".desc.1"));
//TODO Remove second info //TODO Remove second info
list.add(StatCollector.translateToLocal("tooltip." + Util.MOD_ID_LOWER + "." + ((IName)theBlock).getName() + ".desc.2")); list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((IName)theBlock).getName() + ".desc.2"));
} }
else list.add(Util.shiftForInfo()); else list.add(ItemUtil.shiftForInfo());
} }
@Override @Override

View file

@ -6,7 +6,9 @@ import ellpeck.actuallyadditions.ActuallyAdditions;
import ellpeck.actuallyadditions.inventory.GuiHandler; import ellpeck.actuallyadditions.inventory.GuiHandler;
import ellpeck.actuallyadditions.tile.TileEntityFeeder; import ellpeck.actuallyadditions.tile.TileEntityFeeder;
import ellpeck.actuallyadditions.util.IName; import ellpeck.actuallyadditions.util.IName;
import ellpeck.actuallyadditions.util.Util; import ellpeck.actuallyadditions.util.ItemUtil;
import ellpeck.actuallyadditions.util.KeyUtil;
import ellpeck.actuallyadditions.util.ModUtil;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
@ -45,8 +47,8 @@ public class BlockFeeder extends BlockContainerBase implements IName{
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconReg){ public void registerBlockIcons(IIconRegister iconReg){
this.blockIcon = iconReg.registerIcon(Util.MOD_ID_LOWER + ":" + this.getName()); this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName());
this.topIcon = iconReg.registerIcon(Util.MOD_ID_LOWER + ":" + this.getName() + "Top"); this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Top");
} }
@Override @Override
@ -95,8 +97,8 @@ public class BlockFeeder extends BlockContainerBase implements IName{
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
if(Util.isShiftPressed()) list.add(StatCollector.translateToLocal("tooltip." + Util.MOD_ID_LOWER + "." + ((IName)theBlock).getName() + ".desc")); if(KeyUtil.isShiftPressed()) list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((IName)theBlock).getName() + ".desc"));
else list.add(Util.shiftForInfo()); else list.add(ItemUtil.shiftForInfo());
} }
@Override @Override

View file

@ -6,7 +6,9 @@ import ellpeck.actuallyadditions.ActuallyAdditions;
import ellpeck.actuallyadditions.inventory.GuiHandler; import ellpeck.actuallyadditions.inventory.GuiHandler;
import ellpeck.actuallyadditions.tile.TileEntityFurnaceDouble; import ellpeck.actuallyadditions.tile.TileEntityFurnaceDouble;
import ellpeck.actuallyadditions.util.IName; import ellpeck.actuallyadditions.util.IName;
import ellpeck.actuallyadditions.util.Util; import ellpeck.actuallyadditions.util.ItemUtil;
import ellpeck.actuallyadditions.util.KeyUtil;
import ellpeck.actuallyadditions.util.ModUtil;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
@ -90,10 +92,10 @@ public class BlockFurnaceDouble extends BlockContainerBase implements IName{
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconReg){ public void registerBlockIcons(IIconRegister iconReg){
this.blockIcon = iconReg.registerIcon(Util.MOD_ID_LOWER + ":" + this.getName()); this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName());
this.topIcon = iconReg.registerIcon(Util.MOD_ID_LOWER + ":" + this.getName() + "Top"); this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Top");
this.onIcon = iconReg.registerIcon(Util.MOD_ID_LOWER + ":" + this.getName() + "On"); this.onIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "On");
this.frontIcon = iconReg.registerIcon(Util.MOD_ID_LOWER + ":" + this.getName() + "Front"); this.frontIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Front");
} }
@Override @Override
@ -177,8 +179,8 @@ public class BlockFurnaceDouble extends BlockContainerBase implements IName{
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
if(Util.isShiftPressed()) list.add(StatCollector.translateToLocal("tooltip." + Util.MOD_ID_LOWER + "." + ((IName)theBlock).getName() + ".desc")); if(KeyUtil.isShiftPressed()) list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((IName)theBlock).getName() + ".desc"));
else list.add(Util.shiftForInfo()); else list.add(ItemUtil.shiftForInfo());
} }
@Override @Override

View file

@ -6,7 +6,9 @@ import ellpeck.actuallyadditions.ActuallyAdditions;
import ellpeck.actuallyadditions.inventory.GuiHandler; import ellpeck.actuallyadditions.inventory.GuiHandler;
import ellpeck.actuallyadditions.tile.TileEntityGiantChest; import ellpeck.actuallyadditions.tile.TileEntityGiantChest;
import ellpeck.actuallyadditions.util.IName; import ellpeck.actuallyadditions.util.IName;
import ellpeck.actuallyadditions.util.Util; import ellpeck.actuallyadditions.util.ItemUtil;
import ellpeck.actuallyadditions.util.KeyUtil;
import ellpeck.actuallyadditions.util.ModUtil;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
@ -45,8 +47,8 @@ public class BlockGiantChest extends BlockContainerBase implements IName{
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconReg){ public void registerBlockIcons(IIconRegister iconReg){
this.blockIcon = iconReg.registerIcon(Util.MOD_ID_LOWER + ":" + this.getName()); this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName());
this.topIcon = iconReg.registerIcon(Util.MOD_ID_LOWER + ":" + this.getName() + "Top"); this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Top");
} }
@Override @Override
@ -95,8 +97,8 @@ public class BlockGiantChest extends BlockContainerBase implements IName{
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
if(Util.isShiftPressed()) list.add(StatCollector.translateToLocal("tooltip." + Util.MOD_ID_LOWER + "." + ((IName)theBlock).getName() + ".desc")); if(KeyUtil.isShiftPressed()) list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((IName)theBlock).getName() + ".desc"));
else list.add(Util.shiftForInfo()); else list.add(ItemUtil.shiftForInfo());
} }
@Override @Override

View file

@ -6,7 +6,9 @@ import ellpeck.actuallyadditions.ActuallyAdditions;
import ellpeck.actuallyadditions.inventory.GuiHandler; import ellpeck.actuallyadditions.inventory.GuiHandler;
import ellpeck.actuallyadditions.tile.TileEntityGrinder; import ellpeck.actuallyadditions.tile.TileEntityGrinder;
import ellpeck.actuallyadditions.util.IName; import ellpeck.actuallyadditions.util.IName;
import ellpeck.actuallyadditions.util.Util; import ellpeck.actuallyadditions.util.ItemUtil;
import ellpeck.actuallyadditions.util.KeyUtil;
import ellpeck.actuallyadditions.util.ModUtil;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
@ -76,10 +78,10 @@ public class BlockGrinder extends BlockContainerBase implements IName{
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconReg){ public void registerBlockIcons(IIconRegister iconReg){
this.blockIcon = iconReg.registerIcon(Util.MOD_ID_LOWER + ":" + this.getName()); this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName());
this.topIcon = iconReg.registerIcon(Util.MOD_ID_LOWER + ":blockGrinderTop"); this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":blockGrinderTop");
this.onIcon = iconReg.registerIcon(Util.MOD_ID_LOWER + ":blockGrinderOn"); this.onIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":blockGrinderOn");
this.bottomIcon = iconReg.registerIcon(Util.MOD_ID_LOWER + ":blockGrinderBottom"); this.bottomIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":blockGrinderBottom");
} }
@Override @Override
@ -128,12 +130,12 @@ public class BlockGrinder extends BlockContainerBase implements IName{
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
if(Util.isShiftPressed()){ if(KeyUtil.isShiftPressed()){
for(int i = 0; i < (((BlockGrinder)theBlock).isDouble ? 3 : 4); i++){ for(int i = 0; i < (((BlockGrinder)theBlock).isDouble ? 3 : 4); i++){
list.add(StatCollector.translateToLocal("tooltip." + Util.MOD_ID_LOWER + "." + ((IName)theBlock).getName() + ".desc." + (i+1))); list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((IName)theBlock).getName() + ".desc." + (i+1)));
} }
} }
else list.add(Util.shiftForInfo()); else list.add(ItemUtil.shiftForInfo());
} }
@Override @Override

View file

@ -5,21 +5,17 @@ import cpw.mods.fml.relauncher.SideOnly;
import ellpeck.actuallyadditions.ActuallyAdditions; import ellpeck.actuallyadditions.ActuallyAdditions;
import ellpeck.actuallyadditions.inventory.GuiHandler; import ellpeck.actuallyadditions.inventory.GuiHandler;
import ellpeck.actuallyadditions.tile.TileEntityInputter; import ellpeck.actuallyadditions.tile.TileEntityInputter;
import ellpeck.actuallyadditions.util.IName; import ellpeck.actuallyadditions.util.*;
import ellpeck.actuallyadditions.util.Util;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity; import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon; import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.util.StatCollector; import net.minecraft.util.StatCollector;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
import java.util.List; import java.util.List;
@ -37,46 +33,11 @@ public class BlockInputter extends BlockContainerBase implements IName{
this.setTickRandomly(true); this.setTickRandomly(true);
} }
@Override
public void onBlockAdded(World world, int x, int y, int z){
super.onBlockAdded(world, x, y, z);
if (!world.isRemote){
Block block1 = world.getBlock(x, y, z-1);
Block block2 = world.getBlock(x, y, z+1);
Block block3 = world.getBlock(x-1, y, z);
Block block4 = world.getBlock(x+1, y, z);
int metaToSet = 1;
if (block1.func_149730_j() && !block2.func_149730_j()) metaToSet = 0;
if (block2.func_149730_j() && !block1.func_149730_j()) metaToSet = 1;
if (block3.func_149730_j() && !block4.func_149730_j()) metaToSet = 2;
if (block4.func_149730_j() && !block3.func_149730_j()) metaToSet = 3;
world.setBlockMetadataWithNotify(x, y, z, metaToSet, 2);
}
}
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack stack){
int rotation = MathHelper.floor_double((double)(player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
if (rotation == 0) world.setBlockMetadataWithNotify(x, y, z, 0, 2);
if (rotation == 1) world.setBlockMetadataWithNotify(x, y, z, 3, 2);
if (rotation == 2) world.setBlockMetadataWithNotify(x, y, z, 1, 2);
if (rotation == 3) world.setBlockMetadataWithNotify(x, y, z, 2, 2);
}
@Override @Override
public TileEntity createNewTileEntity(World world, int par2){ public TileEntity createNewTileEntity(World world, int par2){
return new TileEntityInputter(); return new TileEntityInputter();
} }
@Override
public int getLightValue(IBlockAccess world, int x, int y, int z){
return world.getBlockMetadata(x, y, z) > 3 ? 12 : 0;
}
@Override @Override
public IIcon getIcon(int side, int meta){ public IIcon getIcon(int side, int meta){
return this.blockIcon; return this.blockIcon;
@ -85,14 +46,14 @@ public class BlockInputter extends BlockContainerBase implements IName{
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconReg){ public void registerBlockIcons(IIconRegister iconReg){
this.blockIcon = iconReg.registerIcon(Util.MOD_ID_LOWER + ":" + this.getName()); this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName());
} }
@Override @Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9){ public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9){
if(!world.isRemote){ if(!world.isRemote){
TileEntityInputter furnace = (TileEntityInputter)world.getTileEntity(x, y, z); TileEntityInputter inputter = (TileEntityInputter)world.getTileEntity(x, y, z);
if (furnace != null) player.openGui(ActuallyAdditions.instance, GuiHandler.INPUTTER_ID, world, x, y, z); if (inputter != null) player.openGui(ActuallyAdditions.instance, GuiHandler.INPUTTER_ID, world, x, y, z);
return true; return true;
} }
return true; return true;
@ -150,13 +111,13 @@ public class BlockInputter extends BlockContainerBase implements IName{
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
if(Util.isShiftPressed()){ if(KeyUtil.isShiftPressed()){
list.add(StatCollector.translateToLocalFormatted("tooltip." + Util.MOD_ID_LOWER + "." + ((IName)theBlock).getName() + ".desc." + 1, Util.OBFUSCATED, Util.LIGHT_GRAY)); list.add(StatCollector.translateToLocalFormatted("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((IName)theBlock).getName() + ".desc." + 1, StringUtil.OBFUSCATED, StringUtil.LIGHT_GRAY));
for(int i = 1; i < 5; i++){ for(int i = 1; i < 5; i++){
list.add(StatCollector.translateToLocal("tooltip." + Util.MOD_ID_LOWER + "." + ((IName)theBlock).getName() + ".desc." + (i + 1))); list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((IName)theBlock).getName() + ".desc." + (i + 1)));
} }
} }
else list.add(Util.shiftForInfo()); else list.add(ItemUtil.shiftForInfo());
} }
@Override @Override

View file

@ -4,7 +4,9 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import ellpeck.actuallyadditions.blocks.metalists.TheMiscBlocks; import ellpeck.actuallyadditions.blocks.metalists.TheMiscBlocks;
import ellpeck.actuallyadditions.util.IName; import ellpeck.actuallyadditions.util.IName;
import ellpeck.actuallyadditions.util.Util; import ellpeck.actuallyadditions.util.ItemUtil;
import ellpeck.actuallyadditions.util.KeyUtil;
import ellpeck.actuallyadditions.util.ModUtil;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
@ -52,7 +54,7 @@ public class BlockMisc extends Block implements IName{
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconReg){ public void registerBlockIcons(IIconRegister iconReg){
for(int i = 0; i < textures.length; i++){ for(int i = 0; i < textures.length; i++){
textures[i] = iconReg.registerIcon(Util.MOD_ID_LOWER + ":" + this.getName() + allMiscBlocks[i].getName()); textures[i] = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + allMiscBlocks[i].getName());
} }
} }
@ -86,8 +88,8 @@ public class BlockMisc extends Block implements IName{
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
if(Util.isShiftPressed()) list.add(StatCollector.translateToLocal("tooltip." + Util.MOD_ID_LOWER + "." + ((IName)theBlock).getName() + allMiscBlocks[stack.getItemDamage()].getName() + ".desc")); if(KeyUtil.isShiftPressed()) list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((IName)theBlock).getName() + allMiscBlocks[stack.getItemDamage()].getName() + ".desc"));
else list.add(Util.shiftForInfo()); else list.add(ItemUtil.shiftForInfo());
} }
@Override @Override

View file

@ -1,5 +1,6 @@
package ellpeck.actuallyadditions.blocks; package ellpeck.actuallyadditions.blocks;
import ellpeck.actuallyadditions.util.BlockUtil;
import ellpeck.actuallyadditions.util.Util; import ellpeck.actuallyadditions.util.Util;
import net.minecraft.block.Block; import net.minecraft.block.Block;
@ -19,27 +20,27 @@ public class InitBlocks{
Util.logInfo("Initializing Blocks..."); Util.logInfo("Initializing Blocks...");
blockCompost = new BlockCompost(); blockCompost = new BlockCompost();
Util.register(blockCompost, BlockCompost.TheItemBlock.class); BlockUtil.register(blockCompost, BlockCompost.TheItemBlock.class);
blockMisc = new BlockMisc(); blockMisc = new BlockMisc();
Util.register(blockMisc, BlockMisc.TheItemBlock.class); BlockUtil.register(blockMisc, BlockMisc.TheItemBlock.class);
blockFeeder = new BlockFeeder(); blockFeeder = new BlockFeeder();
Util.register(blockFeeder, BlockFeeder.TheItemBlock.class); BlockUtil.register(blockFeeder, BlockFeeder.TheItemBlock.class);
blockGiantChest = new BlockGiantChest(); blockGiantChest = new BlockGiantChest();
Util.register(blockGiantChest, BlockGiantChest.TheItemBlock.class); BlockUtil.register(blockGiantChest, BlockGiantChest.TheItemBlock.class);
blockGrinder = new BlockGrinder(false); blockGrinder = new BlockGrinder(false);
Util.register(blockGrinder, BlockGrinder.TheItemBlock.class); BlockUtil.register(blockGrinder, BlockGrinder.TheItemBlock.class);
blockGrinderDouble = new BlockGrinder(true); blockGrinderDouble = new BlockGrinder(true);
Util.register(blockGrinderDouble, BlockGrinder.TheItemBlock.class); BlockUtil.register(blockGrinderDouble, BlockGrinder.TheItemBlock.class);
blockFurnaceDouble = new BlockFurnaceDouble(); blockFurnaceDouble = new BlockFurnaceDouble();
Util.register(blockFurnaceDouble, BlockFurnaceDouble.TheItemBlock.class); BlockUtil.register(blockFurnaceDouble, BlockFurnaceDouble.TheItemBlock.class);
blockInputter = new BlockInputter(); blockInputter = new BlockInputter();
Util.register(blockInputter, BlockInputter.TheItemBlock.class); BlockUtil.register(blockInputter, BlockInputter.TheItemBlock.class);
} }
} }

View file

@ -1,6 +1,6 @@
package ellpeck.actuallyadditions.blocks.render; package ellpeck.actuallyadditions.blocks.render;
import ellpeck.actuallyadditions.util.Util; import ellpeck.actuallyadditions.util.ModUtil;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
@ -14,7 +14,7 @@ public class RenderItems implements IItemRenderer{
public RenderItems(ModelBaseAA model){ public RenderItems(ModelBaseAA model){
this.theModel = model; this.theModel = model;
this.theTexture = new ResourceLocation(Util.MOD_ID_LOWER, "textures/blocks/models/" + this.theModel.getName() + ".png"); this.theTexture = new ResourceLocation(ModUtil.MOD_ID_LOWER, "textures/blocks/models/" + this.theModel.getName() + ".png");
} }
@Override @Override

View file

@ -1,6 +1,6 @@
package ellpeck.actuallyadditions.blocks.render; package ellpeck.actuallyadditions.blocks.render;
import ellpeck.actuallyadditions.util.Util; import ellpeck.actuallyadditions.util.ModUtil;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
@ -20,7 +20,7 @@ public class RenderTileEntity extends TileEntitySpecialRenderer{
GL11.glTranslatef((float)x+0.5F, (float)y-0.5F, (float)z+0.5F); GL11.glTranslatef((float)x+0.5F, (float)y-0.5F, (float)z+0.5F);
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
GL11.glTranslatef(0.0F, -2.0F, 0.0F); GL11.glTranslatef(0.0F, -2.0F, 0.0F);
this.bindTexture(new ResourceLocation(Util.MOD_ID_LOWER, "textures/blocks/models/" + this.theModel.getName() + ".png")); this.bindTexture(new ResourceLocation(ModUtil.MOD_ID_LOWER, "textures/blocks/models/" + this.theModel.getName() + ".png"));
theModel.render(0.0625F); theModel.render(0.0625F);
GL11.glPopMatrix(); GL11.glPopMatrix();
} }

View file

@ -59,6 +59,14 @@ public class ConfigValues{
public static int blackQuartzMinHeight; public static int blackQuartzMinHeight;
public static int blackQuartzMaxHeight; public static int blackQuartzMaxHeight;
public static boolean enableLeafBlowerRecipe;
public static boolean enableLeafBlowerAdvancedRecipe;
public static int leafBlowerRangeSides;
public static int leafBlowerRangeUp;
public static boolean leafBlowerDropItems;
public static boolean leafBlowerParticles;
public static boolean leafBlowerHasSound;
public static void defineConfigValues(Configuration config){ public static void defineConfigValues(Configuration config){
for(int i = 0; i < enabledFoodRecipes.length; i++){ for(int i = 0; i < enabledFoodRecipes.length; i++){
@ -68,6 +76,14 @@ public class ConfigValues{
enabledMiscRecipes[i] = config.getBoolean(TheMiscItems.values()[i].name, ConfigurationHandler.CATEGORY_MISC_CRAFTING, true, "If the Crafting Recipe for " + TheMiscItems.values()[i].name + " is Enabled"); enabledMiscRecipes[i] = config.getBoolean(TheMiscItems.values()[i].name, ConfigurationHandler.CATEGORY_MISC_CRAFTING, true, "If the Crafting Recipe for " + TheMiscItems.values()[i].name + " is Enabled");
} }
enableLeafBlowerRecipe = config.getBoolean("Leaf Blower", ConfigurationHandler.CATEGORY_ITEMS_CRAFTING, true, "If the Crafting Recipe for the Leaf Blower is Enabled");
enableLeafBlowerAdvancedRecipe = config.getBoolean("Advanced Leaf Blower", ConfigurationHandler.CATEGORY_ITEMS_CRAFTING, true, "If the Crafting Recipe for the Advanced Leaf Blower is Enabled");
leafBlowerDropItems = config.getBoolean("Leaf Blower: Drops Items", ConfigurationHandler.CATEGORY_TOOL_VALUES, true, "If the Leaf Blower lets destroyed Blocks' Drops drop");
leafBlowerParticles = config.getBoolean("Leaf Blower: Particles", ConfigurationHandler.CATEGORY_TOOL_VALUES, true, "If the Leaf Blower lets destroyed Blocks have particles when getting destroyed");
leafBlowerHasSound = config.getBoolean("Leaf Blower: Sound", ConfigurationHandler.CATEGORY_TOOL_VALUES, true, "If the Leaf Blower makes Sounds");
leafBlowerRangeSides = config.getInt("Leaf Blower: Side Range", ConfigurationHandler.CATEGORY_TOOL_VALUES, 5, 1, 25, "The Leaf Blower's Range to the Sides");
leafBlowerRangeUp = config.getInt("Leaf Blower: Height Range", ConfigurationHandler.CATEGORY_TOOL_VALUES, 1, 1, 10, "The Leaf Blower's Range to the Top and Bottom");
generateBlackQuartz = config.getBoolean("Black Quartz", ConfigurationHandler.CATEGORY_WORLD_GEN, true, "If the Black Quartz generates in the world"); generateBlackQuartz = config.getBoolean("Black Quartz", ConfigurationHandler.CATEGORY_WORLD_GEN, true, "If the Black Quartz generates in the world");
blackQuartzBaseAmount = config.getInt("Black Quartz Amount", ConfigurationHandler.CATEGORY_WORLD_GEN, 3, 1, 50, "How big a Black Quartz Vein is at least"); blackQuartzBaseAmount = config.getInt("Black Quartz Amount", ConfigurationHandler.CATEGORY_WORLD_GEN, 3, 1, 50, "How big a Black Quartz Vein is at least");
blackQuartzAdditionalChance = config.getInt("Black Quartz Additional Chance", ConfigurationHandler.CATEGORY_WORLD_GEN, 3, 0, 50, "How much bigger than the Base Amount a Black Quartz Vein can get"); blackQuartzAdditionalChance = config.getInt("Black Quartz Additional Chance", ConfigurationHandler.CATEGORY_WORLD_GEN, 3, 0, 50, "How much bigger than the Base Amount a Black Quartz Vein can get");

View file

@ -14,6 +14,8 @@ public class FoodCrafting{
public static void init(){ public static void init(){
ItemStack knifeStack = new ItemStack(InitItems.itemKnife, 1, Util.WILDCARD);
//Baguette //Baguette
if(ConfigValues.enabledFoodRecipes[TheFoods.BAGUETTE.ordinal()]) if(ConfigValues.enabledFoodRecipes[TheFoods.BAGUETTE.ordinal()])
GameRegistry.addSmelting(new ItemStack(InitItems.itemMisc, 1, GameRegistry.addSmelting(new ItemStack(InitItems.itemMisc, 1,
@ -27,7 +29,7 @@ public class FoodCrafting{
'M', new ItemStack(Blocks.brown_mushroom), 'M', new ItemStack(Blocks.brown_mushroom),
'C', new ItemStack(Items.carrot), 'C', new ItemStack(Items.carrot),
'F', new ItemStack(Items.cooked_fished, 1, Util.WILDCARD), 'F', new ItemStack(Items.cooked_fished, 1, Util.WILDCARD),
'K', new ItemStack(InitItems.itemKnife, 1, Util.WILDCARD), 'K', knifeStack,
'H', new ItemStack(InitItems.itemFoods, 1, TheFoods.CHEESE.ordinal())); 'H', new ItemStack(InitItems.itemFoods, 1, TheFoods.CHEESE.ordinal()));
//Hamburger //Hamburger
@ -36,7 +38,7 @@ public class FoodCrafting{
"KT ", "CB ", " T ", "KT ", "CB ", " T ",
'T', new ItemStack(InitItems.itemFoods, 1, TheFoods.TOAST.ordinal()), 'T', new ItemStack(InitItems.itemFoods, 1, TheFoods.TOAST.ordinal()),
'C', new ItemStack(InitItems.itemFoods, 1, TheFoods.CHEESE.ordinal()), 'C', new ItemStack(InitItems.itemFoods, 1, TheFoods.CHEESE.ordinal()),
'K', new ItemStack(InitItems.itemKnife, 1, Util.WILDCARD), 'K', knifeStack,
'B', new ItemStack(Items.cooked_beef)); 'B', new ItemStack(Items.cooked_beef));
//Big Cookie //Big Cookie
@ -54,13 +56,13 @@ public class FoodCrafting{
'C', new ItemStack(InitItems.itemFoods, 1, TheFoods.CHEESE.ordinal()), 'C', new ItemStack(InitItems.itemFoods, 1, TheFoods.CHEESE.ordinal()),
'F', new ItemStack(Items.cooked_fished, 1, Util.WILDCARD), 'F', new ItemStack(Items.cooked_fished, 1, Util.WILDCARD),
'B', new ItemStack(InitItems.itemFoods, 1, TheFoods.BAGUETTE.ordinal()), 'B', new ItemStack(InitItems.itemFoods, 1, TheFoods.BAGUETTE.ordinal()),
'K', new ItemStack(InitItems.itemKnife, 1, Util.WILDCARD)); 'K', knifeStack);
//French Fry //French Fry
if(ConfigValues.enabledFoodRecipes[TheFoods.FRENCH_FRY.ordinal()]) if(ConfigValues.enabledFoodRecipes[TheFoods.FRENCH_FRY.ordinal()])
GameRegistry.addShapelessRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.FRENCH_FRY.ordinal()), GameRegistry.addShapelessRecipe(new ItemStack(InitItems.itemFoods, 2, TheFoods.FRENCH_FRY.ordinal()),
new ItemStack(Items.baked_potato), new ItemStack(Items.baked_potato),
new ItemStack(InitItems.itemKnife, 1, Util.WILDCARD)); knifeStack);
//French Fries //French Fries
if(ConfigValues.enabledFoodRecipes[TheFoods.FRENCH_FRIES.ordinal()]) if(ConfigValues.enabledFoodRecipes[TheFoods.FRENCH_FRIES.ordinal()])
@ -92,7 +94,7 @@ public class FoodCrafting{
//Carrot Juice //Carrot Juice
if(ConfigValues.enabledFoodRecipes[TheFoods.CARROT_JUICE.ordinal()]) if(ConfigValues.enabledFoodRecipes[TheFoods.CARROT_JUICE.ordinal()])
GameRegistry.addShapelessRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.CARROT_JUICE.ordinal()), GameRegistry.addShapelessRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.CARROT_JUICE.ordinal()),
new ItemStack(Items.glass_bottle), new ItemStack(Items.carrot), new ItemStack(InitItems.itemKnife)); new ItemStack(Items.glass_bottle), new ItemStack(Items.carrot), knifeStack);
//Spaghetti //Spaghetti
if(ConfigValues.enabledFoodRecipes[TheFoods.SPAGHETTI.ordinal()]) if(ConfigValues.enabledFoodRecipes[TheFoods.SPAGHETTI.ordinal()])
@ -104,7 +106,7 @@ public class FoodCrafting{
//Noodle //Noodle
if(ConfigValues.enabledFoodRecipes[TheFoods.NOODLE.ordinal()]) if(ConfigValues.enabledFoodRecipes[TheFoods.NOODLE.ordinal()])
GameRegistry.addShapelessRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.NOODLE.ordinal()), GameRegistry.addShapelessRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.NOODLE.ordinal()),
new ItemStack(Items.wheat), new ItemStack(InitItems.itemKnife)); new ItemStack(Items.wheat), knifeStack);
//Chocolate //Chocolate
if(ConfigValues.enabledFoodRecipes[TheFoods.CHOCOLATE.ordinal()]) if(ConfigValues.enabledFoodRecipes[TheFoods.CHOCOLATE.ordinal()])

View file

@ -3,6 +3,7 @@ package ellpeck.actuallyadditions.crafting;
import ellpeck.actuallyadditions.items.InitItems; import ellpeck.actuallyadditions.items.InitItems;
import ellpeck.actuallyadditions.items.metalists.TheDusts; import ellpeck.actuallyadditions.items.metalists.TheDusts;
import ellpeck.actuallyadditions.recipe.GrinderRecipes; import ellpeck.actuallyadditions.recipe.GrinderRecipes;
import ellpeck.actuallyadditions.util.ModUtil;
import ellpeck.actuallyadditions.util.Util; import ellpeck.actuallyadditions.util.Util;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
import net.minecraft.init.Items; import net.minecraft.init.Items;
@ -37,11 +38,11 @@ public class GrinderCrafting{
} }
if(name.length() > 9 && name.substring(0, 9).equals("oreNether")){ if(name.length() > 9 && name.substring(0, 9).equals("oreNether")){
nameOfOre = name.substring(9); nameOfOre = name.substring(9);
resultAmount = 2; resultAmount = 4;
} }
if(name.length() > 8 && name.substring(0, 8).equals("denseore")){ if(name.length() > 8 && name.substring(0, 8).equals("denseore")){
nameOfOre = name.substring(8); nameOfOre = name.substring(8);
resultAmount = 6; resultAmount = 12;
} }
if(name.length() > 3 && name.substring(0, 3).equals("gem")) nameOfOre = name.substring(3); if(name.length() > 3 && name.substring(0, 3).equals("gem")) nameOfOre = name.substring(3);
if(name.length() > 5 && name.substring(0, 5).equals("ingot")) nameOfOre = name.substring(5); if(name.length() > 5 && name.substring(0, 5).equals("ingot")) nameOfOre = name.substring(5);
@ -55,24 +56,30 @@ public class GrinderCrafting{
if(allDusts != null && allDusts.size() > 0){ if(allDusts != null && allDusts.size() > 0){
ArrayList<ItemStack> allOresOfName = OreDictionary.getOres(name); ArrayList<ItemStack> allOresOfName = OreDictionary.getOres(name);
if(allOresOfName != null && allOresOfName.size() > 0){ if(allOresOfName != null && allOresOfName.size() > 0){
for(ItemStack output : allDusts){ for(ItemStack theDust : allDusts){
ItemStack output = theDust.copy();
output.stackSize = resultAmount; output.stackSize = resultAmount;
for(ItemStack input : allOresOfName){ for(ItemStack theInput : allOresOfName){
ItemStack input = theInput.copy();
if(GrinderRecipes.instance().getOutput(input, false) == null){ if(GrinderRecipes.instance().getOutput(input, false) == null){
ArrayList<ItemStack> specialStacks = null;
if(name.equals("oreNickel")){ if(name.equals("oreNickel")) specialStacks = OreDictionary.getOres("dustPlatinum");
ArrayList<ItemStack> specialStacks = OreDictionary.getOres("dustPlatinum");
for(ItemStack theSpecial : specialStacks) GrinderRecipes.instance().registerRecipe(input, output, theSpecial, 10); if(specialStacks != null){
for(ItemStack theSpecial : specialStacks){
ItemStack special = theSpecial.copy();
GrinderRecipes.instance().registerRecipe(input, output, special, 10);
}
} }
else GrinderRecipes.instance().registerRecipe(input, output, null, 0); else GrinderRecipes.instance().registerRecipe(input, output, null, 0);
} }
} }
} }
} }
else Util.AA_LOGGER.log(Level.ERROR, "Couldn't register Crusher Recipe! Didn't find Items registered as '" + name + "'! This shouldn't happen as there is something registered as '" + name + "' that doesn't exist!"); else ModUtil.AA_LOGGER.log(Level.ERROR, "Couldn't register Crusher Recipe! Didn't find Items registered as '" + name + "'! This shouldn't happen as there is something registered as '" + name + "' that doesn't exist!");
} }
else if(!name.equals("ingotBrick") && !name.equals("ingotBrickNether")) Util.AA_LOGGER.log(Level.WARN, "Couldn't register Crusher Recipe! An Item with OreDictionary Registry '" + nameToGetFrom + "' doesn't exist! It should correspond to '" + name + "'! This is not an Error, just a bit sad :("); else if(!name.equals("ingotBrick") && !name.equals("ingotBrickNether")) ModUtil.AA_LOGGER.log(Level.WARN, "Couldn't register Crusher Recipe! An Item with OreDictionary Registry '" + nameToGetFrom + "' doesn't exist! It should correspond to '" + name + "'! This is not an Error, just a bit sad :(");
} }
} }
} }

View file

@ -18,6 +18,24 @@ public class ItemCrafting{
public static void init(){ public static void init(){
//Leaf Blower
if(ConfigValues.enableLeafBlowerRecipe)
GameRegistry.addRecipe(new ItemStack(InitItems.itemLeafBlower),
" F", "IP", "IR",
'F', new ItemStack(Items.flint),
'I', new ItemStack(Items.iron_ingot),
'P', new ItemStack(Blocks.piston),
'R', new ItemStack(Items.redstone));
//Advanced Leaf Blower
if(ConfigValues.enableLeafBlowerAdvancedRecipe)
GameRegistry.addRecipe(new ItemStack(InitItems.itemLeafBlowerAdvanced),
" F", "DP", "DR",
'F', new ItemStack(Items.flint),
'D', new ItemStack(Items.diamond),
'P', new ItemStack(Blocks.piston),
'R', new ItemStack(Items.redstone));
//Quartz //Quartz
if(ConfigValues.enabledMiscRecipes[TheMiscItems.QUARTZ.ordinal()]) if(ConfigValues.enabledMiscRecipes[TheMiscItems.QUARTZ.ordinal()])
GameRegistry.addSmelting(new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ORE_QUARTZ.ordinal()), GameRegistry.addSmelting(new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ORE_QUARTZ.ordinal()),
@ -40,7 +58,6 @@ public class ItemCrafting{
if(ConfigValues.enabledMiscRecipes[TheMiscItems.MASHED_FOOD.ordinal()]) if(ConfigValues.enabledMiscRecipes[TheMiscItems.MASHED_FOOD.ordinal()])
initMashedFoodRecipes(); initMashedFoodRecipes();
//Ingots from Dusts //Ingots from Dusts
GameRegistry.addSmelting(new ItemStack(InitItems.itemDust, 1, TheDusts.IRON.ordinal()), GameRegistry.addSmelting(new ItemStack(InitItems.itemDust, 1, TheDusts.IRON.ordinal()),
new ItemStack(Items.iron_ingot), 1F); new ItemStack(Items.iron_ingot), 1F);

View file

@ -4,7 +4,7 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import ellpeck.actuallyadditions.blocks.InitBlocks; import ellpeck.actuallyadditions.blocks.InitBlocks;
import ellpeck.actuallyadditions.items.InitItems; import ellpeck.actuallyadditions.items.InitItems;
import ellpeck.actuallyadditions.util.Util; import ellpeck.actuallyadditions.util.ModUtil;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item; import net.minecraft.item.Item;
@ -18,7 +18,7 @@ public class CreativeTab extends CreativeTabs{
private List list; private List list;
public CreativeTab(){ public CreativeTab(){
super(Util.MOD_ID_LOWER); super(ModUtil.MOD_ID_LOWER);
} }
@Override @Override
@ -43,6 +43,8 @@ public class CreativeTab extends CreativeTabs{
this.addItem(InitItems.itemCrafterOnAStick); this.addItem(InitItems.itemCrafterOnAStick);
this.addItem(InitItems.itemDust); this.addItem(InitItems.itemDust);
this.addItem(InitItems.itemSpecialDrop); this.addItem(InitItems.itemSpecialDrop);
this.addItem(InitItems.itemLeafBlower);
this.addItem(InitItems.itemLeafBlowerAdvanced);
this.addItem(InitItems.itemPickaxeEmerald); this.addItem(InitItems.itemPickaxeEmerald);
this.addItem(InitItems.itemSwordEmerald); this.addItem(InitItems.itemSwordEmerald);

View file

@ -10,6 +10,7 @@ import ellpeck.actuallyadditions.items.metalists.TheMiscItems;
import net.minecraft.item.Item; import net.minecraft.item.Item;
public class CraftEvent{ public class CraftEvent{
@SubscribeEvent @SubscribeEvent
public void onCraftedEvent(PlayerEvent.ItemCraftedEvent event){ public void onCraftedEvent(PlayerEvent.ItemCraftedEvent event){
if(event.crafting.getItem() == InitItems.itemMisc && event.crafting.getItemDamage() == TheMiscItems.DOUGH.ordinal()){ if(event.crafting.getItem() == InitItems.itemMisc && event.crafting.getItemDamage() == TheMiscItems.DOUGH.ordinal()){

View file

@ -3,9 +3,6 @@ package ellpeck.actuallyadditions.event;
import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import ellpeck.actuallyadditions.items.InitItems; import ellpeck.actuallyadditions.items.InitItems;
import ellpeck.actuallyadditions.items.metalists.TheSpecialDrops; import ellpeck.actuallyadditions.items.metalists.TheSpecialDrops;
import net.minecraft.entity.EntityCreature;
import net.minecraft.entity.monster.EntityMob;
import net.minecraft.entity.passive.EntityAnimal;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraftforge.event.entity.living.LivingDropsEvent; import net.minecraftforge.event.entity.living.LivingDropsEvent;
@ -13,12 +10,13 @@ import net.minecraftforge.event.entity.living.LivingDropsEvent;
import java.util.Random; import java.util.Random;
public class KilledEvent{ public class KilledEvent{
@SubscribeEvent @SubscribeEvent
public void onEntityDropEvent(LivingDropsEvent event){ public void onEntityDropEvent(LivingDropsEvent event){
if(event.source.getEntity() instanceof EntityPlayer){ if(event.source.getEntity() instanceof EntityPlayer){
for(int i = 0; i < TheSpecialDrops.values().length; i++){ for(int i = 0; i < TheSpecialDrops.values().length; i++){
TheSpecialDrops theDrop = TheSpecialDrops.values()[i]; TheSpecialDrops theDrop = TheSpecialDrops.values()[i];
if(theDrop.canDrop && (event.entityLiving.getClass() == theDrop.dropFrom || (event.entityLiving instanceof EntityCreature && theDrop.dropFrom == EntityCreature.class) || (event.entityLiving instanceof EntityMob && theDrop.dropFrom == EntityMob.class) || (event.entityLiving instanceof EntityAnimal && theDrop.dropFrom == EntityAnimal.class))){ if(theDrop.canDrop && theDrop.dropFrom.isAssignableFrom(event.entityLiving.getClass())){
if(new Random().nextInt(100) + 1 <= theDrop.chance){ if(new Random().nextInt(100) + 1 <= theDrop.chance){
event.entityLiving.entityDropItem(new ItemStack(InitItems.itemSpecialDrop, new Random().nextInt(theDrop.maxAmount) + 1, theDrop.ordinal()), 0); event.entityLiving.entityDropItem(new ItemStack(InitItems.itemSpecialDrop, new Random().nextInt(theDrop.maxAmount) + 1, theDrop.ordinal()), 0);
} }

View file

@ -7,6 +7,7 @@ import ellpeck.actuallyadditions.items.InitItems;
import ellpeck.actuallyadditions.items.metalists.TheFoods; import ellpeck.actuallyadditions.items.metalists.TheFoods;
public class SmeltEvent{ public class SmeltEvent{
@SubscribeEvent @SubscribeEvent
public void onSmeltedEvent(PlayerEvent.ItemSmeltedEvent event){ public void onSmeltedEvent(PlayerEvent.ItemSmeltedEvent event){
if(event.smelting.getItem() == InitItems.itemFoods && event.smelting.getItemDamage() == TheFoods.BAGUETTE.ordinal()){ if(event.smelting.getItem() == InitItems.itemFoods && event.smelting.getItemDamage() == TheFoods.BAGUETTE.ordinal()){

View file

@ -5,6 +5,7 @@ import cpw.mods.fml.common.registry.GameRegistry;
import ellpeck.actuallyadditions.blocks.InitBlocks; import ellpeck.actuallyadditions.blocks.InitBlocks;
import ellpeck.actuallyadditions.blocks.metalists.TheMiscBlocks; import ellpeck.actuallyadditions.blocks.metalists.TheMiscBlocks;
import ellpeck.actuallyadditions.config.ConfigValues; import ellpeck.actuallyadditions.config.ConfigValues;
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.init.Blocks; import net.minecraft.init.Blocks;
@ -53,7 +54,7 @@ public class OreGen implements IWorldGenerator{
new WorldGenMinable(block, meta, maxVeinSize, blockIn).generate(world, random, posX, posY, posZ); new WorldGenMinable(block, meta, maxVeinSize, blockIn).generate(world, random, posX, posY, posZ);
} }
} }
else Util.AA_LOGGER.log(Level.FATAL, "Couldn't generate '" + block.getUnlocalizedName() + "' into the world because the Min Y coordinate is bigger than the Max! This is definitely a Config Error! Check the Files!"); else ModUtil.AA_LOGGER.log(Level.FATAL, "Couldn't generate '" + block.getUnlocalizedName() + "' into the world because the Min Y coordinate is bigger than the Max! This is definitely a Config Error! Check the Files!");
} }
public int getRandom(int base, int extra, Random rand){ public int getRandom(int base, int extra, Random rand){

View file

@ -4,7 +4,8 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import ellpeck.actuallyadditions.tile.TileEntityBase; import ellpeck.actuallyadditions.tile.TileEntityBase;
import ellpeck.actuallyadditions.tile.TileEntityFeeder; import ellpeck.actuallyadditions.tile.TileEntityFeeder;
import ellpeck.actuallyadditions.util.Util; import ellpeck.actuallyadditions.util.AssetUtil;
import ellpeck.actuallyadditions.util.ModUtil;
import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
@ -16,7 +17,7 @@ import java.util.Arrays;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class GuiFeeder extends GuiContainer{ public class GuiFeeder extends GuiContainer{
private static final ResourceLocation resLoc = Util.getGuiLocation("guiFeeder"); private static final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiFeeder");
private TileEntityFeeder tileFeeder; private TileEntityFeeder tileFeeder;
public int loveCounter; public int loveCounter;
@ -31,7 +32,7 @@ public class GuiFeeder extends GuiContainer{
@Override @Override
public void drawGuiContainerBackgroundLayer(float f, int x, int y){ public void drawGuiContainerBackgroundLayer(float f, int x, int y){
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(Util.GUI_INVENTORY_LOCATION); this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION);
this.drawTexturedModalRect(this.guiLeft, this.guiTop+70, 0, 0, 176, 86); this.drawTexturedModalRect(this.guiLeft, this.guiTop+70, 0, 0, 176, 86);
this.mc.getTextureManager().bindTexture(resLoc); this.mc.getTextureManager().bindTexture(resLoc);
this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 70); this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 70);
@ -58,7 +59,7 @@ public class GuiFeeder extends GuiContainer{
public void drawScreen(int x, int y, float f){ public void drawScreen(int x, int y, float f){
super.drawScreen(x, y, f); super.drawScreen(x, y, f);
if(x >= guiLeft+69 && y >= guiTop+30 && x <= guiLeft+69+10 && y <= guiTop+30+10){ if(x >= guiLeft+69 && y >= guiTop+30 && x <= guiLeft+69+10 && y <= guiTop+30+10){
String[] array = new String[]{(this.tileFeeder.currentAnimalAmount + " " + StatCollector.translateToLocal("info." + Util.MOD_ID_LOWER + ".gui.animals")), ((this.tileFeeder.currentAnimalAmount >= 2 && this.tileFeeder.currentAnimalAmount < this.tileFeeder.animalThreshold) ? StatCollector.translateToLocal("info." + Util.MOD_ID_LOWER + ".gui.enoughToBreed") : (this.tileFeeder.currentAnimalAmount >= this.tileFeeder.animalThreshold ? StatCollector.translateToLocal("info." + Util.MOD_ID_LOWER + ".gui.tooMany") : StatCollector.translateToLocal("info." + Util.MOD_ID_LOWER + ".gui.notEnough")))}; String[] array = new String[]{(this.tileFeeder.currentAnimalAmount + " " + StatCollector.translateToLocal("info." + ModUtil.MOD_ID_LOWER + ".gui.animals")), ((this.tileFeeder.currentAnimalAmount >= 2 && this.tileFeeder.currentAnimalAmount < this.tileFeeder.animalThreshold) ? StatCollector.translateToLocal("info." + ModUtil.MOD_ID_LOWER + ".gui.enoughToBreed") : (this.tileFeeder.currentAnimalAmount >= this.tileFeeder.animalThreshold ? StatCollector.translateToLocal("info." + ModUtil.MOD_ID_LOWER + ".gui.tooMany") : StatCollector.translateToLocal("info." + ModUtil.MOD_ID_LOWER + ".gui.notEnough")))};
this.func_146283_a(Arrays.asList(array), x, y); this.func_146283_a(Arrays.asList(array), x, y);
} }
} }

View file

@ -4,7 +4,7 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import ellpeck.actuallyadditions.tile.TileEntityBase; import ellpeck.actuallyadditions.tile.TileEntityBase;
import ellpeck.actuallyadditions.tile.TileEntityFurnaceDouble; import ellpeck.actuallyadditions.tile.TileEntityFurnaceDouble;
import ellpeck.actuallyadditions.util.Util; import ellpeck.actuallyadditions.util.AssetUtil;
import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
@ -13,7 +13,7 @@ import org.lwjgl.opengl.GL11;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class GuiFurnaceDouble extends GuiContainer{ public class GuiFurnaceDouble extends GuiContainer{
private static final ResourceLocation resLoc = Util.getGuiLocation("guiFurnaceDouble"); private static final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiFurnaceDouble");
private TileEntityFurnaceDouble tileFurnace; private TileEntityFurnaceDouble tileFurnace;
public GuiFurnaceDouble(InventoryPlayer inventory, TileEntityBase tile){ public GuiFurnaceDouble(InventoryPlayer inventory, TileEntityBase tile){
@ -27,7 +27,7 @@ public class GuiFurnaceDouble extends GuiContainer{
public void drawGuiContainerBackgroundLayer(float f, int x, int y){ public void drawGuiContainerBackgroundLayer(float f, int x, int y){
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(Util.GUI_INVENTORY_LOCATION); this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION);
this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86); this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86);
this.mc.getTextureManager().bindTexture(resLoc); this.mc.getTextureManager().bindTexture(resLoc);

View file

@ -3,7 +3,7 @@ package ellpeck.actuallyadditions.inventory;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import ellpeck.actuallyadditions.tile.TileEntityBase; import ellpeck.actuallyadditions.tile.TileEntityBase;
import ellpeck.actuallyadditions.util.Util; import ellpeck.actuallyadditions.util.AssetUtil;
import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
@ -12,7 +12,7 @@ import org.lwjgl.opengl.GL11;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class GuiGiantChest extends GuiContainer{ public class GuiGiantChest extends GuiContainer{
private static final ResourceLocation resLoc = Util.getGuiLocation("guiGiantChest"); private static final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiGiantChest");
public GuiGiantChest(InventoryPlayer inventory, TileEntityBase tile){ public GuiGiantChest(InventoryPlayer inventory, TileEntityBase tile){
super(new ContainerGiantChest(inventory, tile)); super(new ContainerGiantChest(inventory, tile));
@ -26,7 +26,7 @@ public class GuiGiantChest extends GuiContainer{
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(resLoc); this.mc.getTextureManager().bindTexture(resLoc);
this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 242, 190); this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 242, 190);
this.mc.getTextureManager().bindTexture(Util.GUI_INVENTORY_LOCATION); this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION);
this.drawTexturedModalRect(this.guiLeft+33, this.guiTop+172, 0, 0, 176, 86); this.drawTexturedModalRect(this.guiLeft+33, this.guiTop+172, 0, 0, 176, 86);
} }
} }

View file

@ -4,7 +4,7 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import ellpeck.actuallyadditions.tile.TileEntityBase; import ellpeck.actuallyadditions.tile.TileEntityBase;
import ellpeck.actuallyadditions.tile.TileEntityGrinder; import ellpeck.actuallyadditions.tile.TileEntityGrinder;
import ellpeck.actuallyadditions.util.Util; import ellpeck.actuallyadditions.util.AssetUtil;
import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
@ -13,8 +13,8 @@ import org.lwjgl.opengl.GL11;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class GuiGrinder extends GuiContainer{ public class GuiGrinder extends GuiContainer{
private static final ResourceLocation resLoc = Util.getGuiLocation("guiGrinder"); private static final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiGrinder");
private static final ResourceLocation resLocDouble = Util.getGuiLocation("guiGrinderDouble"); private static final ResourceLocation resLocDouble = AssetUtil.getGuiLocation("guiGrinderDouble");
private TileEntityGrinder tileGrinder; private TileEntityGrinder tileGrinder;
private boolean isDouble; private boolean isDouble;
@ -30,7 +30,7 @@ public class GuiGrinder extends GuiContainer{
public void drawGuiContainerBackgroundLayer(float f, int x, int y){ public void drawGuiContainerBackgroundLayer(float f, int x, int y){
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(Util.GUI_INVENTORY_LOCATION); this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION);
this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86); this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86);
this.mc.getTextureManager().bindTexture(this.isDouble ? resLocDouble : resLoc); this.mc.getTextureManager().bindTexture(this.isDouble ? resLocDouble : resLoc);

View file

@ -6,7 +6,8 @@ import ellpeck.actuallyadditions.network.PacketHandler;
import ellpeck.actuallyadditions.network.PacketInputterButton; import ellpeck.actuallyadditions.network.PacketInputterButton;
import ellpeck.actuallyadditions.tile.TileEntityBase; import ellpeck.actuallyadditions.tile.TileEntityBase;
import ellpeck.actuallyadditions.tile.TileEntityInputter; import ellpeck.actuallyadditions.tile.TileEntityInputter;
import ellpeck.actuallyadditions.util.Util; import ellpeck.actuallyadditions.util.AssetUtil;
import ellpeck.actuallyadditions.util.ModUtil;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiButton;
@ -21,7 +22,7 @@ import org.lwjgl.opengl.GL11;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class GuiInputter extends GuiContainer{ public class GuiInputter extends GuiContainer{
private static final ResourceLocation resLoc = Util.getGuiLocation("guiInputter"); private static final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiInputter");
private TileEntityInputter tileInputter; private TileEntityInputter tileInputter;
private int x; private int x;
@ -35,13 +36,13 @@ public class GuiInputter extends GuiContainer{
private SmallerButton buttonSlotPullM; private SmallerButton buttonSlotPullM;
public static final String[] sideString = new String[]{ public static final String[] sideString = new String[]{
StatCollector.translateToLocal("info." + Util.MOD_ID_LOWER + ".gui.disabled"), StatCollector.translateToLocal("info." + ModUtil.MOD_ID_LOWER + ".gui.disabled"),
StatCollector.translateToLocal("info." + Util.MOD_ID_LOWER + ".gui.up"), StatCollector.translateToLocal("info." + ModUtil.MOD_ID_LOWER + ".gui.up"),
StatCollector.translateToLocal("info." + Util.MOD_ID_LOWER + ".gui.down"), StatCollector.translateToLocal("info." + ModUtil.MOD_ID_LOWER + ".gui.down"),
StatCollector.translateToLocal("info." + Util.MOD_ID_LOWER + ".gui.north"), StatCollector.translateToLocal("info." + ModUtil.MOD_ID_LOWER + ".gui.north"),
StatCollector.translateToLocal("info." + Util.MOD_ID_LOWER + ".gui.east"), StatCollector.translateToLocal("info." + ModUtil.MOD_ID_LOWER + ".gui.east"),
StatCollector.translateToLocal("info." + Util.MOD_ID_LOWER + ".gui.south"), StatCollector.translateToLocal("info." + ModUtil.MOD_ID_LOWER + ".gui.south"),
StatCollector.translateToLocal("info." + Util.MOD_ID_LOWER + ".gui.west")}; StatCollector.translateToLocal("info." + ModUtil.MOD_ID_LOWER + ".gui.west")};
public GuiInputter(InventoryPlayer inventory, TileEntityBase tile, int x, int y, int z, World world){ public GuiInputter(InventoryPlayer inventory, TileEntityBase tile, int x, int y, int z, World world){
super(new ContainerInputter(inventory, tile)); super(new ContainerInputter(inventory, tile));
@ -83,20 +84,20 @@ public class GuiInputter extends GuiContainer{
public void drawGuiContainerBackgroundLayer(float f, int x, int y){ public void drawGuiContainerBackgroundLayer(float f, int x, int y){
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(Util.GUI_INVENTORY_LOCATION); this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION);
this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86); this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86);
this.mc.getTextureManager().bindTexture(resLoc); this.mc.getTextureManager().bindTexture(resLoc);
this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 93); this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 93);
this.fontRendererObj.drawString(StatCollector.translateToLocal("info." + Util.MOD_ID_LOWER + ".gui.put"), guiLeft + 22 + 3, guiTop + 32, 4210752); this.fontRendererObj.drawString(StatCollector.translateToLocal("info." + ModUtil.MOD_ID_LOWER + ".gui.put"), guiLeft + 22 + 3, guiTop + 32, 4210752);
this.fontRendererObj.drawString(StatCollector.translateToLocal("info." + Util.MOD_ID_LOWER + ".gui.pull"), guiLeft + 107 + 3, guiTop + 32, 4210752); this.fontRendererObj.drawString(StatCollector.translateToLocal("info." + ModUtil.MOD_ID_LOWER + ".gui.pull"), guiLeft + 107 + 3, guiTop + 32, 4210752);
this.fontRendererObj.drawString(sideString[tileInputter.sideToPut+1], guiLeft + 24 + 1, guiTop + 45 + 3, 4210752); this.fontRendererObj.drawString(sideString[tileInputter.sideToPut+1], guiLeft + 24 + 1, guiTop + 45 + 3, 4210752);
this.fontRendererObj.drawString(StatCollector.translateToLocal("info." + Util.MOD_ID_LOWER + ".gui.slot") + " " + (tileInputter.slotToPut == -1 ? StatCollector.translateToLocal("info." + Util.MOD_ID_LOWER + ".gui.all") : tileInputter.slotToPut).toString(), guiLeft + 24 + 3, guiTop + 66 + 3, 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 + 24 + 3, guiTop + 66 + 3, 4210752);
this.fontRendererObj.drawString(sideString[tileInputter.sideToPull+1], guiLeft + 109 + 1, guiTop + 45 + 3, 4210752); this.fontRendererObj.drawString(sideString[tileInputter.sideToPull+1], guiLeft + 109 + 1, guiTop + 45 + 3, 4210752);
this.fontRendererObj.drawString(StatCollector.translateToLocal("info." + Util.MOD_ID_LOWER + ".gui.slot") + " " + (tileInputter.slotToPull == -1 ? StatCollector.translateToLocal("info." + Util.MOD_ID_LOWER + ".gui.all") : tileInputter.slotToPull).toString(), guiLeft + 109 + 3, guiTop + 66 + 3, 4210752); 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 + 109 + 3, guiTop + 66 + 3, 4210752);
} }
@Override @Override
@ -117,7 +118,7 @@ public class GuiInputter extends GuiContainer{
public class SmallerButton extends GuiButton{ public class SmallerButton extends GuiButton{
private final ResourceLocation resLoc = Util.getGuiLocation("guiInputter"); private final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiInputter");
public SmallerButton(int id, int x, int y, String display){ public SmallerButton(int id, int x, int y, String display){
super(id, x, y, 16, 16, display); super(id, x, y, 16, 16, display);

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.util.ItemUtil;
import ellpeck.actuallyadditions.util.Util; import ellpeck.actuallyadditions.util.Util;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
import net.minecraft.init.Items; import net.minecraft.init.Items;
@ -18,6 +19,8 @@ public class InitItems{
public static Item itemCrafterOnAStick; public static Item itemCrafterOnAStick;
public static Item itemDust; public static Item itemDust;
public static Item itemSpecialDrop; public static Item itemSpecialDrop;
public static Item itemLeafBlower;
public static Item itemLeafBlowerAdvanced;
public static Item itemPickaxeEmerald; public static Item itemPickaxeEmerald;
public static Item itemAxeEmerald; public static Item itemAxeEmerald;
@ -35,39 +38,45 @@ public class InitItems{
Util.logInfo("Initializing Items..."); Util.logInfo("Initializing Items...");
itemFertilizer = new ItemFertilizer(); itemFertilizer = new ItemFertilizer();
Util.register(itemFertilizer); ItemUtil.register(itemFertilizer);
itemMisc = new ItemMisc(); itemMisc = new ItemMisc();
Util.register(itemMisc); ItemUtil.register(itemMisc);
itemFoods = new ItemFoods(); itemFoods = new ItemFoods();
Util.register(itemFoods); ItemUtil.register(itemFoods);
itemKnife = new ItemKnife(); itemKnife = new ItemKnife();
Util.register(itemKnife); ItemUtil.register(itemKnife);
itemCrafterOnAStick = new ItemCrafterOnAStick(); itemCrafterOnAStick = new ItemCrafterOnAStick();
Util.register(itemCrafterOnAStick); ItemUtil.register(itemCrafterOnAStick);
itemDust = new ItemDust(); itemDust = new ItemDust();
Util.register(itemDust); ItemUtil.register(itemDust);
itemSpecialDrop = new ItemSpecialDrop(); itemSpecialDrop = new ItemSpecialDrop();
Util.register(itemSpecialDrop); ItemUtil.register(itemSpecialDrop);
itemLeafBlower = new ItemLeafBlower(false);
ItemUtil.register(itemLeafBlower);
itemLeafBlowerAdvanced = new ItemLeafBlower(true);
ItemUtil.register(itemLeafBlowerAdvanced);
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);
itemSwordEmerald = new ItemSwordAA(InitItemMaterials.toolMaterialEmerald, new ItemStack(Items.emerald), "itemSwordEmerald", EnumRarity.rare); itemSwordEmerald = new ItemSwordAA(InitItemMaterials.toolMaterialEmerald, new ItemStack(Items.emerald), "itemSwordEmerald", EnumRarity.rare);
itemHoeEmerald = new ItemHoeAA(InitItemMaterials.toolMaterialEmerald, new ItemStack(Items.emerald), "itemHoeEmerald", EnumRarity.rare); itemHoeEmerald = new ItemHoeAA(InitItemMaterials.toolMaterialEmerald, new ItemStack(Items.emerald), "itemHoeEmerald", EnumRarity.rare);
Util.registerItems(new Item[]{itemPickaxeEmerald, itemAxeEmerald, itemShovelEmerald, itemSwordEmerald, itemHoeEmerald}); ItemUtil.registerItems(new Item[]{itemPickaxeEmerald, itemAxeEmerald, itemShovelEmerald, itemSwordEmerald, itemHoeEmerald});
itemPickaxeObsidian = new ItemPickaxeAA(InitItemMaterials.toolMaterialObsidian, new ItemStack(Blocks.obsidian), "itemPickaxeObsidian", EnumRarity.uncommon); itemPickaxeObsidian = new ItemPickaxeAA(InitItemMaterials.toolMaterialObsidian, new ItemStack(Blocks.obsidian), "itemPickaxeObsidian", EnumRarity.uncommon);
itemAxeObsidian = new ItemAxeAA(InitItemMaterials.toolMaterialObsidian, new ItemStack(Blocks.obsidian), "itemAxeObsidian", EnumRarity.uncommon); itemAxeObsidian = new ItemAxeAA(InitItemMaterials.toolMaterialObsidian, new ItemStack(Blocks.obsidian), "itemAxeObsidian", EnumRarity.uncommon);
itemShovelObsidian = new ItemShovelAA(InitItemMaterials.toolMaterialObsidian, new ItemStack(Blocks.obsidian), "itemShovelObsidian", EnumRarity.uncommon); itemShovelObsidian = new ItemShovelAA(InitItemMaterials.toolMaterialObsidian, new ItemStack(Blocks.obsidian), "itemShovelObsidian", EnumRarity.uncommon);
itemSwordObsidian = new ItemSwordAA(InitItemMaterials.toolMaterialObsidian, new ItemStack(Blocks.obsidian), "itemSwordObsidian", EnumRarity.uncommon); itemSwordObsidian = new ItemSwordAA(InitItemMaterials.toolMaterialObsidian, new ItemStack(Blocks.obsidian), "itemSwordObsidian", EnumRarity.uncommon);
itemHoeObsidian = new ItemHoeAA(InitItemMaterials.toolMaterialObsidian, new ItemStack(Blocks.obsidian), "itemHoeObsidian", EnumRarity.uncommon); itemHoeObsidian = new ItemHoeAA(InitItemMaterials.toolMaterialObsidian, new ItemStack(Blocks.obsidian), "itemHoeObsidian", EnumRarity.uncommon);
Util.registerItems(new Item[]{itemPickaxeObsidian, itemAxeObsidian, itemShovelObsidian, itemSwordObsidian, itemHoeObsidian}); ItemUtil.registerItems(new Item[]{itemPickaxeObsidian, itemAxeObsidian, itemShovelObsidian, itemSwordObsidian, itemHoeObsidian});
} }
} }

View file

@ -5,7 +5,8 @@ import cpw.mods.fml.relauncher.SideOnly;
import ellpeck.actuallyadditions.ActuallyAdditions; import ellpeck.actuallyadditions.ActuallyAdditions;
import ellpeck.actuallyadditions.inventory.GuiHandler; import ellpeck.actuallyadditions.inventory.GuiHandler;
import ellpeck.actuallyadditions.util.IName; import ellpeck.actuallyadditions.util.IName;
import ellpeck.actuallyadditions.util.Util; import ellpeck.actuallyadditions.util.ItemUtil;
import ellpeck.actuallyadditions.util.ModUtil;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity; import net.minecraft.item.EnumRarity;
@ -26,7 +27,7 @@ public class ItemCrafterOnAStick extends Item implements IName{
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
list.add(Util.addStandardInformation(this)); list.add(ItemUtil.addStandardInformation(this));
} }
@Override @Override
@ -37,7 +38,7 @@ public class ItemCrafterOnAStick extends Item implements IName{
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconReg){ public void registerIcons(IIconRegister iconReg){
this.itemIcon = iconReg.registerIcon(Util.MOD_ID_LOWER + ":" + this.getName()); this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName());
} }
@Override @Override

View file

@ -4,7 +4,9 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import ellpeck.actuallyadditions.items.metalists.TheDusts; import ellpeck.actuallyadditions.items.metalists.TheDusts;
import ellpeck.actuallyadditions.util.IName; import ellpeck.actuallyadditions.util.IName;
import ellpeck.actuallyadditions.util.Util; import ellpeck.actuallyadditions.util.ItemUtil;
import ellpeck.actuallyadditions.util.KeyUtil;
import ellpeck.actuallyadditions.util.ModUtil;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
@ -56,8 +58,8 @@ public class ItemDust extends Item implements IName{
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld){ public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld){
if(Util.isShiftPressed()) list.add(StatCollector.translateToLocal("tooltip." + Util.MOD_ID_LOWER + "." + this.getName() + allDusts[stack.getItemDamage()].getName() + ".desc")); if(KeyUtil.isShiftPressed()) list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + this.getName() + allDusts[stack.getItemDamage()].getName() + ".desc"));
else list.add(Util.shiftForInfo()); else list.add(ItemUtil.shiftForInfo());
} }
@Override @Override
@ -74,6 +76,6 @@ public class ItemDust extends Item implements IName{
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconReg){ public void registerIcons(IIconRegister iconReg){
this.itemIcon = iconReg.registerIcon(Util.MOD_ID_LOWER + ":" + this.getName()); this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName());
} }
} }

View file

@ -3,7 +3,8 @@ package ellpeck.actuallyadditions.items;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import ellpeck.actuallyadditions.util.IName; import ellpeck.actuallyadditions.util.IName;
import ellpeck.actuallyadditions.util.Util; import ellpeck.actuallyadditions.util.ItemUtil;
import ellpeck.actuallyadditions.util.ModUtil;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity; import net.minecraft.item.EnumRarity;
@ -35,7 +36,7 @@ public class ItemFertilizer extends Item implements IName{
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
list.add(Util.addStandardInformation(this)); list.add(ItemUtil.addStandardInformation(this));
} }
@Override @Override
@ -46,7 +47,7 @@ public class ItemFertilizer extends Item implements IName{
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconReg){ public void registerIcons(IIconRegister iconReg){
this.itemIcon = iconReg.registerIcon(Util.MOD_ID_LOWER + ":" + this.getName()); this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName());
} }
@Override @Override

View file

@ -4,7 +4,9 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import ellpeck.actuallyadditions.items.metalists.TheFoods; import ellpeck.actuallyadditions.items.metalists.TheFoods;
import ellpeck.actuallyadditions.util.IName; import ellpeck.actuallyadditions.util.IName;
import ellpeck.actuallyadditions.util.Util; import ellpeck.actuallyadditions.util.ItemUtil;
import ellpeck.actuallyadditions.util.KeyUtil;
import ellpeck.actuallyadditions.util.ModUtil;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.item.EntityItem;
@ -92,12 +94,12 @@ public class ItemFoods extends ItemFood implements IName{
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld){ public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld){
if(Util.isShiftPressed()){ if(KeyUtil.isShiftPressed()){
list.add(StatCollector.translateToLocal("tooltip." + Util.MOD_ID_LOWER + "." + this.getName() + allFoods[stack.getItemDamage()].getName() + ".desc")); list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + this.getName() + allFoods[stack.getItemDamage()].getName() + ".desc"));
list.add(StatCollector.translateToLocal("tooltip." + Util.MOD_ID_LOWER + ".hunger.desc") + ": " + allFoods[stack.getItemDamage()].healAmount); list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".hunger.desc") + ": " + allFoods[stack.getItemDamage()].healAmount);
list.add(StatCollector.translateToLocal("tooltip." + Util.MOD_ID_LOWER + ".saturation.desc") + ": " + allFoods[stack.getItemDamage()].saturation); list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".saturation.desc") + ": " + allFoods[stack.getItemDamage()].saturation);
} }
else list.add(Util.shiftForInfo()); else list.add(ItemUtil.shiftForInfo());
} }
@Override @Override
@ -109,7 +111,7 @@ public class ItemFoods extends ItemFood implements IName{
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconReg){ public void registerIcons(IIconRegister iconReg){
for(int i = 0; i < textures.length; i++){ for(int i = 0; i < textures.length; i++){
textures[i] = iconReg.registerIcon(Util.MOD_ID_LOWER + ":" + this.getName() + allFoods[i].getName()); textures[i] = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + allFoods[i].getName());
} }
} }

View file

@ -4,13 +4,16 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import ellpeck.actuallyadditions.config.ConfigValues; import ellpeck.actuallyadditions.config.ConfigValues;
import ellpeck.actuallyadditions.util.IName; import ellpeck.actuallyadditions.util.IName;
import ellpeck.actuallyadditions.util.Util; import ellpeck.actuallyadditions.util.ItemUtil;
import ellpeck.actuallyadditions.util.KeyUtil;
import ellpeck.actuallyadditions.util.ModUtil;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity; import net.minecraft.item.EnumRarity;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon; import net.minecraft.util.IIcon;
import net.minecraft.util.StatCollector;
import java.util.List; import java.util.List;
@ -44,7 +47,12 @@ public class ItemKnife extends Item implements IName{
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
list.add(Util.addStandardInformation(this)); if(KeyUtil.isShiftPressed()){
list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + this.getName() + ".desc"));
list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".durability.desc") + ": " + (this.getMaxDamage()-this.getDamage(stack)) + "/" + this.getMaxDamage());
}
else list.add(ItemUtil.shiftForInfo());
} }
@Override @Override
@ -60,7 +68,7 @@ public class ItemKnife extends Item implements IName{
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconReg){ public void registerIcons(IIconRegister iconReg){
this.itemIcon = iconReg.registerIcon(Util.MOD_ID_LOWER + ":" + this.getName()); this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName());
} }
@Override @Override

View file

@ -0,0 +1,136 @@
package ellpeck.actuallyadditions.items;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import ellpeck.actuallyadditions.config.ConfigValues;
import ellpeck.actuallyadditions.util.*;
import net.minecraft.block.Block;
import net.minecraft.block.BlockBush;
import net.minecraft.block.BlockLeavesBase;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumAction;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ChunkCoordinates;
import net.minecraft.util.IIcon;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
public class ItemLeafBlower extends Item implements IName{
public final int range = ConfigValues.leafBlowerRangeSides;
public final int rangeUp = ConfigValues.leafBlowerRangeUp;
public final boolean doesDrop = ConfigValues.leafBlowerDropItems;
public final boolean hasParticles = ConfigValues.leafBlowerParticles;
public final boolean hasSound = ConfigValues.leafBlowerHasSound;
private final boolean isAdvanced;
public ItemLeafBlower(boolean isAdvanced){
this.isAdvanced = isAdvanced;
this.setMaxStackSize(1);
}
@Override
public void onUsingTick(ItemStack stack, EntityPlayer player, int time){
if(!player.worldObj.isRemote){
if(time <= getMaxItemUseDuration(stack) && time % 2 == 0){
this.breakStuff(player.worldObj, (int)player.posX, (int)player.posY, (int)player.posZ);
if(this.hasSound) player.worldObj.playSoundAtEntity(player, "minecart.base", 0.3F, 0.001F);
}
}
}
public void breakStuff(World world, int x, int y, int z){
ArrayList<ChunkCoordinates> theCoords = new ArrayList<ChunkCoordinates>();
for(int reachX = -range; reachX < range+1; reachX++){
for(int reachZ = -range; reachZ < range+1; reachZ++){
for(int reachY = (this.isAdvanced ? -range : -rangeUp); reachY < (this.isAdvanced ? range+1 : rangeUp+1); reachY++){
Block block = world.getBlock(x+reachX, y+reachY, z+reachZ);
if(block != null && (block instanceof BlockBush || (this.isAdvanced && block instanceof BlockLeavesBase))){
theCoords.add(new ChunkCoordinates(x+reachX, y+reachY, z+reachZ));
}
}
}
}
if(theCoords.size() > 0){
ChunkCoordinates theCoord = theCoords.get(new Random().nextInt(theCoords.size()));
Block theBlock = world.getBlock(theCoord.posX, theCoord.posY, theCoord.posZ);
ArrayList<ItemStack> drops = new ArrayList<ItemStack>();
int meta = world.getBlockMetadata(theCoord.posX, theCoord.posY, theCoord.posZ);
drops.addAll(theBlock.getDrops(world, theCoord.posX, theCoord.posY, theCoord.posZ, meta, 0));
world.setBlockToAir(theCoord.posX, theCoord.posY, theCoord.posZ);
if(this.hasParticles) world.playAuxSFX(2001, theCoord.posX, theCoord.posY, theCoord.posZ, Block.getIdFromBlock(theBlock)+(meta << 12));
if(this.doesDrop){
for(ItemStack theDrop : drops){
world.spawnEntityInWorld(new EntityItem(world, theCoord.posX + 0.5, theCoord.posY + 0.5, theCoord.posZ + 0.5, theDrop));
}
}
}
}
@Override
public int getMaxItemUseDuration(ItemStack stack){
return 100000;
}
@Override
public EnumAction getItemUseAction(ItemStack stack){
return EnumAction.none;
}
@Override
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player){
player.setItemInUse(stack, this.getMaxItemUseDuration(stack));
return stack;
}
@Override
public EnumRarity getRarity(ItemStack stack){
return this.isAdvanced ? EnumRarity.epic : EnumRarity.rare;
}
@Override
@SuppressWarnings("unchecked")
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
if(KeyUtil.isShiftPressed()){
list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + this.getName() + ".desc." + 1));
list.add(StringUtil.ITALIC + StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".itemLeafBlower.desc.2"));
list.add(StringUtil.ITALIC + StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".itemLeafBlower.desc.3"));
}
else list.add(ItemUtil.shiftForInfo());
}
@Override
public boolean getShareTag(){
return true;
}
@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 this.isAdvanced ? "itemLeafBlowerAdvanced" : "itemLeafBlower";
}
}

View file

@ -4,7 +4,9 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import ellpeck.actuallyadditions.items.metalists.TheMiscItems; import ellpeck.actuallyadditions.items.metalists.TheMiscItems;
import ellpeck.actuallyadditions.util.IName; import ellpeck.actuallyadditions.util.IName;
import ellpeck.actuallyadditions.util.Util; import ellpeck.actuallyadditions.util.ItemUtil;
import ellpeck.actuallyadditions.util.KeyUtil;
import ellpeck.actuallyadditions.util.ModUtil;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
@ -57,8 +59,8 @@ public class ItemMisc extends Item implements IName{
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld){ public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld){
if(Util.isShiftPressed()) list.add(StatCollector.translateToLocal("tooltip." + Util.MOD_ID_LOWER + "." + this.getName() + allMiscItems[stack.getItemDamage()].getName() + ".desc")); if(KeyUtil.isShiftPressed()) list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + this.getName() + allMiscItems[stack.getItemDamage()].getName() + ".desc"));
else list.add(Util.shiftForInfo()); else list.add(ItemUtil.shiftForInfo());
} }
@Override @Override
@ -70,7 +72,7 @@ public class ItemMisc extends Item implements IName{
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconReg){ public void registerIcons(IIconRegister iconReg){
for(int i = 0; i < textures.length; i++){ for(int i = 0; i < textures.length; i++){
textures[i] = iconReg.registerIcon(Util.MOD_ID_LOWER + ":" + this.getName() + allMiscItems[i].getName()); textures[i] = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + allMiscItems[i].getName());
} }
} }
} }

View file

@ -4,7 +4,9 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import ellpeck.actuallyadditions.items.metalists.TheSpecialDrops; import ellpeck.actuallyadditions.items.metalists.TheSpecialDrops;
import ellpeck.actuallyadditions.util.IName; import ellpeck.actuallyadditions.util.IName;
import ellpeck.actuallyadditions.util.Util; import ellpeck.actuallyadditions.util.ItemUtil;
import ellpeck.actuallyadditions.util.KeyUtil;
import ellpeck.actuallyadditions.util.ModUtil;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
@ -57,8 +59,8 @@ public class ItemSpecialDrop extends Item implements IName{
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld){ public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld){
if(Util.isShiftPressed()) list.add(StatCollector.translateToLocal("tooltip." + Util.MOD_ID_LOWER + "." + this.getName() + allDrops[stack.getItemDamage()].getName() + ".desc")); if(KeyUtil.isShiftPressed()) list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + this.getName() + allDrops[stack.getItemDamage()].getName() + ".desc"));
else list.add(Util.shiftForInfo()); else list.add(ItemUtil.shiftForInfo());
} }
@Override @Override
@ -70,7 +72,7 @@ public class ItemSpecialDrop extends Item implements IName{
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconReg){ public void registerIcons(IIconRegister iconReg){
for(int i = 0; i < textures.length; i++){ for(int i = 0; i < textures.length; i++){
textures[i] = iconReg.registerIcon(Util.MOD_ID_LOWER + ":" + this.getName() + allDrops[i].getName()); textures[i] = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + allDrops[i].getName());
} }
} }
} }

View file

@ -1,7 +1,7 @@
package ellpeck.actuallyadditions.items.metalists; package ellpeck.actuallyadditions.items.metalists;
import ellpeck.actuallyadditions.util.IName; import ellpeck.actuallyadditions.util.IName;
import ellpeck.actuallyadditions.util.Util; import ellpeck.actuallyadditions.util.StringUtil;
import net.minecraft.item.EnumRarity; import net.minecraft.item.EnumRarity;
public enum TheDusts implements IName{ public enum TheDusts implements IName{
@ -11,7 +11,7 @@ public enum TheDusts implements IName{
DIAMOND("Diamond", 292003, EnumRarity.rare), DIAMOND("Diamond", 292003, EnumRarity.rare),
EMERALD("Emerald", 4319527, EnumRarity.epic), EMERALD("Emerald", 4319527, EnumRarity.epic),
LAPIS("Lapis", 1849791, EnumRarity.uncommon), LAPIS("Lapis", 1849791, EnumRarity.uncommon),
QUARTZ("Quartz", Util.DECIMAL_COLOR_WHITE, EnumRarity.uncommon), QUARTZ("Quartz", StringUtil.DECIMAL_COLOR_WHITE, EnumRarity.uncommon),
COAL("Coal", 0, EnumRarity.uncommon), COAL("Coal", 0, EnumRarity.uncommon),
QUARTZ_BLACK("QuartzBlack", 18, EnumRarity.rare); QUARTZ_BLACK("QuartzBlack", 18, EnumRarity.rare);

View file

@ -13,12 +13,12 @@ public enum TheFoods implements IName{
CARROT_JUICE("CarrotJuice", 6, 0.2F, true, 20, EnumRarity.common), CARROT_JUICE("CarrotJuice", 6, 0.2F, true, 20, EnumRarity.common),
FISH_N_CHIPS("FishNChips", 20, 1F, false, 40, EnumRarity.uncommon), FISH_N_CHIPS("FishNChips", 20, 1F, false, 40, EnumRarity.uncommon),
FRENCH_FRIES("FrenchFries", 16, 0.7F, false, 32, EnumRarity.common), FRENCH_FRIES("FrenchFries", 16, 0.7F, false, 32, EnumRarity.common),
FRENCH_FRY("FrenchFry", 1, 0.01F, false, 3, EnumRarity.common), FRENCH_FRY("FrenchFry", 3, 0.01F, false, 3, EnumRarity.common),
SPAGHETTI("Spaghetti", 18, 0.8F, false, 38, EnumRarity.common), SPAGHETTI("Spaghetti", 18, 0.8F, false, 38, EnumRarity.common),
NOODLE("Noodle", 1, 0.01F, false, 3, EnumRarity.common), NOODLE("Noodle", 1, 0.01F, false, 3, EnumRarity.common),
CHOCOLATE_CAKE("ChocolateCake", 16, 0.45F, false, 45, EnumRarity.uncommon), CHOCOLATE_CAKE("ChocolateCake", 16, 0.45F, false, 45, EnumRarity.uncommon),
CHOCOLATE("Chocolate", 5, 0.05F, false, 15, EnumRarity.common), CHOCOLATE("Chocolate", 5, 0.05F, false, 15, EnumRarity.common),
TOAST("Toast", 7, 0.4F, false, 25, EnumRarity.common), TOAST("Toast", 3, 0.4F, false, 25, EnumRarity.common),
SUBMARINE_SANDWICH("SubmarineSandwich", 10, 0.7F, false, 40, EnumRarity.uncommon), SUBMARINE_SANDWICH("SubmarineSandwich", 10, 0.7F, false, 40, EnumRarity.uncommon),
BIG_COOKIE("BigCookie", 6, 0.1F, false, 20, EnumRarity.uncommon), BIG_COOKIE("BigCookie", 6, 0.1F, false, 20, EnumRarity.uncommon),
HAMBURGER("Hamburger", 14, 0.9F, false, 40, EnumRarity.common), HAMBURGER("Hamburger", 14, 0.9F, false, 40, EnumRarity.common),

View file

@ -10,10 +10,10 @@ import net.minecraft.item.EnumRarity;
public enum TheSpecialDrops implements IName{ public enum TheSpecialDrops implements IName{
SOLIDIFIED_EXPERIENCE("SolidifiedExperience", 70, 3, EntityCreature.class, EnumRarity.uncommon, ConfigValues.enableExperienceDrop), SOLIDIFIED_EXPERIENCE("SolidifiedExperience", 40, 3, EntityCreature.class, EnumRarity.uncommon, ConfigValues.enableExperienceDrop),
BLOOD_FRAGMENT("BloodFragment", 30, 1, EntityCreature.class, EnumRarity.uncommon, ConfigValues.enableBloodDrop), BLOOD_FRAGMENT("BloodFragment", 15, 1, EntityCreature.class, EnumRarity.uncommon, ConfigValues.enableBloodDrop),
HEART_PART("HeartPart", 10, 1, EntityCreature.class, EnumRarity.rare, ConfigValues.enableHeartDrop), HEART_PART("HeartPart", 5, 1, EntityCreature.class, EnumRarity.rare, ConfigValues.enableHeartDrop),
UNKNOWN_SUBSTANCE("UnknownSubstance", 5, 1, EntitySkeleton.class, EnumRarity.epic, ConfigValues.enableSubstanceDrop), UNKNOWN_SUBSTANCE("UnknownSubstance", 3, 1, EntitySkeleton.class, EnumRarity.epic, ConfigValues.enableSubstanceDrop),
PEARL_SHARD("PearlShard", 20, 3, EntityEnderman.class, EnumRarity.epic, ConfigValues.enablePearlShardDrop), PEARL_SHARD("PearlShard", 20, 3, EntityEnderman.class, EnumRarity.epic, ConfigValues.enablePearlShardDrop),
EMERALD_SHARD("EmeraldShard", 15, 1, EntityCreeper.class, EnumRarity.rare, ConfigValues.enableEmeraldShardDrop); EMERALD_SHARD("EmeraldShard", 15, 1, EntityCreeper.class, EnumRarity.rare, ConfigValues.enableEmeraldShardDrop);
@ -24,7 +24,7 @@ public enum TheSpecialDrops implements IName{
public final boolean canDrop; public final boolean canDrop;
public final EnumRarity rarity; public final EnumRarity rarity;
private TheSpecialDrops(String name, int chance, int maxAmount, Class<? extends EntityCreature> dropFrom, EnumRarity rarity, boolean canDrop){ TheSpecialDrops(String name, int chance, int maxAmount, Class<? extends EntityCreature> dropFrom, EnumRarity rarity, boolean canDrop){
this.name = name; this.name = name;
this.chance = chance; this.chance = chance;
this.rarity = rarity; this.rarity = rarity;

View file

@ -3,7 +3,9 @@ package ellpeck.actuallyadditions.items.tools;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import ellpeck.actuallyadditions.util.IName; import ellpeck.actuallyadditions.util.IName;
import ellpeck.actuallyadditions.util.Util; import ellpeck.actuallyadditions.util.ItemUtil;
import ellpeck.actuallyadditions.util.KeyUtil;
import ellpeck.actuallyadditions.util.ModUtil;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity; import net.minecraft.item.EnumRarity;
@ -25,16 +27,15 @@ public class ItemAxeAA extends ItemAxe implements IName{
this.name = unlocalizedName; this.name = unlocalizedName;
this.rarity = rarity; this.rarity = rarity;
this.repairItem = repairItem; this.repairItem = repairItem;
this.setUnlocalizedName(Util.setUnlocalizedName(this));
} }
@Override @Override
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
list.add(Util.addStandardInformation(this)); list.add(ItemUtil.addStandardInformation(this));
if(Util.isShiftPressed()){ if(KeyUtil.isShiftPressed()){
list.add(StatCollector.translateToLocal("tooltip." + Util.MOD_ID_LOWER + ".durability.desc") + ": " + (this.getMaxDamage()-this.getDamage(stack)) + "/" + this.getMaxDamage()); list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".durability.desc") + ": " + (this.getMaxDamage()-this.getDamage(stack)) + "/" + this.getMaxDamage());
} }
} }
@ -51,7 +52,7 @@ public class ItemAxeAA extends ItemAxe implements IName{
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconReg){ public void registerIcons(IIconRegister iconReg){
this.itemIcon = iconReg.registerIcon(Util.MOD_ID_LOWER + ":" + this.getName()); this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName());
} }
@Override @Override

View file

@ -3,7 +3,9 @@ package ellpeck.actuallyadditions.items.tools;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import ellpeck.actuallyadditions.util.IName; import ellpeck.actuallyadditions.util.IName;
import ellpeck.actuallyadditions.util.Util; import ellpeck.actuallyadditions.util.ItemUtil;
import ellpeck.actuallyadditions.util.KeyUtil;
import ellpeck.actuallyadditions.util.ModUtil;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity; import net.minecraft.item.EnumRarity;
@ -25,16 +27,15 @@ public class ItemHoeAA extends ItemHoe implements IName{
this.name = unlocalizedName; this.name = unlocalizedName;
this.rarity = rarity; this.rarity = rarity;
this.repairItem = repairItem; this.repairItem = repairItem;
this.setUnlocalizedName(Util.setUnlocalizedName(this));
} }
@Override @Override
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld){ public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld){
list.add(Util.addStandardInformation(this)); list.add(ItemUtil.addStandardInformation(this));
if(Util.isShiftPressed()){ if(KeyUtil.isShiftPressed()){
list.add(StatCollector.translateToLocal("tooltip." + Util.MOD_ID_LOWER + ".durability.desc") + ": " + (this.getMaxDamage()-this.getDamage(stack)) + "/" + this.getMaxDamage()); list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".durability.desc") + ": " + (this.getMaxDamage()-this.getDamage(stack)) + "/" + this.getMaxDamage());
} }
} }
@ -56,7 +57,7 @@ public class ItemHoeAA extends ItemHoe implements IName{
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconReg){ public void registerIcons(IIconRegister iconReg){
this.itemIcon = iconReg.registerIcon(Util.MOD_ID_LOWER + ":" + this.getName()); this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName());
} }
@Override @Override

View file

@ -3,7 +3,9 @@ package ellpeck.actuallyadditions.items.tools;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import ellpeck.actuallyadditions.util.IName; import ellpeck.actuallyadditions.util.IName;
import ellpeck.actuallyadditions.util.Util; import ellpeck.actuallyadditions.util.ItemUtil;
import ellpeck.actuallyadditions.util.KeyUtil;
import ellpeck.actuallyadditions.util.ModUtil;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity; import net.minecraft.item.EnumRarity;
@ -25,16 +27,15 @@ public class ItemPickaxeAA extends ItemPickaxe implements IName{
this.name = unlocalizedName; this.name = unlocalizedName;
this.rarity = rarity; this.rarity = rarity;
this.repairItem = repairItem; this.repairItem = repairItem;
this.setUnlocalizedName(Util.setUnlocalizedName(this));
} }
@Override @Override
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
list.add(Util.addStandardInformation(this)); list.add(ItemUtil.addStandardInformation(this));
if(Util.isShiftPressed()){ if(KeyUtil.isShiftPressed()){
list.add(StatCollector.translateToLocal("tooltip." + Util.MOD_ID_LOWER + ".durability.desc") + ": " + (this.getMaxDamage()-this.getDamage(stack)) + "/" + this.getMaxDamage()); list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".durability.desc") + ": " + (this.getMaxDamage()-this.getDamage(stack)) + "/" + this.getMaxDamage());
} }
} }
@ -56,7 +57,7 @@ public class ItemPickaxeAA extends ItemPickaxe implements IName{
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconReg){ public void registerIcons(IIconRegister iconReg){
this.itemIcon = iconReg.registerIcon(Util.MOD_ID_LOWER + ":" + this.getName()); this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName());
} }
@Override @Override

View file

@ -3,7 +3,9 @@ package ellpeck.actuallyadditions.items.tools;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import ellpeck.actuallyadditions.util.IName; import ellpeck.actuallyadditions.util.IName;
import ellpeck.actuallyadditions.util.Util; import ellpeck.actuallyadditions.util.ItemUtil;
import ellpeck.actuallyadditions.util.KeyUtil;
import ellpeck.actuallyadditions.util.ModUtil;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity; import net.minecraft.item.EnumRarity;
@ -25,16 +27,15 @@ public class ItemShovelAA extends ItemSpade implements IName{
this.name = unlocalizedName; this.name = unlocalizedName;
this.rarity = rarity; this.rarity = rarity;
this.repairItem = repairItem; this.repairItem = repairItem;
this.setUnlocalizedName(Util.setUnlocalizedName(this));
} }
@Override @Override
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
list.add(Util.addStandardInformation(this)); list.add(ItemUtil.addStandardInformation(this));
if(Util.isShiftPressed()){ if(KeyUtil.isShiftPressed()){
list.add(StatCollector.translateToLocal("tooltip." + Util.MOD_ID_LOWER + ".durability.desc") + ": " + (this.getMaxDamage()-this.getDamage(stack)) + "/" + this.getMaxDamage()); list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".durability.desc") + ": " + (this.getMaxDamage()-this.getDamage(stack)) + "/" + this.getMaxDamage());
} }
} }
@ -56,7 +57,7 @@ public class ItemShovelAA extends ItemSpade implements IName{
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconReg){ public void registerIcons(IIconRegister iconReg){
this.itemIcon = iconReg.registerIcon(Util.MOD_ID_LOWER + ":" + this.getName()); this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName());
} }
@Override @Override

View file

@ -3,7 +3,9 @@ package ellpeck.actuallyadditions.items.tools;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import ellpeck.actuallyadditions.util.IName; import ellpeck.actuallyadditions.util.IName;
import ellpeck.actuallyadditions.util.Util; import ellpeck.actuallyadditions.util.ItemUtil;
import ellpeck.actuallyadditions.util.KeyUtil;
import ellpeck.actuallyadditions.util.ModUtil;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity; import net.minecraft.item.EnumRarity;
@ -25,16 +27,15 @@ public class ItemSwordAA extends ItemSword implements IName{
this.name = unlocalizedName; this.name = unlocalizedName;
this.rarity = rarity; this.rarity = rarity;
this.repairItem = repairItem; this.repairItem = repairItem;
this.setUnlocalizedName(Util.setUnlocalizedName(this));
} }
@Override @Override
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld){ public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld){
list.add(Util.addStandardInformation(this)); list.add(ItemUtil.addStandardInformation(this));
if(Util.isShiftPressed()){ if(KeyUtil.isShiftPressed()){
list.add(StatCollector.translateToLocal("tooltip." + Util.MOD_ID_LOWER + ".durability.desc") + ": " + (this.getMaxDamage()-this.getDamage(stack)) + "/" + this.getMaxDamage()); list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".durability.desc") + ": " + (this.getMaxDamage()-this.getDamage(stack)) + "/" + this.getMaxDamage());
} }
} }
@ -56,7 +57,7 @@ public class ItemSwordAA extends ItemSword implements IName{
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconReg){ public void registerIcons(IIconRegister iconReg){
this.itemIcon = iconReg.registerIcon(Util.MOD_ID_LOWER + ":" + this.getName()); this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName());
} }
@Override @Override

View file

@ -3,14 +3,14 @@ package ellpeck.actuallyadditions.network;
import cpw.mods.fml.common.network.NetworkRegistry; import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper; import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import ellpeck.actuallyadditions.util.Util; import ellpeck.actuallyadditions.util.ModUtil;
public class PacketHandler{ public class PacketHandler{
public static SimpleNetworkWrapper theNetwork; public static SimpleNetworkWrapper theNetwork;
public static void init(){ public static void init(){
theNetwork = NetworkRegistry.INSTANCE.newSimpleChannel(Util.MOD_ID_LOWER); theNetwork = NetworkRegistry.INSTANCE.newSimpleChannel(ModUtil.MOD_ID_LOWER);
theNetwork.registerMessage(PacketTileEntityFeeder.Handler.class, PacketTileEntityFeeder.class, 0, Side.CLIENT); theNetwork.registerMessage(PacketTileEntityFeeder.Handler.class, PacketTileEntityFeeder.class, 0, Side.CLIENT);
theNetwork.registerMessage(PacketInputterButton.Handler.class, PacketInputterButton.class, 1, Side.SERVER); theNetwork.registerMessage(PacketInputterButton.Handler.class, PacketInputterButton.class, 1, Side.SERVER);

View file

@ -1,6 +1,7 @@
package ellpeck.actuallyadditions.tile; package ellpeck.actuallyadditions.tile;
import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.GameRegistry;
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.block.BlockAir;
@ -28,12 +29,12 @@ public class TileEntityBase extends TileEntity{
public static void init(){ public static void init(){
Util.logInfo("Registering TileEntities..."); Util.logInfo("Registering TileEntities...");
GameRegistry.registerTileEntity(TileEntityCompost.class, Util.MOD_ID_LOWER + ":tileEntityCompost"); GameRegistry.registerTileEntity(TileEntityCompost.class, ModUtil.MOD_ID_LOWER + ":tileEntityCompost");
GameRegistry.registerTileEntity(TileEntityFeeder.class, Util.MOD_ID_LOWER + ":tileEntityFeeder"); GameRegistry.registerTileEntity(TileEntityFeeder.class, ModUtil.MOD_ID_LOWER + ":tileEntityFeeder");
GameRegistry.registerTileEntity(TileEntityGiantChest.class, Util.MOD_ID_LOWER + ":tileEntityGiantChest"); GameRegistry.registerTileEntity(TileEntityGiantChest.class, ModUtil.MOD_ID_LOWER + ":tileEntityGiantChest");
GameRegistry.registerTileEntity(TileEntityGrinder.class, Util.MOD_ID_LOWER + ":tileEntityGrinder"); GameRegistry.registerTileEntity(TileEntityGrinder.class, ModUtil.MOD_ID_LOWER + ":tileEntityGrinder");
GameRegistry.registerTileEntity(TileEntityFurnaceDouble.class, Util.MOD_ID_LOWER + ":tileEntityFurnaceDouble"); GameRegistry.registerTileEntity(TileEntityFurnaceDouble.class, ModUtil.MOD_ID_LOWER + ":tileEntityFurnaceDouble");
GameRegistry.registerTileEntity(TileEntityInputter.class, Util.MOD_ID_LOWER + ":tileEntityInputter"); GameRegistry.registerTileEntity(TileEntityInputter.class, ModUtil.MOD_ID_LOWER + ":tileEntityInputter");
} }
@Override @Override

View file

@ -1,6 +1,7 @@
package ellpeck.actuallyadditions.tile; package ellpeck.actuallyadditions.tile;
import net.minecraft.inventory.IInventory; import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
@ -37,38 +38,53 @@ public class TileEntityInputter extends TileEntityInventoryBase{
if(this.placeToPullSlotAmount > 0){ if(this.placeToPullSlotAmount > 0){
IInventory theInventory = (IInventory)placeToPull; IInventory theInventory = (IInventory)placeToPull;
int theSlotToPull = this.slotToPull; int theSlotToPull = this.slotToPull;
int maxSize = theInventory.getInventoryStackLimit();
ISidedInventory theSided = null;
if(theInventory instanceof ISidedInventory) theSided = (ISidedInventory)theInventory;
ItemStack theStack = null; ItemStack theStack = null;
if(theSlotToPull != -1) theStack = theInventory.getStackInSlot(theSlotToPull); for(int i = (theSlotToPull != -1 ? theSlotToPull : 0); i < (theSlotToPull != -1 ? theSlotToPull+1 : placeToPullSlotAmount); i++){
else{
for(int i = 0; i < this.placeToPullSlotAmount; i++){
ItemStack tempStack = theInventory.getStackInSlot(i); ItemStack tempStack = theInventory.getStackInSlot(i);
if(tempStack != null && (this.slots[0] == null || (tempStack.isItemEqual(this.slots[0]) && this.slots[0].stackSize < this.getInventoryStackLimit()))){ if(tempStack != null){
if(tempStack.getMaxStackSize() < this.getInventoryStackLimit()) maxSize = tempStack.getMaxStackSize();
else maxSize = this.getInventoryStackLimit();
}
if(tempStack != null && (this.slots[0] == null || (tempStack.isItemEqual(this.slots[0]) && this.slots[0].stackSize < maxSize))){
if(theSided != null){
for(int j = 0; j < 5; j++){
if(theSided.canExtractItem(i, tempStack, j)){
theStack = tempStack; theStack = tempStack;
theSlotToPull = i; theSlotToPull = i;
break; break;
} }
} }
} }
if(theSlotToPull != -1 && theStack != null){ else{
theStack = tempStack;
theSlotToPull = i;
break;
}
}
}
if(theStack != null){
if(this.slots[0] != null){ if(this.slots[0] != null){
if(theStack.isItemEqual(this.slots[0])){ if(theStack.isItemEqual(this.slots[0])){
if(theStack.stackSize <= this.getInventoryStackLimit() - this.slots[0].stackSize){ if(theStack.stackSize <= maxSize - this.slots[0].stackSize){
this.slots[0].stackSize += theStack.stackSize; this.slots[0].stackSize += theStack.stackSize;
theInventory.setInventorySlotContents(theSlotToPull, null); theInventory.setInventorySlotContents(theSlotToPull, null);
} }
else if(theStack.stackSize > this.getInventoryStackLimit() - this.slots[0].stackSize){ else if(theStack.stackSize > maxSize - this.slots[0].stackSize){
theStack.stackSize -= (this.getInventoryStackLimit() - this.slots[0].stackSize); theInventory.decrStackSize(theSlotToPull, maxSize - this.slots[0].stackSize);
this.slots[0].stackSize = this.getInventoryStackLimit(); this.slots[0].stackSize = maxSize;
} }
} }
} }
else{ else{
ItemStack toBePut = theStack.copy(); ItemStack toBePut = theStack.copy();
if(theInventory.getInventoryStackLimit() < toBePut.stackSize) toBePut.stackSize = theInventory.getInventoryStackLimit(); if(maxSize < toBePut.stackSize) toBePut.stackSize = maxSize;
this.setInventorySlotContents(0, toBePut); this.setInventorySlotContents(0, toBePut);
if(theStack.stackSize == toBePut.stackSize) theInventory.setInventorySlotContents(theSlotToPull, null); if(theStack.stackSize == toBePut.stackSize) theInventory.setInventorySlotContents(theSlotToPull, null);
else theStack.stackSize -= toBePut.stackSize; else theInventory.decrStackSize(theSlotToPull, toBePut.stackSize);
} }
} }
} }
@ -78,39 +94,57 @@ public class TileEntityInputter extends TileEntityInventoryBase{
if(this.placeToPutSlotAmount > 0){ if(this.placeToPutSlotAmount > 0){
IInventory theInventory = (IInventory)placeToPut; IInventory theInventory = (IInventory)placeToPut;
int theSlotToPut = this.slotToPut; int theSlotToPut = this.slotToPut;
int maxSize = theInventory.getInventoryStackLimit();
ISidedInventory theSided = null;
if(theInventory instanceof ISidedInventory) theSided = (ISidedInventory)theInventory;
boolean can = false;
if(this.slots[0] != null){ if(this.slots[0] != null){
ItemStack theStack = null; ItemStack theStack = null;
if(theSlotToPut != -1) theStack = theInventory.getStackInSlot(theSlotToPut); for(int i = (theSlotToPut != -1 ? theSlotToPut : 0); i < (theSlotToPut != -1 ? theSlotToPut+1 : placeToPutSlotAmount); i++){
else{
for(int i = 0; i < this.placeToPutSlotAmount; i++){
ItemStack tempStack = theInventory.getStackInSlot(i); ItemStack tempStack = theInventory.getStackInSlot(i);
if(tempStack == null || (theInventory.isItemValidForSlot(i, this.slots[0]) && tempStack.isItemEqual(this.slots[0]) && tempStack.stackSize < theInventory.getInventoryStackLimit())){ if(tempStack != null){
if(tempStack.getMaxStackSize() < theInventory.getInventoryStackLimit()) maxSize = tempStack.getMaxStackSize();
else maxSize = theInventory.getInventoryStackLimit();
}
if(tempStack == null || (theInventory.isItemValidForSlot(i, this.slots[0]) && tempStack.isItemEqual(this.slots[0]) && tempStack.stackSize < maxSize)){
if(theSided != null){
for(int j = 0; j < 5; j++){
if(theSided.canInsertItem(i, this.slots[0], j)){
theStack = tempStack; theStack = tempStack;
theSlotToPut = i; theSlotToPut = i;
can = true;
break; break;
} }
} }
} }
if(theSlotToPut != -1 && theInventory.isItemValidForSlot(theSlotToPut, this.slots[0])){ else{
theStack = tempStack;
theSlotToPut = i;
can = true;
break;
}
}
}
if(can){
if(theStack != null){ if(theStack != null){
if(theStack.isItemEqual(this.slots[0])){ if(theStack.isItemEqual(this.slots[0])){
if(this.slots[0].stackSize <= theInventory.getInventoryStackLimit() - theStack.stackSize){ if(this.slots[0].stackSize <= maxSize - theStack.stackSize){
theStack.stackSize += this.slots[0].stackSize; theStack.stackSize += this.slots[0].stackSize;
this.slots[0] = null; this.slots[0] = null;
} }
else if(this.slots[0].stackSize > theInventory.getInventoryStackLimit() - theStack.stackSize){ else if(this.slots[0].stackSize > maxSize - theStack.stackSize){
this.slots[0].stackSize -= (theInventory.getInventoryStackLimit() - theStack.stackSize); this.decrStackSize(0, maxSize - theStack.stackSize);
theStack.stackSize = theInventory.getInventoryStackLimit(); theStack.stackSize = maxSize;
} }
} }
} }
else{ else{
ItemStack toBePut = this.slots[0].copy(); ItemStack toBePut = this.slots[0].copy();
if(theInventory.getInventoryStackLimit() < toBePut.stackSize) toBePut.stackSize = theInventory.getInventoryStackLimit(); if(maxSize < toBePut.stackSize) toBePut.stackSize = maxSize;
theInventory.setInventorySlotContents(theSlotToPut, toBePut); theInventory.setInventorySlotContents(theSlotToPut, toBePut);
if(this.slots[0].stackSize == toBePut.stackSize) this.slots[0] = null; if(this.slots[0].stackSize == toBePut.stackSize) this.slots[0] = null;
else this.slots[0].stackSize -= toBePut.stackSize; else this.decrStackSize(0, toBePut.stackSize);
} }
} }
} }

View file

@ -0,0 +1,13 @@
package ellpeck.actuallyadditions.util;
import net.minecraft.util.ResourceLocation;
public class AssetUtil{
public static final ResourceLocation GUI_INVENTORY_LOCATION = getGuiLocation("guiInventory");
public static ResourceLocation getGuiLocation(String file){
return new ResourceLocation(ModUtil.MOD_ID_LOWER, "textures/gui/" + file + ".png");
}
}

View file

@ -0,0 +1,20 @@
package ellpeck.actuallyadditions.util;
import cpw.mods.fml.common.registry.GameRegistry;
import ellpeck.actuallyadditions.creative.CreativeTab;
import net.minecraft.block.Block;
import net.minecraft.item.ItemBlock;
public class BlockUtil{
public static String createUnlocalizedName(Block block){
return ModUtil.MOD_ID_LOWER + "." + ((IName)block).getName();
}
public static void register(Block block, Class<? extends ItemBlock> itemBlock){
block.setCreativeTab(CreativeTab.instance);
block.setBlockName(createUnlocalizedName(block));
GameRegistry.registerBlock(block, itemBlock, ((IName)block).getName());
}
}

View file

@ -2,6 +2,6 @@ package ellpeck.actuallyadditions.util;
public interface IName{ public interface IName{
public abstract String getName(); String getName();
} }

View file

@ -0,0 +1,35 @@
package ellpeck.actuallyadditions.util;
import cpw.mods.fml.common.registry.GameRegistry;
import ellpeck.actuallyadditions.creative.CreativeTab;
import net.minecraft.item.Item;
import net.minecraft.util.StatCollector;
public class ItemUtil{
public static String addStandardInformation(Item item){
if(KeyUtil.isShiftPressed()) return StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((IName)item).getName() + ".desc");
else return shiftForInfo();
}
public static void registerItems(Item[] items){
for(Item item : items){
register(item);
}
}
public static void register(Item item){
item.setCreativeTab(CreativeTab.instance);
item.setUnlocalizedName(createUnlocalizedName(item));
GameRegistry.registerItem(item, ((IName)item).getName());
}
public static String createUnlocalizedName(Item item){
return ModUtil.MOD_ID_LOWER + "." + ((IName)item).getName();
}
public static String shiftForInfo(){
return StringUtil.GREEN + StringUtil.ITALIC + StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".shiftForInfo.desc");
}
}

View file

@ -0,0 +1,15 @@
package ellpeck.actuallyadditions.util;
import org.lwjgl.input.Keyboard;
public class KeyUtil{
public static boolean isShiftPressed(){
return Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT);
}
public static boolean isControlPressed(){
return Keyboard.isKeyDown(Keyboard.KEY_LCONTROL) || Keyboard.isKeyDown(Keyboard.KEY_RCONTROL);
}
}

View file

@ -0,0 +1,16 @@
package ellpeck.actuallyadditions.util;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
public class ModUtil{
public static final String VERSION = "1.7.10-0.0.2.3";
public static final String MOD_ID = "ActuallyAdditions";
public static final String NAME = "Actually Additions";
public static final String MOD_ID_LOWER = MOD_ID.toLowerCase();
public static final Logger AA_LOGGER = LogManager.getLogger(MOD_ID);
}

View file

@ -0,0 +1,31 @@
package ellpeck.actuallyadditions.util;
public class StringUtil{
public static final String BLACK = (char)167 + "0";
public static final String BLUE = (char)167 + "1";
public static final String GREEN = (char)167 + "2";
public static final String TEAL = (char)167 + "3";
public static final String RED = (char)167 + "4";
public static final String PURPLE = (char)167 + "5";
public static final String ORANGE = (char)167 + "6";
public static final String LIGHT_GRAY = (char)167 + "7";
public static final String GRAY = (char)167 + "8";
public static final String LIGHT_BLUE = (char)167 + "9";
public static final String BRIGHT_GREEN = (char)167 + "a";
public static final String BRIGHT_BLUE = (char)167 + "b";
public static final String LIGHT_RED = (char)167 + "c";
public static final String PINK = (char)167 + "d";
public static final String YELLOW = (char)167 + "e";
public static final String WHITE = (char)167 + "f";
public static final String BOLD = (char)167 + "l";
public static final String UNDERLINE = (char)167 + "n";
public static final String ITALIC = (char)167 + "o";
public static final String OBFUSCATED = (char)167 + "k";
public static final String RESET = (char)167 + "r";
public static final String[] ROMAN_NUMERALS = new String[]{"", "I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX", "X"};
public static final int DECIMAL_COLOR_WHITE = 16777215;
}

View file

@ -1,109 +1,17 @@
package ellpeck.actuallyadditions.util; package ellpeck.actuallyadditions.util;
import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.registry.GameRegistry;
import ellpeck.actuallyadditions.creative.CreativeTab;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.OreDictionary;
import org.apache.logging.log4j.Level; import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.lwjgl.input.Keyboard;
@SuppressWarnings("unused") @SuppressWarnings("unused")
public class Util{ public class Util{
public static final String VERSION = "1.7.10-0.0.2.1";
public static final String MOD_ID = "ActuallyAdditions";
public static final String NAME = "Actually Additions";
public static final String MOD_ID_LOWER = MOD_ID.toLowerCase();
public static final Logger AA_LOGGER = LogManager.getLogger(MOD_ID);
public static final int WILDCARD = OreDictionary.WILDCARD_VALUE; public static final int WILDCARD = OreDictionary.WILDCARD_VALUE;
public static final ResourceLocation GUI_INVENTORY_LOCATION = getGuiLocation("guiInventory");
public static final String BLACK = (char)167 + "0";
public static final String BLUE = (char)167 + "1";
public static final String GREEN = (char)167 + "2";
public static final String TEAL = (char)167 + "3";
public static final String RED = (char)167 + "4";
public static final String PURPLE = (char)167 + "5";
public static final String ORANGE = (char)167 + "6";
public static final String LIGHT_GRAY = (char)167 + "7";
public static final String GRAY = (char)167 + "8";
public static final String LIGHT_BLUE = (char)167 + "9";
public static final String BRIGHT_GREEN = (char)167 + "a";
public static final String BRIGHT_BLUE = (char)167 + "b";
public static final String LIGHT_RED = (char)167 + "c";
public static final String PINK = (char)167 + "d";
public static final String YELLOW = (char)167 + "e";
public static final String WHITE = (char)167 + "f";
public static final String BOLD = (char)167 + "l";
public static final String UNDERLINE = (char)167 + "n";
public static final String ITALIC = (char)167 + "o";
public static final String OBFUSCATED = (char)167 + "k";
public static final String RESET = (char)167 + "r";
public static final String[] ROMAN_NUMERALS = new String[]{"", "I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX", "X"};
public static final int DECIMAL_COLOR_WHITE = 16777215;
public static boolean isShiftPressed(){
return Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT);
}
public static boolean isControlPressed(){
return Keyboard.isKeyDown(Keyboard.KEY_LCONTROL) || Keyboard.isKeyDown(Keyboard.KEY_RCONTROL);
}
public static String shiftForInfo(){
return GREEN + ITALIC + StatCollector.translateToLocal("tooltip." + MOD_ID_LOWER + ".shiftForInfo.desc");
}
public static String addStandardInformation(Item item){
if(isShiftPressed()) return StatCollector.translateToLocal("tooltip." + Util.MOD_ID_LOWER + "." + ((IName)item).getName() + ".desc");
else return shiftForInfo();
}
public static void logInfo(String text){ public static void logInfo(String text){
AA_LOGGER.log(Level.INFO, text); ModUtil.AA_LOGGER.log(Level.INFO, text);
}
public static void registerItems(Item[] items){
for(Item item : items){
register(item);
}
}
public static ResourceLocation getGuiLocation(String file){
return new ResourceLocation(MOD_ID_LOWER, "textures/gui/" + file + ".png");
}
public static String setUnlocalizedName(Item item){
return MOD_ID_LOWER + "." + ((IName)item).getName();
}
public static String setUnlocalizedName(Block block){
return MOD_ID_LOWER + "." + ((IName)block).getName();
}
public static void register(Item item){
item.setCreativeTab(CreativeTab.instance);
item.setUnlocalizedName(setUnlocalizedName(item));
GameRegistry.registerItem(item, ((IName)item).getName());
}
public static void register(Block block, Class<? extends ItemBlock> itemBlock){
block.setCreativeTab(CreativeTab.instance);
block.setBlockName(setUnlocalizedName(block));
GameRegistry.registerBlock(block, itemBlock, ((IName)block).getName());
} }
public static void registerEvent(Object o){ public static void registerEvent(Object o){

View file

@ -20,7 +20,7 @@ item.actuallyadditions.itemMiscKnifeBlade.name=Messerklinge
item.actuallyadditions.itemMiscKnifeHandle.name=Messergriff item.actuallyadditions.itemMiscKnifeHandle.name=Messergriff
item.actuallyadditions.itemMiscBlackQuartz.name=Schwarzquartz item.actuallyadditions.itemMiscBlackQuartz.name=Schwarzquartz
item.actuallyadditions.itemKnife.name=Messee item.actuallyadditions.itemKnife.name=Messer
item.actuallyadditions.itemPickaxeEmerald.name=Smaragdspitzhacke item.actuallyadditions.itemPickaxeEmerald.name=Smaragdspitzhacke
item.actuallyadditions.itemAxeEmerald.name=Smaragdaxt item.actuallyadditions.itemAxeEmerald.name=Smaragdaxt
item.actuallyadditions.itemShovelEmerald.name=Smaragdspaten item.actuallyadditions.itemShovelEmerald.name=Smaragdspaten
@ -87,7 +87,7 @@ tooltip.actuallyadditions.blockGrinderDouble.desc.1=Macht Staub aus Erzen!
tooltip.actuallyadditions.blockGrinderDouble.desc.2=Aus 1 mach 2 und BONI!! tooltip.actuallyadditions.blockGrinderDouble.desc.2=Aus 1 mach 2 und BONI!!
tooltip.actuallyadditions.blockGrinderDouble.desc.3=Kann zwei Sachen gleichzeitig verarbeiten! tooltip.actuallyadditions.blockGrinderDouble.desc.3=Kann zwei Sachen gleichzeitig verarbeiten!
tooltip.actuallyadditions.blockInputter.desc.1=Ich bin eine Biene! tooltip.actuallyadditions.blockInputter.desc.1=Ich bin eine Biene!
tooltip.actuallyadditions.blockInputter.desc.2=%s%sIch bin klüger als ein Hopper. tooltip.actuallyadditions.blockInputter.desc.2=Ich bin klüger als ein Hopper.
tooltip.actuallyadditions.blockInputter.desc.3=Stell mich ein: tooltip.actuallyadditions.blockInputter.desc.3=Stell mich ein:
tooltip.actuallyadditions.blockInputter.desc.4=-Ein-/Ausgabeseite und tooltip.actuallyadditions.blockInputter.desc.4=-Ein-/Ausgabeseite und
tooltip.actuallyadditions.blockInputter.desc.5=-Slots, die verwendet werden sollen. tooltip.actuallyadditions.blockInputter.desc.5=-Slots, die verwendet werden sollen.

View file

@ -35,6 +35,8 @@ item.actuallyadditions.itemMiscKnifeBlade.name=Knife Blade
item.actuallyadditions.itemMiscKnifeHandle.name=Knife Handle item.actuallyadditions.itemMiscKnifeHandle.name=Knife Handle
item.actuallyadditions.itemMiscBlackQuartz.name=Black Quartz item.actuallyadditions.itemMiscBlackQuartz.name=Black Quartz
item.actuallyadditions.itemLeafBlower.name=Leaf Blower
item.actuallyadditions.itemLeafBlowerAdvanced.name=Advanced Leaf Blower
item.actuallyadditions.itemKnife.name=Knife item.actuallyadditions.itemKnife.name=Knife
item.actuallyadditions.itemPickaxeEmerald.name=Emerald Pickaxe item.actuallyadditions.itemPickaxeEmerald.name=Emerald Pickaxe
item.actuallyadditions.itemAxeEmerald.name=Emerald Axe item.actuallyadditions.itemAxeEmerald.name=Emerald Axe
@ -116,6 +118,10 @@ tooltip.actuallyadditions.itemMiscKnifeBlade.desc=Sharp like a tooth! A whale's
tooltip.actuallyadditions.itemMiscKnifeHandle.desc=Fits comfortably in your hand. tooltip.actuallyadditions.itemMiscKnifeHandle.desc=Fits comfortably in your hand.
tooltip.actuallyadditions.itemMiscBlackQuartz.desc=Used in the Quartz Enchanter! tooltip.actuallyadditions.itemMiscBlackQuartz.desc=Used in the Quartz Enchanter!
tooltip.actuallyadditions.itemLeafBlower.desc.1=Destroys Grass and Flowers around you
tooltip.actuallyadditions.itemLeafBlowerAdvanced.desc.1=Destroys Grass, Flowers and Leaves around you
tooltip.actuallyadditions.itemLeafBlower.desc.2=The Pants once said the Game needed that,
tooltip.actuallyadditions.itemLeafBlower.desc.3=Then the Honka came, said it again.
tooltip.actuallyadditions.itemKnife.desc=Cuts things! Only food though, don't think of stuff... tooltip.actuallyadditions.itemKnife.desc=Cuts things! Only food though, don't think of stuff...
tooltip.actuallyadditions.itemPickaxeEmerald.desc=Mines Stone. tooltip.actuallyadditions.itemPickaxeEmerald.desc=Mines Stone.
tooltip.actuallyadditions.itemAxeEmerald.desc=Mines Wood. tooltip.actuallyadditions.itemAxeEmerald.desc=Mines Wood.

View file

@ -3,7 +3,7 @@
"modid": "ActuallyAdditions", "modid": "ActuallyAdditions",
"name": "Actually Additions", "name": "Actually Additions",
"description": "A bunch of random stuff added to your Game to make it even more fun, exciting and add some more variety!", "description": "A bunch of random stuff added to your Game to make it even more fun, exciting and add some more variety!",
"version": "0.0.2.1", "version": "0.0.2.3",
"mcversion": "1.7.10", "mcversion": "1.7.10",
"url": "https://github.com/Ellpeck/ActuallyAdditions", "url": "https://github.com/Ellpeck/ActuallyAdditions",
"updateUrl": "", "updateUrl": "",