mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-12-22 19:39:24 +01:00
Leaf Blower!
This commit is contained in:
parent
36f721ed30
commit
0bfb102ca9
59 changed files with 628 additions and 358 deletions
|
@ -17,7 +17,7 @@ buildscript {
|
|||
|
||||
apply plugin: 'forge'
|
||||
|
||||
version = "1.7.10-0.0.2.1"
|
||||
version = "1.7.10-0.0.2.3"
|
||||
group = "ellpeck.actuallyadditions"
|
||||
archivesBaseName = "ActuallyAdditions"
|
||||
|
||||
|
|
|
@ -21,12 +21,13 @@ import ellpeck.actuallyadditions.network.PacketHandler;
|
|||
import ellpeck.actuallyadditions.oredict.OreDictRegistry;
|
||||
import ellpeck.actuallyadditions.proxy.IProxy;
|
||||
import ellpeck.actuallyadditions.tile.TileEntityBase;
|
||||
import ellpeck.actuallyadditions.util.ModUtil;
|
||||
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{
|
||||
|
||||
@Instance(Util.MOD_ID)
|
||||
@Instance(ModUtil.MOD_ID)
|
||||
public static ActuallyAdditions instance;
|
||||
|
||||
@SidedProxy(clientSide = "ellpeck.actuallyadditions.proxy.ClientProxy", serverSide = "ellpeck.actuallyadditions.proxy.ServerProxy")
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
package ellpeck.actuallyadditions.achievement;
|
||||
|
||||
import ellpeck.actuallyadditions.util.Util;
|
||||
import ellpeck.actuallyadditions.util.ModUtil;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stats.Achievement;
|
||||
|
||||
public class AchievementAA extends Achievement{
|
||||
|
||||
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);
|
||||
if(hasToHaveBefore == null) this.initIndependentStat();
|
||||
this.registerStat();
|
||||
|
|
|
@ -4,6 +4,7 @@ import ellpeck.actuallyadditions.blocks.InitBlocks;
|
|||
import ellpeck.actuallyadditions.items.InitItems;
|
||||
import ellpeck.actuallyadditions.items.metalists.TheFoods;
|
||||
import ellpeck.actuallyadditions.items.metalists.TheMiscItems;
|
||||
import ellpeck.actuallyadditions.util.ModUtil;
|
||||
import ellpeck.actuallyadditions.util.Util;
|
||||
import net.minecraft.item.ItemStack;
|
||||
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);
|
||||
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
|
@ -9,7 +9,9 @@ import ellpeck.actuallyadditions.items.ItemMisc;
|
|||
import ellpeck.actuallyadditions.items.metalists.TheMiscItems;
|
||||
import ellpeck.actuallyadditions.tile.TileEntityCompost;
|
||||
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.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
@ -147,12 +149,12 @@ public class BlockCompost extends BlockContainerBase implements IName{
|
|||
@SuppressWarnings("unchecked")
|
||||
@SideOnly(Side.CLIENT)
|
||||
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.1"));
|
||||
if(KeyUtil.isShiftPressed()){
|
||||
list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((IName)theBlock).getName() + ".desc.1"));
|
||||
//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
|
||||
|
|
|
@ -6,7 +6,9 @@ import ellpeck.actuallyadditions.ActuallyAdditions;
|
|||
import ellpeck.actuallyadditions.inventory.GuiHandler;
|
||||
import ellpeck.actuallyadditions.tile.TileEntityFeeder;
|
||||
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.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
@ -45,8 +47,8 @@ public class BlockFeeder extends BlockContainerBase implements IName{
|
|||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconReg){
|
||||
this.blockIcon = iconReg.registerIcon(Util.MOD_ID_LOWER + ":" + this.getName());
|
||||
this.topIcon = iconReg.registerIcon(Util.MOD_ID_LOWER + ":" + this.getName() + "Top");
|
||||
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName());
|
||||
this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Top");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -95,8 +97,8 @@ public class BlockFeeder extends BlockContainerBase implements IName{
|
|||
@SuppressWarnings("unchecked")
|
||||
@SideOnly(Side.CLIENT)
|
||||
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"));
|
||||
else list.add(Util.shiftForInfo());
|
||||
if(KeyUtil.isShiftPressed()) list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((IName)theBlock).getName() + ".desc"));
|
||||
else list.add(ItemUtil.shiftForInfo());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -6,7 +6,9 @@ import ellpeck.actuallyadditions.ActuallyAdditions;
|
|||
import ellpeck.actuallyadditions.inventory.GuiHandler;
|
||||
import ellpeck.actuallyadditions.tile.TileEntityFurnaceDouble;
|
||||
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.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
@ -90,10 +92,10 @@ public class BlockFurnaceDouble extends BlockContainerBase implements IName{
|
|||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconReg){
|
||||
this.blockIcon = iconReg.registerIcon(Util.MOD_ID_LOWER + ":" + this.getName());
|
||||
this.topIcon = iconReg.registerIcon(Util.MOD_ID_LOWER + ":" + this.getName() + "Top");
|
||||
this.onIcon = iconReg.registerIcon(Util.MOD_ID_LOWER + ":" + this.getName() + "On");
|
||||
this.frontIcon = iconReg.registerIcon(Util.MOD_ID_LOWER + ":" + this.getName() + "Front");
|
||||
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName());
|
||||
this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Top");
|
||||
this.onIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "On");
|
||||
this.frontIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Front");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -177,8 +179,8 @@ public class BlockFurnaceDouble extends BlockContainerBase implements IName{
|
|||
@SuppressWarnings("unchecked")
|
||||
@SideOnly(Side.CLIENT)
|
||||
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"));
|
||||
else list.add(Util.shiftForInfo());
|
||||
if(KeyUtil.isShiftPressed()) list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((IName)theBlock).getName() + ".desc"));
|
||||
else list.add(ItemUtil.shiftForInfo());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -6,7 +6,9 @@ import ellpeck.actuallyadditions.ActuallyAdditions;
|
|||
import ellpeck.actuallyadditions.inventory.GuiHandler;
|
||||
import ellpeck.actuallyadditions.tile.TileEntityGiantChest;
|
||||
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.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
@ -45,8 +47,8 @@ public class BlockGiantChest extends BlockContainerBase implements IName{
|
|||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconReg){
|
||||
this.blockIcon = iconReg.registerIcon(Util.MOD_ID_LOWER + ":" + this.getName());
|
||||
this.topIcon = iconReg.registerIcon(Util.MOD_ID_LOWER + ":" + this.getName() + "Top");
|
||||
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName());
|
||||
this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Top");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -95,8 +97,8 @@ public class BlockGiantChest extends BlockContainerBase implements IName{
|
|||
@SuppressWarnings("unchecked")
|
||||
@SideOnly(Side.CLIENT)
|
||||
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"));
|
||||
else list.add(Util.shiftForInfo());
|
||||
if(KeyUtil.isShiftPressed()) list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((IName)theBlock).getName() + ".desc"));
|
||||
else list.add(ItemUtil.shiftForInfo());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -6,7 +6,9 @@ import ellpeck.actuallyadditions.ActuallyAdditions;
|
|||
import ellpeck.actuallyadditions.inventory.GuiHandler;
|
||||
import ellpeck.actuallyadditions.tile.TileEntityGrinder;
|
||||
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.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
@ -76,10 +78,10 @@ public class BlockGrinder extends BlockContainerBase implements IName{
|
|||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconReg){
|
||||
this.blockIcon = iconReg.registerIcon(Util.MOD_ID_LOWER + ":" + this.getName());
|
||||
this.topIcon = iconReg.registerIcon(Util.MOD_ID_LOWER + ":blockGrinderTop");
|
||||
this.onIcon = iconReg.registerIcon(Util.MOD_ID_LOWER + ":blockGrinderOn");
|
||||
this.bottomIcon = iconReg.registerIcon(Util.MOD_ID_LOWER + ":blockGrinderBottom");
|
||||
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName());
|
||||
this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":blockGrinderTop");
|
||||
this.onIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":blockGrinderOn");
|
||||
this.bottomIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":blockGrinderBottom");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -128,12 +130,12 @@ public class BlockGrinder extends BlockContainerBase implements IName{
|
|||
@SuppressWarnings("unchecked")
|
||||
@SideOnly(Side.CLIENT)
|
||||
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++){
|
||||
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
|
||||
|
|
|
@ -5,21 +5,17 @@ import cpw.mods.fml.relauncher.SideOnly;
|
|||
import ellpeck.actuallyadditions.ActuallyAdditions;
|
||||
import ellpeck.actuallyadditions.inventory.GuiHandler;
|
||||
import ellpeck.actuallyadditions.tile.TileEntityInputter;
|
||||
import ellpeck.actuallyadditions.util.IName;
|
||||
import ellpeck.actuallyadditions.util.Util;
|
||||
import ellpeck.actuallyadditions.util.*;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -37,46 +33,11 @@ public class BlockInputter extends BlockContainerBase implements IName{
|
|||
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
|
||||
public TileEntity createNewTileEntity(World world, int par2){
|
||||
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
|
||||
public IIcon getIcon(int side, int meta){
|
||||
return this.blockIcon;
|
||||
|
@ -85,14 +46,14 @@ public class BlockInputter extends BlockContainerBase implements IName{
|
|||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
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
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9){
|
||||
if(!world.isRemote){
|
||||
TileEntityInputter furnace = (TileEntityInputter)world.getTileEntity(x, y, z);
|
||||
if (furnace != null) player.openGui(ActuallyAdditions.instance, GuiHandler.INPUTTER_ID, world, x, y, z);
|
||||
TileEntityInputter inputter = (TileEntityInputter)world.getTileEntity(x, y, z);
|
||||
if (inputter != null) player.openGui(ActuallyAdditions.instance, GuiHandler.INPUTTER_ID, world, x, y, z);
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
|
@ -150,13 +111,13 @@ public class BlockInputter extends BlockContainerBase implements IName{
|
|||
@SuppressWarnings("unchecked")
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
|
||||
if(Util.isShiftPressed()){
|
||||
list.add(StatCollector.translateToLocalFormatted("tooltip." + Util.MOD_ID_LOWER + "." + ((IName)theBlock).getName() + ".desc." + 1, Util.OBFUSCATED, Util.LIGHT_GRAY));
|
||||
if(KeyUtil.isShiftPressed()){
|
||||
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++){
|
||||
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
|
||||
|
|
|
@ -4,7 +4,9 @@ import cpw.mods.fml.relauncher.Side;
|
|||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import ellpeck.actuallyadditions.blocks.metalists.TheMiscBlocks;
|
||||
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.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
@ -52,7 +54,7 @@ public class BlockMisc extends Block implements IName{
|
|||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconReg){
|
||||
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")
|
||||
@SideOnly(Side.CLIENT)
|
||||
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"));
|
||||
else list.add(Util.shiftForInfo());
|
||||
if(KeyUtil.isShiftPressed()) list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((IName)theBlock).getName() + allMiscBlocks[stack.getItemDamage()].getName() + ".desc"));
|
||||
else list.add(ItemUtil.shiftForInfo());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package ellpeck.actuallyadditions.blocks;
|
||||
|
||||
import ellpeck.actuallyadditions.util.BlockUtil;
|
||||
import ellpeck.actuallyadditions.util.Util;
|
||||
import net.minecraft.block.Block;
|
||||
|
||||
|
@ -19,27 +20,27 @@ public class InitBlocks{
|
|||
Util.logInfo("Initializing Blocks...");
|
||||
|
||||
blockCompost = new BlockCompost();
|
||||
Util.register(blockCompost, BlockCompost.TheItemBlock.class);
|
||||
BlockUtil.register(blockCompost, BlockCompost.TheItemBlock.class);
|
||||
|
||||
blockMisc = new BlockMisc();
|
||||
Util.register(blockMisc, BlockMisc.TheItemBlock.class);
|
||||
BlockUtil.register(blockMisc, BlockMisc.TheItemBlock.class);
|
||||
|
||||
blockFeeder = new BlockFeeder();
|
||||
Util.register(blockFeeder, BlockFeeder.TheItemBlock.class);
|
||||
BlockUtil.register(blockFeeder, BlockFeeder.TheItemBlock.class);
|
||||
|
||||
blockGiantChest = new BlockGiantChest();
|
||||
Util.register(blockGiantChest, BlockGiantChest.TheItemBlock.class);
|
||||
BlockUtil.register(blockGiantChest, BlockGiantChest.TheItemBlock.class);
|
||||
|
||||
blockGrinder = new BlockGrinder(false);
|
||||
Util.register(blockGrinder, BlockGrinder.TheItemBlock.class);
|
||||
BlockUtil.register(blockGrinder, BlockGrinder.TheItemBlock.class);
|
||||
|
||||
blockGrinderDouble = new BlockGrinder(true);
|
||||
Util.register(blockGrinderDouble, BlockGrinder.TheItemBlock.class);
|
||||
BlockUtil.register(blockGrinderDouble, BlockGrinder.TheItemBlock.class);
|
||||
|
||||
blockFurnaceDouble = new BlockFurnaceDouble();
|
||||
Util.register(blockFurnaceDouble, BlockFurnaceDouble.TheItemBlock.class);
|
||||
BlockUtil.register(blockFurnaceDouble, BlockFurnaceDouble.TheItemBlock.class);
|
||||
|
||||
blockInputter = new BlockInputter();
|
||||
Util.register(blockInputter, BlockInputter.TheItemBlock.class);
|
||||
BlockUtil.register(blockInputter, BlockInputter.TheItemBlock.class);
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
package ellpeck.actuallyadditions.blocks.render;
|
||||
|
||||
import ellpeck.actuallyadditions.util.Util;
|
||||
import ellpeck.actuallyadditions.util.ModUtil;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
@ -14,7 +14,7 @@ public class RenderItems implements IItemRenderer{
|
|||
|
||||
public RenderItems(ModelBaseAA 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
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
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.tileentity.TileEntity;
|
||||
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.glRotatef(180F, 0.0F, 0.0F, 1.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);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
|
|
@ -59,6 +59,14 @@ public class ConfigValues{
|
|||
public static int blackQuartzMinHeight;
|
||||
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){
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
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");
|
||||
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");
|
||||
|
|
|
@ -14,6 +14,8 @@ public class FoodCrafting{
|
|||
|
||||
public static void init(){
|
||||
|
||||
ItemStack knifeStack = new ItemStack(InitItems.itemKnife, 1, Util.WILDCARD);
|
||||
|
||||
//Baguette
|
||||
if(ConfigValues.enabledFoodRecipes[TheFoods.BAGUETTE.ordinal()])
|
||||
GameRegistry.addSmelting(new ItemStack(InitItems.itemMisc, 1,
|
||||
|
@ -27,7 +29,7 @@ public class FoodCrafting{
|
|||
'M', new ItemStack(Blocks.brown_mushroom),
|
||||
'C', new ItemStack(Items.carrot),
|
||||
'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()));
|
||||
|
||||
//Hamburger
|
||||
|
@ -36,7 +38,7 @@ public class FoodCrafting{
|
|||
"KT ", "CB ", " T ",
|
||||
'T', new ItemStack(InitItems.itemFoods, 1, TheFoods.TOAST.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));
|
||||
|
||||
//Big Cookie
|
||||
|
@ -54,13 +56,13 @@ public class FoodCrafting{
|
|||
'C', new ItemStack(InitItems.itemFoods, 1, TheFoods.CHEESE.ordinal()),
|
||||
'F', new ItemStack(Items.cooked_fished, 1, Util.WILDCARD),
|
||||
'B', new ItemStack(InitItems.itemFoods, 1, TheFoods.BAGUETTE.ordinal()),
|
||||
'K', new ItemStack(InitItems.itemKnife, 1, Util.WILDCARD));
|
||||
'K', knifeStack);
|
||||
|
||||
//French Fry
|
||||
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(InitItems.itemKnife, 1, Util.WILDCARD));
|
||||
knifeStack);
|
||||
|
||||
//French Fries
|
||||
if(ConfigValues.enabledFoodRecipes[TheFoods.FRENCH_FRIES.ordinal()])
|
||||
|
@ -92,7 +94,7 @@ public class FoodCrafting{
|
|||
//Carrot Juice
|
||||
if(ConfigValues.enabledFoodRecipes[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
|
||||
if(ConfigValues.enabledFoodRecipes[TheFoods.SPAGHETTI.ordinal()])
|
||||
|
@ -104,7 +106,7 @@ public class FoodCrafting{
|
|||
//Noodle
|
||||
if(ConfigValues.enabledFoodRecipes[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
|
||||
if(ConfigValues.enabledFoodRecipes[TheFoods.CHOCOLATE.ordinal()])
|
||||
|
|
|
@ -3,6 +3,7 @@ package ellpeck.actuallyadditions.crafting;
|
|||
import ellpeck.actuallyadditions.items.InitItems;
|
||||
import ellpeck.actuallyadditions.items.metalists.TheDusts;
|
||||
import ellpeck.actuallyadditions.recipe.GrinderRecipes;
|
||||
import ellpeck.actuallyadditions.util.ModUtil;
|
||||
import ellpeck.actuallyadditions.util.Util;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
|
@ -37,11 +38,11 @@ public class GrinderCrafting{
|
|||
}
|
||||
if(name.length() > 9 && name.substring(0, 9).equals("oreNether")){
|
||||
nameOfOre = name.substring(9);
|
||||
resultAmount = 2;
|
||||
resultAmount = 4;
|
||||
}
|
||||
if(name.length() > 8 && name.substring(0, 8).equals("denseore")){
|
||||
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() > 5 && name.substring(0, 5).equals("ingot")) nameOfOre = name.substring(5);
|
||||
|
@ -55,24 +56,30 @@ public class GrinderCrafting{
|
|||
if(allDusts != null && allDusts.size() > 0){
|
||||
ArrayList<ItemStack> allOresOfName = OreDictionary.getOres(name);
|
||||
if(allOresOfName != null && allOresOfName.size() > 0){
|
||||
for(ItemStack output : allDusts){
|
||||
for(ItemStack theDust : allDusts){
|
||||
ItemStack output = theDust.copy();
|
||||
output.stackSize = resultAmount;
|
||||
for(ItemStack input : allOresOfName){
|
||||
for(ItemStack theInput : allOresOfName){
|
||||
ItemStack input = theInput.copy();
|
||||
if(GrinderRecipes.instance().getOutput(input, false) == null){
|
||||
ArrayList<ItemStack> specialStacks = null;
|
||||
|
||||
if(name.equals("oreNickel")){
|
||||
ArrayList<ItemStack> specialStacks = OreDictionary.getOres("dustPlatinum");
|
||||
for(ItemStack theSpecial : specialStacks) GrinderRecipes.instance().registerRecipe(input, output, theSpecial, 10);
|
||||
if(name.equals("oreNickel")) specialStacks = OreDictionary.getOres("dustPlatinum");
|
||||
|
||||
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 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 :(");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,6 +18,24 @@ public class ItemCrafting{
|
|||
|
||||
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
|
||||
if(ConfigValues.enabledMiscRecipes[TheMiscItems.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()])
|
||||
initMashedFoodRecipes();
|
||||
|
||||
|
||||
//Ingots from Dusts
|
||||
GameRegistry.addSmelting(new ItemStack(InitItems.itemDust, 1, TheDusts.IRON.ordinal()),
|
||||
new ItemStack(Items.iron_ingot), 1F);
|
||||
|
|
|
@ -4,7 +4,7 @@ import cpw.mods.fml.relauncher.Side;
|
|||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import ellpeck.actuallyadditions.blocks.InitBlocks;
|
||||
import ellpeck.actuallyadditions.items.InitItems;
|
||||
import ellpeck.actuallyadditions.util.Util;
|
||||
import ellpeck.actuallyadditions.util.ModUtil;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
|
@ -18,7 +18,7 @@ public class CreativeTab extends CreativeTabs{
|
|||
private List list;
|
||||
|
||||
public CreativeTab(){
|
||||
super(Util.MOD_ID_LOWER);
|
||||
super(ModUtil.MOD_ID_LOWER);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -43,6 +43,8 @@ public class CreativeTab extends CreativeTabs{
|
|||
this.addItem(InitItems.itemCrafterOnAStick);
|
||||
this.addItem(InitItems.itemDust);
|
||||
this.addItem(InitItems.itemSpecialDrop);
|
||||
this.addItem(InitItems.itemLeafBlower);
|
||||
this.addItem(InitItems.itemLeafBlowerAdvanced);
|
||||
|
||||
this.addItem(InitItems.itemPickaxeEmerald);
|
||||
this.addItem(InitItems.itemSwordEmerald);
|
||||
|
|
|
@ -10,6 +10,7 @@ import ellpeck.actuallyadditions.items.metalists.TheMiscItems;
|
|||
import net.minecraft.item.Item;
|
||||
|
||||
public class CraftEvent{
|
||||
|
||||
@SubscribeEvent
|
||||
public void onCraftedEvent(PlayerEvent.ItemCraftedEvent event){
|
||||
if(event.crafting.getItem() == InitItems.itemMisc && event.crafting.getItemDamage() == TheMiscItems.DOUGH.ordinal()){
|
||||
|
|
|
@ -3,9 +3,6 @@ package ellpeck.actuallyadditions.event;
|
|||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import ellpeck.actuallyadditions.items.InitItems;
|
||||
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.item.ItemStack;
|
||||
import net.minecraftforge.event.entity.living.LivingDropsEvent;
|
||||
|
@ -13,12 +10,13 @@ import net.minecraftforge.event.entity.living.LivingDropsEvent;
|
|||
import java.util.Random;
|
||||
|
||||
public class KilledEvent{
|
||||
|
||||
@SubscribeEvent
|
||||
public void onEntityDropEvent(LivingDropsEvent event){
|
||||
if(event.source.getEntity() instanceof EntityPlayer){
|
||||
for(int i = 0; i < TheSpecialDrops.values().length; 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){
|
||||
event.entityLiving.entityDropItem(new ItemStack(InitItems.itemSpecialDrop, new Random().nextInt(theDrop.maxAmount) + 1, theDrop.ordinal()), 0);
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ import ellpeck.actuallyadditions.items.InitItems;
|
|||
import ellpeck.actuallyadditions.items.metalists.TheFoods;
|
||||
|
||||
public class SmeltEvent{
|
||||
|
||||
@SubscribeEvent
|
||||
public void onSmeltedEvent(PlayerEvent.ItemSmeltedEvent event){
|
||||
if(event.smelting.getItem() == InitItems.itemFoods && event.smelting.getItemDamage() == TheFoods.BAGUETTE.ordinal()){
|
||||
|
|
|
@ -5,6 +5,7 @@ import cpw.mods.fml.common.registry.GameRegistry;
|
|||
import ellpeck.actuallyadditions.blocks.InitBlocks;
|
||||
import ellpeck.actuallyadditions.blocks.metalists.TheMiscBlocks;
|
||||
import ellpeck.actuallyadditions.config.ConfigValues;
|
||||
import ellpeck.actuallyadditions.util.ModUtil;
|
||||
import ellpeck.actuallyadditions.util.Util;
|
||||
import net.minecraft.block.Block;
|
||||
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);
|
||||
}
|
||||
}
|
||||
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){
|
||||
|
|
|
@ -4,7 +4,8 @@ import cpw.mods.fml.relauncher.Side;
|
|||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import ellpeck.actuallyadditions.tile.TileEntityBase;
|
||||
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.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
@ -16,7 +17,7 @@ import java.util.Arrays;
|
|||
@SideOnly(Side.CLIENT)
|
||||
public class GuiFeeder extends GuiContainer{
|
||||
|
||||
private static final ResourceLocation resLoc = Util.getGuiLocation("guiFeeder");
|
||||
private static final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiFeeder");
|
||||
private TileEntityFeeder tileFeeder;
|
||||
|
||||
public int loveCounter;
|
||||
|
@ -31,7 +32,7 @@ public class GuiFeeder extends GuiContainer{
|
|||
@Override
|
||||
public void drawGuiContainerBackgroundLayer(float f, int x, int y){
|
||||
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.mc.getTextureManager().bindTexture(resLoc);
|
||||
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){
|
||||
super.drawScreen(x, y, f);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ import cpw.mods.fml.relauncher.Side;
|
|||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import ellpeck.actuallyadditions.tile.TileEntityBase;
|
||||
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.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
@ -13,7 +13,7 @@ import org.lwjgl.opengl.GL11;
|
|||
@SideOnly(Side.CLIENT)
|
||||
public class GuiFurnaceDouble extends GuiContainer{
|
||||
|
||||
private static final ResourceLocation resLoc = Util.getGuiLocation("guiFurnaceDouble");
|
||||
private static final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiFurnaceDouble");
|
||||
private TileEntityFurnaceDouble tileFurnace;
|
||||
|
||||
public GuiFurnaceDouble(InventoryPlayer inventory, TileEntityBase tile){
|
||||
|
@ -27,7 +27,7 @@ public class GuiFurnaceDouble extends GuiContainer{
|
|||
public void drawGuiContainerBackgroundLayer(float f, int x, int y){
|
||||
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.mc.getTextureManager().bindTexture(resLoc);
|
||||
|
|
|
@ -3,7 +3,7 @@ package ellpeck.actuallyadditions.inventory;
|
|||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
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.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
@ -12,7 +12,7 @@ import org.lwjgl.opengl.GL11;
|
|||
@SideOnly(Side.CLIENT)
|
||||
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){
|
||||
super(new ContainerGiantChest(inventory, tile));
|
||||
|
@ -26,7 +26,7 @@ public class GuiGiantChest extends GuiContainer{
|
|||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(resLoc);
|
||||
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);
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@ import cpw.mods.fml.relauncher.Side;
|
|||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import ellpeck.actuallyadditions.tile.TileEntityBase;
|
||||
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.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
@ -13,8 +13,8 @@ import org.lwjgl.opengl.GL11;
|
|||
@SideOnly(Side.CLIENT)
|
||||
public class GuiGrinder extends GuiContainer{
|
||||
|
||||
private static final ResourceLocation resLoc = Util.getGuiLocation("guiGrinder");
|
||||
private static final ResourceLocation resLocDouble = Util.getGuiLocation("guiGrinderDouble");
|
||||
private static final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiGrinder");
|
||||
private static final ResourceLocation resLocDouble = AssetUtil.getGuiLocation("guiGrinderDouble");
|
||||
private TileEntityGrinder tileGrinder;
|
||||
private boolean isDouble;
|
||||
|
||||
|
@ -30,7 +30,7 @@ public class GuiGrinder extends GuiContainer{
|
|||
public void drawGuiContainerBackgroundLayer(float f, int x, int y){
|
||||
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.mc.getTextureManager().bindTexture(this.isDouble ? resLocDouble : resLoc);
|
||||
|
|
|
@ -6,7 +6,8 @@ import ellpeck.actuallyadditions.network.PacketHandler;
|
|||
import ellpeck.actuallyadditions.network.PacketInputterButton;
|
||||
import ellpeck.actuallyadditions.tile.TileEntityBase;
|
||||
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.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
|
@ -21,7 +22,7 @@ import org.lwjgl.opengl.GL11;
|
|||
@SideOnly(Side.CLIENT)
|
||||
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 int x;
|
||||
|
@ -35,13 +36,13 @@ public class GuiInputter extends GuiContainer{
|
|||
private SmallerButton buttonSlotPullM;
|
||||
|
||||
public static final String[] sideString = new String[]{
|
||||
StatCollector.translateToLocal("info." + Util.MOD_ID_LOWER + ".gui.disabled"),
|
||||
StatCollector.translateToLocal("info." + Util.MOD_ID_LOWER + ".gui.up"),
|
||||
StatCollector.translateToLocal("info." + Util.MOD_ID_LOWER + ".gui.down"),
|
||||
StatCollector.translateToLocal("info." + Util.MOD_ID_LOWER + ".gui.north"),
|
||||
StatCollector.translateToLocal("info." + Util.MOD_ID_LOWER + ".gui.east"),
|
||||
StatCollector.translateToLocal("info." + Util.MOD_ID_LOWER + ".gui.south"),
|
||||
StatCollector.translateToLocal("info." + Util.MOD_ID_LOWER + ".gui.west")};
|
||||
StatCollector.translateToLocal("info." + ModUtil.MOD_ID_LOWER + ".gui.disabled"),
|
||||
StatCollector.translateToLocal("info." + ModUtil.MOD_ID_LOWER + ".gui.up"),
|
||||
StatCollector.translateToLocal("info." + ModUtil.MOD_ID_LOWER + ".gui.down"),
|
||||
StatCollector.translateToLocal("info." + ModUtil.MOD_ID_LOWER + ".gui.north"),
|
||||
StatCollector.translateToLocal("info." + ModUtil.MOD_ID_LOWER + ".gui.east"),
|
||||
StatCollector.translateToLocal("info." + ModUtil.MOD_ID_LOWER + ".gui.south"),
|
||||
StatCollector.translateToLocal("info." + ModUtil.MOD_ID_LOWER + ".gui.west")};
|
||||
|
||||
public GuiInputter(InventoryPlayer inventory, TileEntityBase tile, int x, int y, int z, World world){
|
||||
super(new ContainerInputter(inventory, tile));
|
||||
|
@ -83,20 +84,20 @@ public class GuiInputter extends GuiContainer{
|
|||
public void drawGuiContainerBackgroundLayer(float f, int x, int y){
|
||||
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.mc.getTextureManager().bindTexture(resLoc);
|
||||
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." + Util.MOD_ID_LOWER + ".gui.pull"), guiLeft + 107 + 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." + 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(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(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
|
||||
|
@ -117,7 +118,7 @@ public class GuiInputter extends GuiContainer{
|
|||
|
||||
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){
|
||||
super(id, x, y, 16, 16, display);
|
||||
|
|
|
@ -2,6 +2,7 @@ package ellpeck.actuallyadditions.items;
|
|||
|
||||
import ellpeck.actuallyadditions.items.tools.*;
|
||||
import ellpeck.actuallyadditions.material.InitItemMaterials;
|
||||
import ellpeck.actuallyadditions.util.ItemUtil;
|
||||
import ellpeck.actuallyadditions.util.Util;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
|
@ -18,6 +19,8 @@ public class InitItems{
|
|||
public static Item itemCrafterOnAStick;
|
||||
public static Item itemDust;
|
||||
public static Item itemSpecialDrop;
|
||||
public static Item itemLeafBlower;
|
||||
public static Item itemLeafBlowerAdvanced;
|
||||
|
||||
public static Item itemPickaxeEmerald;
|
||||
public static Item itemAxeEmerald;
|
||||
|
@ -35,39 +38,45 @@ public class InitItems{
|
|||
Util.logInfo("Initializing Items...");
|
||||
|
||||
itemFertilizer = new ItemFertilizer();
|
||||
Util.register(itemFertilizer);
|
||||
ItemUtil.register(itemFertilizer);
|
||||
|
||||
itemMisc = new ItemMisc();
|
||||
Util.register(itemMisc);
|
||||
ItemUtil.register(itemMisc);
|
||||
|
||||
itemFoods = new ItemFoods();
|
||||
Util.register(itemFoods);
|
||||
ItemUtil.register(itemFoods);
|
||||
|
||||
itemKnife = new ItemKnife();
|
||||
Util.register(itemKnife);
|
||||
ItemUtil.register(itemKnife);
|
||||
|
||||
itemCrafterOnAStick = new ItemCrafterOnAStick();
|
||||
Util.register(itemCrafterOnAStick);
|
||||
ItemUtil.register(itemCrafterOnAStick);
|
||||
|
||||
itemDust = new ItemDust();
|
||||
Util.register(itemDust);
|
||||
ItemUtil.register(itemDust);
|
||||
|
||||
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);
|
||||
itemAxeEmerald = new ItemAxeAA(InitItemMaterials.toolMaterialEmerald, new ItemStack(Items.emerald), "itemAxeEmerald", 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);
|
||||
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);
|
||||
itemAxeObsidian = new ItemAxeAA(InitItemMaterials.toolMaterialObsidian, new ItemStack(Blocks.obsidian), "itemAxeObsidian", 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);
|
||||
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});
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,8 @@ import cpw.mods.fml.relauncher.SideOnly;
|
|||
import ellpeck.actuallyadditions.ActuallyAdditions;
|
||||
import ellpeck.actuallyadditions.inventory.GuiHandler;
|
||||
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.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
|
@ -26,7 +27,7 @@ public class ItemCrafterOnAStick extends Item implements IName{
|
|||
@SuppressWarnings("unchecked")
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
|
||||
list.add(Util.addStandardInformation(this));
|
||||
list.add(ItemUtil.addStandardInformation(this));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -37,7 +38,7 @@ public class ItemCrafterOnAStick extends Item implements IName{
|
|||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
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
|
||||
|
|
|
@ -4,7 +4,9 @@ import cpw.mods.fml.relauncher.Side;
|
|||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import ellpeck.actuallyadditions.items.metalists.TheDusts;
|
||||
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.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
@ -56,8 +58,8 @@ public class ItemDust extends Item implements IName{
|
|||
@SuppressWarnings("unchecked")
|
||||
@SideOnly(Side.CLIENT)
|
||||
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"));
|
||||
else list.add(Util.shiftForInfo());
|
||||
if(KeyUtil.isShiftPressed()) list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + this.getName() + allDusts[stack.getItemDamage()].getName() + ".desc"));
|
||||
else list.add(ItemUtil.shiftForInfo());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -74,6 +76,6 @@ public class ItemDust extends Item implements IName{
|
|||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,8 @@ package ellpeck.actuallyadditions.items;
|
|||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
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.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
|
@ -35,7 +36,7 @@ public class ItemFertilizer extends Item implements IName{
|
|||
@SuppressWarnings("unchecked")
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
|
||||
list.add(Util.addStandardInformation(this));
|
||||
list.add(ItemUtil.addStandardInformation(this));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -46,7 +47,7 @@ public class ItemFertilizer extends Item implements IName{
|
|||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
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
|
||||
|
|
|
@ -4,7 +4,9 @@ import cpw.mods.fml.relauncher.Side;
|
|||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import ellpeck.actuallyadditions.items.metalists.TheFoods;
|
||||
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.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
|
@ -92,12 +94,12 @@ public class ItemFoods extends ItemFood implements IName{
|
|||
@SuppressWarnings("unchecked")
|
||||
@SideOnly(Side.CLIENT)
|
||||
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() + 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." + Util.MOD_ID_LOWER + ".saturation.desc") + ": " + allFoods[stack.getItemDamage()].saturation);
|
||||
if(KeyUtil.isShiftPressed()){
|
||||
list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + this.getName() + allFoods[stack.getItemDamage()].getName() + ".desc"));
|
||||
list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".hunger.desc") + ": " + allFoods[stack.getItemDamage()].healAmount);
|
||||
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
|
||||
|
@ -109,7 +111,7 @@ public class ItemFoods extends ItemFood implements IName{
|
|||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconReg){
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -4,13 +4,16 @@ import cpw.mods.fml.relauncher.Side;
|
|||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import ellpeck.actuallyadditions.config.ConfigValues;
|
||||
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.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -44,7 +47,12 @@ public class ItemKnife extends Item implements IName{
|
|||
@SuppressWarnings("unchecked")
|
||||
@SideOnly(Side.CLIENT)
|
||||
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
|
||||
|
@ -60,7 +68,7 @@ public class ItemKnife extends Item implements IName{
|
|||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
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
|
||||
|
|
|
@ -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";
|
||||
}
|
||||
}
|
|
@ -4,7 +4,9 @@ import cpw.mods.fml.relauncher.Side;
|
|||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import ellpeck.actuallyadditions.items.metalists.TheMiscItems;
|
||||
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.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
@ -57,8 +59,8 @@ public class ItemMisc extends Item implements IName{
|
|||
@SuppressWarnings("unchecked")
|
||||
@SideOnly(Side.CLIENT)
|
||||
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"));
|
||||
else list.add(Util.shiftForInfo());
|
||||
if(KeyUtil.isShiftPressed()) list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + this.getName() + allMiscItems[stack.getItemDamage()].getName() + ".desc"));
|
||||
else list.add(ItemUtil.shiftForInfo());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -70,7 +72,7 @@ public class ItemMisc extends Item implements IName{
|
|||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconReg){
|
||||
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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,9 @@ import cpw.mods.fml.relauncher.Side;
|
|||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import ellpeck.actuallyadditions.items.metalists.TheSpecialDrops;
|
||||
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.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
@ -57,8 +59,8 @@ public class ItemSpecialDrop extends Item implements IName{
|
|||
@SuppressWarnings("unchecked")
|
||||
@SideOnly(Side.CLIENT)
|
||||
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"));
|
||||
else list.add(Util.shiftForInfo());
|
||||
if(KeyUtil.isShiftPressed()) list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + this.getName() + allDrops[stack.getItemDamage()].getName() + ".desc"));
|
||||
else list.add(ItemUtil.shiftForInfo());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -70,7 +72,7 @@ public class ItemSpecialDrop extends Item implements IName{
|
|||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconReg){
|
||||
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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package ellpeck.actuallyadditions.items.metalists;
|
||||
|
||||
import ellpeck.actuallyadditions.util.IName;
|
||||
import ellpeck.actuallyadditions.util.Util;
|
||||
import ellpeck.actuallyadditions.util.StringUtil;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
|
||||
public enum TheDusts implements IName{
|
||||
|
@ -11,7 +11,7 @@ public enum TheDusts implements IName{
|
|||
DIAMOND("Diamond", 292003, EnumRarity.rare),
|
||||
EMERALD("Emerald", 4319527, EnumRarity.epic),
|
||||
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),
|
||||
QUARTZ_BLACK("QuartzBlack", 18, EnumRarity.rare);
|
||||
|
||||
|
|
|
@ -13,12 +13,12 @@ public enum TheFoods implements IName{
|
|||
CARROT_JUICE("CarrotJuice", 6, 0.2F, true, 20, EnumRarity.common),
|
||||
FISH_N_CHIPS("FishNChips", 20, 1F, false, 40, EnumRarity.uncommon),
|
||||
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),
|
||||
NOODLE("Noodle", 1, 0.01F, false, 3, EnumRarity.common),
|
||||
CHOCOLATE_CAKE("ChocolateCake", 16, 0.45F, false, 45, EnumRarity.uncommon),
|
||||
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),
|
||||
BIG_COOKIE("BigCookie", 6, 0.1F, false, 20, EnumRarity.uncommon),
|
||||
HAMBURGER("Hamburger", 14, 0.9F, false, 40, EnumRarity.common),
|
||||
|
|
|
@ -10,10 +10,10 @@ import net.minecraft.item.EnumRarity;
|
|||
|
||||
public enum TheSpecialDrops implements IName{
|
||||
|
||||
SOLIDIFIED_EXPERIENCE("SolidifiedExperience", 70, 3, EntityCreature.class, EnumRarity.uncommon, ConfigValues.enableExperienceDrop),
|
||||
BLOOD_FRAGMENT("BloodFragment", 30, 1, EntityCreature.class, EnumRarity.uncommon, ConfigValues.enableBloodDrop),
|
||||
HEART_PART("HeartPart", 10, 1, EntityCreature.class, EnumRarity.rare, ConfigValues.enableHeartDrop),
|
||||
UNKNOWN_SUBSTANCE("UnknownSubstance", 5, 1, EntitySkeleton.class, EnumRarity.epic, ConfigValues.enableSubstanceDrop),
|
||||
SOLIDIFIED_EXPERIENCE("SolidifiedExperience", 40, 3, EntityCreature.class, EnumRarity.uncommon, ConfigValues.enableExperienceDrop),
|
||||
BLOOD_FRAGMENT("BloodFragment", 15, 1, EntityCreature.class, EnumRarity.uncommon, ConfigValues.enableBloodDrop),
|
||||
HEART_PART("HeartPart", 5, 1, EntityCreature.class, EnumRarity.rare, ConfigValues.enableHeartDrop),
|
||||
UNKNOWN_SUBSTANCE("UnknownSubstance", 3, 1, EntitySkeleton.class, EnumRarity.epic, ConfigValues.enableSubstanceDrop),
|
||||
PEARL_SHARD("PearlShard", 20, 3, EntityEnderman.class, EnumRarity.epic, ConfigValues.enablePearlShardDrop),
|
||||
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 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.chance = chance;
|
||||
this.rarity = rarity;
|
||||
|
|
|
@ -3,7 +3,9 @@ package ellpeck.actuallyadditions.items.tools;
|
|||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
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.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
|
@ -25,16 +27,15 @@ public class ItemAxeAA extends ItemAxe implements IName{
|
|||
this.name = unlocalizedName;
|
||||
this.rarity = rarity;
|
||||
this.repairItem = repairItem;
|
||||
this.setUnlocalizedName(Util.setUnlocalizedName(this));
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
|
||||
list.add(Util.addStandardInformation(this));
|
||||
if(Util.isShiftPressed()){
|
||||
list.add(StatCollector.translateToLocal("tooltip." + Util.MOD_ID_LOWER + ".durability.desc") + ": " + (this.getMaxDamage()-this.getDamage(stack)) + "/" + this.getMaxDamage());
|
||||
list.add(ItemUtil.addStandardInformation(this));
|
||||
if(KeyUtil.isShiftPressed()){
|
||||
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
|
||||
@SideOnly(Side.CLIENT)
|
||||
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
|
||||
|
|
|
@ -3,7 +3,9 @@ package ellpeck.actuallyadditions.items.tools;
|
|||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
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.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
|
@ -25,16 +27,15 @@ public class ItemHoeAA extends ItemHoe implements IName{
|
|||
this.name = unlocalizedName;
|
||||
this.rarity = rarity;
|
||||
this.repairItem = repairItem;
|
||||
this.setUnlocalizedName(Util.setUnlocalizedName(this));
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld){
|
||||
list.add(Util.addStandardInformation(this));
|
||||
if(Util.isShiftPressed()){
|
||||
list.add(StatCollector.translateToLocal("tooltip." + Util.MOD_ID_LOWER + ".durability.desc") + ": " + (this.getMaxDamage()-this.getDamage(stack)) + "/" + this.getMaxDamage());
|
||||
list.add(ItemUtil.addStandardInformation(this));
|
||||
if(KeyUtil.isShiftPressed()){
|
||||
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
|
||||
@SideOnly(Side.CLIENT)
|
||||
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
|
||||
|
|
|
@ -3,7 +3,9 @@ package ellpeck.actuallyadditions.items.tools;
|
|||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
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.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
|
@ -25,16 +27,15 @@ public class ItemPickaxeAA extends ItemPickaxe implements IName{
|
|||
this.name = unlocalizedName;
|
||||
this.rarity = rarity;
|
||||
this.repairItem = repairItem;
|
||||
this.setUnlocalizedName(Util.setUnlocalizedName(this));
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
|
||||
list.add(Util.addStandardInformation(this));
|
||||
if(Util.isShiftPressed()){
|
||||
list.add(StatCollector.translateToLocal("tooltip." + Util.MOD_ID_LOWER + ".durability.desc") + ": " + (this.getMaxDamage()-this.getDamage(stack)) + "/" + this.getMaxDamage());
|
||||
list.add(ItemUtil.addStandardInformation(this));
|
||||
if(KeyUtil.isShiftPressed()){
|
||||
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
|
||||
@SideOnly(Side.CLIENT)
|
||||
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
|
||||
|
|
|
@ -3,7 +3,9 @@ package ellpeck.actuallyadditions.items.tools;
|
|||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
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.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
|
@ -25,16 +27,15 @@ public class ItemShovelAA extends ItemSpade implements IName{
|
|||
this.name = unlocalizedName;
|
||||
this.rarity = rarity;
|
||||
this.repairItem = repairItem;
|
||||
this.setUnlocalizedName(Util.setUnlocalizedName(this));
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
|
||||
list.add(Util.addStandardInformation(this));
|
||||
if(Util.isShiftPressed()){
|
||||
list.add(StatCollector.translateToLocal("tooltip." + Util.MOD_ID_LOWER + ".durability.desc") + ": " + (this.getMaxDamage()-this.getDamage(stack)) + "/" + this.getMaxDamage());
|
||||
list.add(ItemUtil.addStandardInformation(this));
|
||||
if(KeyUtil.isShiftPressed()){
|
||||
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
|
||||
@SideOnly(Side.CLIENT)
|
||||
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
|
||||
|
|
|
@ -3,7 +3,9 @@ package ellpeck.actuallyadditions.items.tools;
|
|||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
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.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
|
@ -25,16 +27,15 @@ public class ItemSwordAA extends ItemSword implements IName{
|
|||
this.name = unlocalizedName;
|
||||
this.rarity = rarity;
|
||||
this.repairItem = repairItem;
|
||||
this.setUnlocalizedName(Util.setUnlocalizedName(this));
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld){
|
||||
list.add(Util.addStandardInformation(this));
|
||||
if(Util.isShiftPressed()){
|
||||
list.add(StatCollector.translateToLocal("tooltip." + Util.MOD_ID_LOWER + ".durability.desc") + ": " + (this.getMaxDamage()-this.getDamage(stack)) + "/" + this.getMaxDamage());
|
||||
list.add(ItemUtil.addStandardInformation(this));
|
||||
if(KeyUtil.isShiftPressed()){
|
||||
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
|
||||
@SideOnly(Side.CLIENT)
|
||||
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
|
||||
|
|
|
@ -3,14 +3,14 @@ package ellpeck.actuallyadditions.network;
|
|||
import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import ellpeck.actuallyadditions.util.Util;
|
||||
import ellpeck.actuallyadditions.util.ModUtil;
|
||||
|
||||
public class PacketHandler{
|
||||
|
||||
public static SimpleNetworkWrapper theNetwork;
|
||||
|
||||
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(PacketInputterButton.Handler.class, PacketInputterButton.class, 1, Side.SERVER);
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package ellpeck.actuallyadditions.tile;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import ellpeck.actuallyadditions.util.ModUtil;
|
||||
import ellpeck.actuallyadditions.util.Util;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockAir;
|
||||
|
@ -28,12 +29,12 @@ public class TileEntityBase extends TileEntity{
|
|||
|
||||
public static void init(){
|
||||
Util.logInfo("Registering TileEntities...");
|
||||
GameRegistry.registerTileEntity(TileEntityCompost.class, Util.MOD_ID_LOWER + ":tileEntityCompost");
|
||||
GameRegistry.registerTileEntity(TileEntityFeeder.class, Util.MOD_ID_LOWER + ":tileEntityFeeder");
|
||||
GameRegistry.registerTileEntity(TileEntityGiantChest.class, Util.MOD_ID_LOWER + ":tileEntityGiantChest");
|
||||
GameRegistry.registerTileEntity(TileEntityGrinder.class, Util.MOD_ID_LOWER + ":tileEntityGrinder");
|
||||
GameRegistry.registerTileEntity(TileEntityFurnaceDouble.class, Util.MOD_ID_LOWER + ":tileEntityFurnaceDouble");
|
||||
GameRegistry.registerTileEntity(TileEntityInputter.class, Util.MOD_ID_LOWER + ":tileEntityInputter");
|
||||
GameRegistry.registerTileEntity(TileEntityCompost.class, ModUtil.MOD_ID_LOWER + ":tileEntityCompost");
|
||||
GameRegistry.registerTileEntity(TileEntityFeeder.class, ModUtil.MOD_ID_LOWER + ":tileEntityFeeder");
|
||||
GameRegistry.registerTileEntity(TileEntityGiantChest.class, ModUtil.MOD_ID_LOWER + ":tileEntityGiantChest");
|
||||
GameRegistry.registerTileEntity(TileEntityGrinder.class, ModUtil.MOD_ID_LOWER + ":tileEntityGrinder");
|
||||
GameRegistry.registerTileEntity(TileEntityFurnaceDouble.class, ModUtil.MOD_ID_LOWER + ":tileEntityFurnaceDouble");
|
||||
GameRegistry.registerTileEntity(TileEntityInputter.class, ModUtil.MOD_ID_LOWER + ":tileEntityInputter");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package ellpeck.actuallyadditions.tile;
|
||||
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
@ -37,38 +38,53 @@ public class TileEntityInputter extends TileEntityInventoryBase{
|
|||
if(this.placeToPullSlotAmount > 0){
|
||||
IInventory theInventory = (IInventory)placeToPull;
|
||||
int theSlotToPull = this.slotToPull;
|
||||
int maxSize = theInventory.getInventoryStackLimit();
|
||||
ISidedInventory theSided = null;
|
||||
if(theInventory instanceof ISidedInventory) theSided = (ISidedInventory)theInventory;
|
||||
|
||||
ItemStack theStack = null;
|
||||
if(theSlotToPull != -1) theStack = theInventory.getStackInSlot(theSlotToPull);
|
||||
else{
|
||||
for(int i = 0; i < this.placeToPullSlotAmount; i++){
|
||||
ItemStack tempStack = theInventory.getStackInSlot(i);
|
||||
if(tempStack != null && (this.slots[0] == null || (tempStack.isItemEqual(this.slots[0]) && this.slots[0].stackSize < this.getInventoryStackLimit()))){
|
||||
for(int i = (theSlotToPull != -1 ? theSlotToPull : 0); i < (theSlotToPull != -1 ? theSlotToPull+1 : placeToPullSlotAmount); i++){
|
||||
ItemStack tempStack = theInventory.getStackInSlot(i);
|
||||
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;
|
||||
theSlotToPull = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
theStack = tempStack;
|
||||
theSlotToPull = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(theSlotToPull != -1 && theStack != null){
|
||||
if(theStack != null){
|
||||
if(this.slots[0] != null){
|
||||
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;
|
||||
theInventory.setInventorySlotContents(theSlotToPull, null);
|
||||
}
|
||||
else if(theStack.stackSize > this.getInventoryStackLimit() - this.slots[0].stackSize){
|
||||
theStack.stackSize -= (this.getInventoryStackLimit() - this.slots[0].stackSize);
|
||||
this.slots[0].stackSize = this.getInventoryStackLimit();
|
||||
else if(theStack.stackSize > maxSize - this.slots[0].stackSize){
|
||||
theInventory.decrStackSize(theSlotToPull, maxSize - this.slots[0].stackSize);
|
||||
this.slots[0].stackSize = maxSize;
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
ItemStack toBePut = theStack.copy();
|
||||
if(theInventory.getInventoryStackLimit() < toBePut.stackSize) toBePut.stackSize = theInventory.getInventoryStackLimit();
|
||||
if(maxSize < toBePut.stackSize) toBePut.stackSize = maxSize;
|
||||
this.setInventorySlotContents(0, toBePut);
|
||||
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){
|
||||
IInventory theInventory = (IInventory)placeToPut;
|
||||
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){
|
||||
ItemStack theStack = null;
|
||||
if(theSlotToPut != -1) theStack = theInventory.getStackInSlot(theSlotToPut);
|
||||
else{
|
||||
for(int i = 0; i < this.placeToPutSlotAmount; i++){
|
||||
ItemStack tempStack = theInventory.getStackInSlot(i);
|
||||
if(tempStack == null || (theInventory.isItemValidForSlot(i, this.slots[0]) && tempStack.isItemEqual(this.slots[0]) && tempStack.stackSize < theInventory.getInventoryStackLimit())){
|
||||
for(int i = (theSlotToPut != -1 ? theSlotToPut : 0); i < (theSlotToPut != -1 ? theSlotToPut+1 : placeToPutSlotAmount); i++){
|
||||
ItemStack tempStack = theInventory.getStackInSlot(i);
|
||||
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;
|
||||
theSlotToPut = i;
|
||||
can = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
theStack = tempStack;
|
||||
theSlotToPut = i;
|
||||
can = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(theSlotToPut != -1 && theInventory.isItemValidForSlot(theSlotToPut, this.slots[0])){
|
||||
if(can){
|
||||
if(theStack != null){
|
||||
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;
|
||||
this.slots[0] = null;
|
||||
}
|
||||
else if(this.slots[0].stackSize > theInventory.getInventoryStackLimit() - theStack.stackSize){
|
||||
this.slots[0].stackSize -= (theInventory.getInventoryStackLimit() - theStack.stackSize);
|
||||
theStack.stackSize = theInventory.getInventoryStackLimit();
|
||||
else if(this.slots[0].stackSize > maxSize - theStack.stackSize){
|
||||
this.decrStackSize(0, maxSize - theStack.stackSize);
|
||||
theStack.stackSize = maxSize;
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
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);
|
||||
if(this.slots[0].stackSize == toBePut.stackSize) this.slots[0] = null;
|
||||
else this.slots[0].stackSize -= toBePut.stackSize;
|
||||
else this.decrStackSize(0, toBePut.stackSize);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
13
src/main/java/ellpeck/actuallyadditions/util/AssetUtil.java
Normal file
13
src/main/java/ellpeck/actuallyadditions/util/AssetUtil.java
Normal 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");
|
||||
}
|
||||
|
||||
}
|
20
src/main/java/ellpeck/actuallyadditions/util/BlockUtil.java
Normal file
20
src/main/java/ellpeck/actuallyadditions/util/BlockUtil.java
Normal 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());
|
||||
}
|
||||
|
||||
}
|
|
@ -2,6 +2,6 @@ package ellpeck.actuallyadditions.util;
|
|||
|
||||
public interface IName{
|
||||
|
||||
public abstract String getName();
|
||||
String getName();
|
||||
|
||||
}
|
||||
|
|
35
src/main/java/ellpeck/actuallyadditions/util/ItemUtil.java
Normal file
35
src/main/java/ellpeck/actuallyadditions/util/ItemUtil.java
Normal 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");
|
||||
}
|
||||
|
||||
}
|
15
src/main/java/ellpeck/actuallyadditions/util/KeyUtil.java
Normal file
15
src/main/java/ellpeck/actuallyadditions/util/KeyUtil.java
Normal 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);
|
||||
}
|
||||
|
||||
}
|
16
src/main/java/ellpeck/actuallyadditions/util/ModUtil.java
Normal file
16
src/main/java/ellpeck/actuallyadditions/util/ModUtil.java
Normal 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);
|
||||
|
||||
}
|
31
src/main/java/ellpeck/actuallyadditions/util/StringUtil.java
Normal file
31
src/main/java/ellpeck/actuallyadditions/util/StringUtil.java
Normal 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;
|
||||
|
||||
}
|
|
@ -1,109 +1,17 @@
|
|||
package ellpeck.actuallyadditions.util;
|
||||
|
||||
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.oredict.OreDictionary;
|
||||
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")
|
||||
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 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){
|
||||
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());
|
||||
ModUtil.AA_LOGGER.log(Level.INFO, text);
|
||||
}
|
||||
|
||||
public static void registerEvent(Object o){
|
||||
|
|
|
@ -20,7 +20,7 @@ item.actuallyadditions.itemMiscKnifeBlade.name=Messerklinge
|
|||
item.actuallyadditions.itemMiscKnifeHandle.name=Messergriff
|
||||
item.actuallyadditions.itemMiscBlackQuartz.name=Schwarzquartz
|
||||
|
||||
item.actuallyadditions.itemKnife.name=Messee
|
||||
item.actuallyadditions.itemKnife.name=Messer
|
||||
item.actuallyadditions.itemPickaxeEmerald.name=Smaragdspitzhacke
|
||||
item.actuallyadditions.itemAxeEmerald.name=Smaragdaxt
|
||||
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.3=Kann zwei Sachen gleichzeitig verarbeiten!
|
||||
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.4=-Ein-/Ausgabeseite und
|
||||
tooltip.actuallyadditions.blockInputter.desc.5=-Slots, die verwendet werden sollen.
|
||||
|
|
|
@ -35,6 +35,8 @@ item.actuallyadditions.itemMiscKnifeBlade.name=Knife Blade
|
|||
item.actuallyadditions.itemMiscKnifeHandle.name=Knife Handle
|
||||
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.itemPickaxeEmerald.name=Emerald Pickaxe
|
||||
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.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.itemPickaxeEmerald.desc=Mines Stone.
|
||||
tooltip.actuallyadditions.itemAxeEmerald.desc=Mines Wood.
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
"modid": "ActuallyAdditions",
|
||||
"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!",
|
||||
"version": "0.0.2.1",
|
||||
"version": "0.0.2.3",
|
||||
"mcversion": "1.7.10",
|
||||
"url": "https://github.com/Ellpeck/ActuallyAdditions",
|
||||
"updateUrl": "",
|
||||
|
|
Loading…
Reference in a new issue