@@ -27,9 +27,10 @@
import net.minecraft.item.EnumRarity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
@@ -64,7 +65,7 @@ public int damageDropped(IBlockState state){
}

@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ){
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing side, float hitX, float hitY, float hitZ){
//Turning On
if(player.isSneaking()){
if(!world.isRemote){
@@ -73,7 +74,6 @@ public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, En
return true;
}

ItemStack stack = player.getCurrentEquippedItem();
if(stack != null){
//Changing Colors
int[] oreIDs = OreDictionary.getOreIDs(stack);
@@ -104,12 +104,6 @@ public ItemStack createStackedBlock(IBlockState state){
return new ItemStack(InitBlocks.blockColoredLamp, 1, this.getMetaFromState(state));
}

@Override
@SideOnly(Side.CLIENT)
public Item getItem(World world, BlockPos pos){
return Item.getItemFromBlock(InitBlocks.blockColoredLamp);
}

@SuppressWarnings("all")
@SideOnly(Side.CLIENT)
public void getSubBlocks(Item item, CreativeTabs tab, List list){
@@ -119,7 +113,7 @@ public void getSubBlocks(Item item, CreativeTabs tab, List list){
}

@Override
public int getLightValue(IBlockAccess world, BlockPos pos){
public int getLightValue(IBlockState state, IBlockAccess world, BlockPos pos){
return this.isOn ? 15 : 0;
}

@@ -17,6 +17,7 @@
import de.ellpeck.actuallyadditions.mod.tile.TileEntityCompost;
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
import de.ellpeck.actuallyadditions.mod.util.StringUtil;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft;
@@ -28,24 +29,31 @@
import net.minecraft.profiler.Profiler;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.*;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

import java.util.List;

public class BlockCompost extends BlockContainerBase implements IHudDisplay{

public BlockCompost(String name){
super(Material.wood, name);
this.setHarvestLevel("axe", 0);
this.setHardness(0.5F);
this.setResistance(5.0F);
this.setStepSound(soundTypeWood);
this.setStepSound(SoundType.WOOD);

this.setBlockBoundsForItemRender();
//this.setBlockBoundsForItemRender();
}

//TODO Fix bounding box
/*@Override
public void setBlockBoundsForItemRender(){
float f = 1.0F/16.0F;
this.setBlockBounds(f, 0.0F, f, 1.0F-f, 11*f, 1.0F-f);
}
@Override
public void addCollisionBoxesToList(World world, BlockPos pos, IBlockState state, AxisAlignedBB mask, List list, Entity collidingEntity){
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.3125F, 1.0F);
@@ -60,22 +68,21 @@ public void addCollisionBoxesToList(World world, BlockPos pos, IBlockState state
this.setBlockBounds(0.0F, 0.0F, 1.0F-f, 1.0F, y, 1.0F);
super.addCollisionBoxesToList(world, pos, state, mask, list, collidingEntity);
this.setBlockBoundsForItemRender();
}
}*/

@Override
public boolean isOpaqueCube(){
public boolean isOpaqueCube(IBlockState state){
return false;
}

@Override
public boolean isFullCube(){
public boolean isFullCube(IBlockState state){
return false;
}

@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing f6, float f7, float f8, float f9){
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stackPlayer, EnumFacing f6, float f7, float f8, float f9){
if(!world.isRemote){
ItemStack stackPlayer = player.getCurrentEquippedItem();
TileEntityCompost tile = (TileEntityCompost)world.getTileEntity(pos);
//Add items to be composted
if(stackPlayer != null && stackPlayer.getItem() instanceof ItemMisc && stackPlayer.getItemDamage() == TheMiscItems.MASHED_FOOD.ordinal() && (tile.slots[0] == null || (!(tile.slots[0].getItem() instanceof ItemFertilizer) && tile.slots[0].stackSize < TileEntityCompost.AMOUNT))){
@@ -97,7 +104,7 @@ else if(tile.slots[0] != null && (stackPlayer == null || (stackPlayer.getItem()
player.inventory.setInventorySlotContents(player.inventory.currentItem, tile.slots[0].copy());
}
else{
player.getCurrentEquippedItem().stackSize += tile.slots[0].stackSize;
player.getActiveItemStack().stackSize += tile.slots[0].stackSize;
}
tile.slots[0] = null;
tile.markDirty();
@@ -106,12 +113,6 @@ else if(tile.slots[0] != null && (stackPlayer == null || (stackPlayer.getItem()
return true;
}

@Override
public void setBlockBoundsForItemRender(){
float f = 1.0F/16.0F;
this.setBlockBounds(f, 0.0F, f, 1.0F-f, 11*f, 1.0F-f);
}

@Override
public TileEntity createNewTileEntity(World world, int meta){
return new TileEntityCompost();
@@ -130,7 +131,7 @@ public EnumRarity getRarity(ItemStack stack){

@Override
@SideOnly(Side.CLIENT)
public void displayHud(Minecraft minecraft, EntityPlayer player, ItemStack stack, MovingObjectPosition posHit, Profiler profiler, ScaledResolution resolution){
public void displayHud(Minecraft minecraft, EntityPlayer player, ItemStack stack, RayTraceResult posHit, Profiler profiler, ScaledResolution resolution){
TileEntity tile = minecraft.theWorld.getTileEntity(posHit.getBlockPos());
if(tile instanceof TileEntityCompost){
ItemStack slot = ((TileEntityCompost)tile).getStackInSlot(0);
@@ -143,7 +144,7 @@ public void displayHud(Minecraft minecraft, EntityPlayer player, ItemStack stack

AssetUtil.renderStackToGui(slot, resolution.getScaledWidth()/2+15, resolution.getScaledHeight()/2-29, 1F);
}
minecraft.fontRendererObj.drawStringWithShadow(EnumChatFormatting.YELLOW+""+EnumChatFormatting.ITALIC+strg, resolution.getScaledWidth()/2+35, resolution.getScaledHeight()/2-25, StringUtil.DECIMAL_COLOR_WHITE);
minecraft.fontRendererObj.drawStringWithShadow(TextFormatting.YELLOW+""+TextFormatting.ITALIC+strg, resolution.getScaledWidth()/2+35, resolution.getScaledHeight()/2-25, StringUtil.DECIMAL_COLOR_WHITE);
}
}
}
@@ -17,6 +17,7 @@
import de.ellpeck.actuallyadditions.mod.tile.TileEntityDirectionalBreaker;
import de.ellpeck.actuallyadditions.mod.util.PosUtil;
import net.minecraft.block.BlockPistonBase;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.IBlockState;
@@ -25,8 +26,9 @@
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;

public class BlockDirectionalBreaker extends BlockContainerBase{
@@ -38,7 +40,7 @@ public BlockDirectionalBreaker(String name){
this.setHarvestLevel("pickaxe", 0);
this.setHardness(1.5F);
this.setResistance(10.0F);
this.setStepSound(soundTypeStone);
this.setStepSound(SoundType.STONE);
}

@Override
@@ -47,7 +49,7 @@ public TileEntity createNewTileEntity(World world, int par2){
}

@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing par6, float par7, float par8, float par9){
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing par6, float par7, float par8, float par9){
if(this.tryToggleRedstone(world, pos, player)){
return true;
}
@@ -68,7 +70,7 @@ public EnumRarity getRarity(ItemStack stack){

@Override
public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase player, ItemStack stack){
int rotation = BlockPistonBase.getFacingFromEntity(world, pos, player).ordinal();
int rotation = BlockPistonBase.getFacingFromEntity(pos, player).ordinal();
PosUtil.setMetadata(pos, world, rotation, 2);

super.onBlockPlacedBy(world, pos, state, player, stack);
@@ -16,6 +16,7 @@
import de.ellpeck.actuallyadditions.mod.tile.TileEntityDropper;
import de.ellpeck.actuallyadditions.mod.util.PosUtil;
import net.minecraft.block.BlockPistonBase;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.IBlockState;
@@ -24,8 +25,9 @@
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;

public class BlockDropper extends BlockContainerBase{
@@ -37,7 +39,7 @@ public BlockDropper(String name){
this.setHarvestLevel("pickaxe", 0);
this.setHardness(1.5F);
this.setResistance(10.0F);
this.setStepSound(soundTypeStone);
this.setStepSound(SoundType.STONE);
}

@Override
@@ -46,7 +48,7 @@ public TileEntity createNewTileEntity(World world, int par2){
}

@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing par6, float par7, float par8, float par9){
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing par6, float par7, float par8, float par9){
if(this.tryToggleRedstone(world, pos, player)){
return true;
}
@@ -67,7 +69,7 @@ public EnumRarity getRarity(ItemStack stack){

@Override
public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase player, ItemStack stack){
int rotation = BlockPistonBase.getFacingFromEntity(world, pos, player).ordinal();
int rotation = BlockPistonBase.getFacingFromEntity(pos, player).ordinal();
PosUtil.setMetadata(pos, world, rotation, 2);

super.onBlockPlacedBy(world, pos, state, player, stack);
@@ -15,14 +15,16 @@
import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityEnergizer;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityEnervator;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;

public class BlockEnergizer extends BlockContainerBase{
@@ -35,7 +37,7 @@ public BlockEnergizer(boolean isEnergizer, String name){
this.setHarvestLevel("pickaxe", 0);
this.setHardness(2.0F);
this.setResistance(10.0F);
this.setStepSound(soundTypeStone);
this.setStepSound(SoundType.STONE);
}

@Override
@@ -44,7 +46,7 @@ public TileEntity createNewTileEntity(World world, int par2){
}

@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing par6, float par7, float par8, float par9){
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing par6, float par7, float par8, float par9){
if(!world.isRemote){
if(this.isEnergizer){
TileEntityEnergizer energizer = (TileEntityEnergizer)world.getTileEntity(pos);
@@ -14,14 +14,16 @@
import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase;
import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityFeeder;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;

public class BlockFeeder extends BlockContainerBase{
@@ -31,7 +33,7 @@ public BlockFeeder(String name){
this.setHarvestLevel("pickaxe", 0);
this.setHardness(0.5F);
this.setResistance(6.0F);
this.setStepSound(soundTypeStone);
this.setStepSound(SoundType.STONE);
}

@Override
@@ -40,7 +42,7 @@ public TileEntity createNewTileEntity(World world, int par2){
}

@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing par6, float par7, float par8, float par9){
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing par6, float par7, float par8, float par9){
if(!world.isRemote){
TileEntityFeeder feeder = (TileEntityFeeder)world.getTileEntity(pos);
if(feeder != null){
@@ -14,14 +14,16 @@
import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase;
import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityFermentingBarrel;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;

public class BlockFermentingBarrel extends BlockContainerBase{
@@ -31,7 +33,7 @@ public BlockFermentingBarrel(String name){
this.setHarvestLevel("axe", 0);
this.setHardness(0.5F);
this.setResistance(5.0F);
this.setStepSound(soundTypeWood);
this.setStepSound(SoundType.WOOD);
}

@Override
@@ -46,7 +48,7 @@ public void breakBlock(World world, BlockPos pos, IBlockState state){
}

@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing par6, float par7, float par8, float par9){
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing par6, float par7, float par8, float par9){
if(!world.isRemote){
TileEntityFermentingBarrel press = (TileEntityFermentingBarrel)world.getTileEntity(pos);
if(press != null){
@@ -13,14 +13,16 @@

import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityFireworkBox;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;

public class BlockFireworkBox extends BlockContainerBase{
@@ -30,7 +32,7 @@ public BlockFireworkBox(String name){
this.setHarvestLevel("pickaxe", 0);
this.setHardness(1.5F);
this.setResistance(10.0F);
this.setStepSound(soundTypeStone);
this.setStepSound(SoundType.STONE);
}

@Override
@@ -39,7 +41,7 @@ public TileEntity createNewTileEntity(World world, int par2){
}

@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing par6, float par7, float par8, float par9){
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing par6, float par7, float par8, float par9){
return this.tryToggleRedstone(world, pos, player);
}

@@ -12,7 +12,9 @@

import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityFishingNet;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
@@ -25,8 +27,9 @@ public BlockFishingNet(String name){
this.setHarvestLevel("axe", 0);
this.setHardness(0.5F);
this.setResistance(3.0F);
this.setStepSound(soundTypeWood);
this.setBlockBounds(0F, 0F, 0F, 1F, 1F/16F, 1F);
this.setStepSound(SoundType.WOOD);
//TODO Fix block bounds
//this.setBlockBounds(0F, 0F, 0F, 1F, 1F/16F, 1F);
}

@Override
@@ -35,12 +38,12 @@ public TileEntity createNewTileEntity(World world, int par2){
}

@Override
public boolean isFullCube(){
public boolean isFullCube(IBlockState state){
return false;
}

@Override
public boolean isOpaqueCube(){
public boolean isOpaqueCube(IBlockState state){
return false;
}

@@ -17,6 +17,7 @@
import de.ellpeck.actuallyadditions.mod.tile.TileEntityFluidCollector;
import de.ellpeck.actuallyadditions.mod.util.PosUtil;
import net.minecraft.block.BlockPistonBase;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.IBlockState;
@@ -25,8 +26,9 @@
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;

public class BlockFluidCollector extends BlockContainerBase{
@@ -41,7 +43,7 @@ public BlockFluidCollector(boolean isPlacer, String name){
this.setHarvestLevel("pickaxe", 0);
this.setHardness(1.5F);
this.setResistance(10.0F);
this.setStepSound(soundTypeStone);
this.setStepSound(SoundType.STONE);
}

@Override
@@ -50,7 +52,7 @@ public TileEntity createNewTileEntity(World world, int par2){
}

@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing par6, float par7, float par8, float par9){
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing par6, float par7, float par8, float par9){
if(this.tryToggleRedstone(world, pos, player)){
return true;
}
@@ -71,7 +73,7 @@ public EnumRarity getRarity(ItemStack stack){

@Override
public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase player, ItemStack stack){
int rotation = BlockPistonBase.getFacingFromEntity(world, pos, player).ordinal();
int rotation = BlockPistonBase.getFacingFromEntity(pos, player).ordinal();
PosUtil.setMetadata(pos, world, rotation, 2);

super.onBlockPlacedBy(world, pos, state, player, stack);
@@ -16,6 +16,7 @@
import de.ellpeck.actuallyadditions.mod.proxy.ClientProxy;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityFurnaceDouble;
import de.ellpeck.actuallyadditions.mod.util.PosUtil;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.IBlockState;
@@ -24,10 +25,11 @@
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.MathHelper;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
@@ -44,7 +46,7 @@ public BlockFurnaceDouble(String name){
this.setHarvestLevel("pickaxe", 0);
this.setHardness(1.5F);
this.setResistance(10.0F);
this.setStepSound(soundTypeStone);
this.setStepSound(SoundType.STONE);
this.setTickRandomly(true);
}

@@ -55,7 +57,7 @@ public TileEntity createNewTileEntity(World world, int par2){

@Override
@SideOnly(Side.CLIENT)
public void randomDisplayTick(World world, BlockPos pos, IBlockState state, Random rand){
public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand){
int meta = PosUtil.getMetadata(state);

if(meta > 3){
@@ -89,7 +91,7 @@ public void randomDisplayTick(World world, BlockPos pos, IBlockState state, Rand
}

@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing par6, float par7, float par8, float par9){
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing par6, float par7, float par8, float par9){
if(!world.isRemote){
TileEntityFurnaceDouble furnace = (TileEntityFurnaceDouble)world.getTileEntity(pos);
if(furnace != null){
@@ -101,8 +103,8 @@ public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, En
}

@Override
public int getLightValue(IBlockAccess world, BlockPos pos){
return PosUtil.getMetadata(pos, world) > 3 ? 12 : 0;
public int getLightValue(IBlockState state, IBlockAccess world, BlockPos pos){
return PosUtil.getMetadata(state) > 3 ? 12 : 0;
}

@Override
@@ -12,7 +12,9 @@

import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityFurnaceSolar;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
@@ -25,8 +27,10 @@ public BlockFurnaceSolar(String name){
this.setHarvestLevel("pickaxe", 0);
this.setHardness(1.5F);
this.setResistance(10.0F);
this.setStepSound(soundTypeStone);
this.setBlockBounds(0F, 0F, 0F, 1F, 6F/16F, 1F);
this.setStepSound(SoundType.STONE);

//TODO Block bounds
//this.setBlockBounds(0F, 0F, 0F, 1F, 6F/16F, 1F);
}

@Override
@@ -35,12 +39,12 @@ public TileEntity createNewTileEntity(World world, int par2){
}

@Override
public boolean isFullCube(){
public boolean isFullCube(IBlockState state){
return false;
}

@Override
public boolean isOpaqueCube(){
public boolean isOpaqueCube(IBlockState state){
return false;
}

@@ -11,6 +11,7 @@
package de.ellpeck.actuallyadditions.mod.blocks;

import de.ellpeck.actuallyadditions.mod.blocks.base.BlockBase;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
@@ -22,7 +23,7 @@ public BlockGeneric(String name){
this.setHarvestLevel("pickaxe", 0);
this.setHardness(1.5F);
this.setResistance(10.0F);
this.setStepSound(soundTypeStone);
this.setStepSound(SoundType.STONE);
}

@Override
@@ -16,6 +16,7 @@
import de.ellpeck.actuallyadditions.mod.items.InitItems;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityGiantChest;
import de.ellpeck.actuallyadditions.mod.util.ItemUtil;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLivingBase;
@@ -25,8 +26,9 @@
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;

@@ -39,7 +41,7 @@ public BlockGiantChest(String name){
this.setHarvestLevel("axe", 0);
this.setHardness(0.5F);
this.setResistance(15.0F);
this.setStepSound(soundTypeWood);
this.setStepSound(SoundType.WOOD);
}

@Override
@@ -48,7 +50,7 @@ public TileEntity createNewTileEntity(World world, int par2){
}

@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing par6, float par7, float par8, float par9){
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing par6, float par7, float par8, float par9){
if(!world.isRemote){
TileEntityGiantChest chest = (TileEntityGiantChest)world.getTileEntity(pos);
if(chest != null){
@@ -13,14 +13,15 @@
import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityGreenhouseGlass;
import net.minecraft.block.Block;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockPos;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumWorldBlockLayer;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
@@ -33,32 +34,31 @@ public BlockGreenhouseGlass(String name){
this.setHarvestLevel("pickaxe", 0);
this.setHardness(0.5F);
this.setResistance(10.0F);
this.setStepSound(soundTypeStone);
this.setStepSound(SoundType.STONE);
}

@Override
public boolean isFullCube(){
public boolean isFullCube(IBlockState state){
return false;
}

@Override
@SideOnly(Side.CLIENT)
public boolean shouldSideBeRendered(IBlockAccess worldIn, BlockPos pos, EnumFacing side){
IBlockState state = worldIn.getBlockState(pos);
public boolean shouldSideBeRendered(IBlockState state, IBlockAccess worldIn, BlockPos pos, EnumFacing side){
Block block = state.getBlock();
return worldIn.getBlockState(pos.offset(side.getOpposite())) != state || block != this && block != this && super.shouldSideBeRendered(worldIn, pos, side);
return worldIn.getBlockState(pos.offset(side.getOpposite())) != state || block != this && block != this && super.shouldSideBeRendered(state, worldIn, pos, side);

}

@Override
public boolean isOpaqueCube(){
public boolean isOpaqueCube(IBlockState state){
return false;
}

@Override
@SideOnly(Side.CLIENT)
public EnumWorldBlockLayer getBlockLayer(){
return EnumWorldBlockLayer.CUTOUT;
public BlockRenderLayer getBlockLayer(){
return BlockRenderLayer.CUTOUT;
}

@Override
@@ -16,16 +16,18 @@
import de.ellpeck.actuallyadditions.mod.proxy.ClientProxy;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityGrinder;
import de.ellpeck.actuallyadditions.mod.util.PosUtil;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
@@ -44,7 +46,7 @@ public BlockGrinder(boolean isDouble, String name){
this.setHarvestLevel("pickaxe", 0);
this.setHardness(1.5F);
this.setResistance(10.0F);
this.setStepSound(soundTypeStone);
this.setStepSound(SoundType.STONE);
this.setTickRandomly(true);
}

@@ -55,7 +57,7 @@ public TileEntity createNewTileEntity(World world, int par2){

@Override
@SideOnly(Side.CLIENT)
public void randomDisplayTick(World world, BlockPos pos, IBlockState state, Random rand){
public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand){
int meta = PosUtil.getMetadata(state);

if(meta == 1){
@@ -69,7 +71,7 @@ public void randomDisplayTick(World world, BlockPos pos, IBlockState state, Rand
}

@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing par6, float par7, float par8, float par9){
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing par6, float par7, float par8, float par9){
if(!world.isRemote){
TileEntityGrinder grinder = (TileEntityGrinder)world.getTileEntity(pos);
if(grinder != null){
@@ -81,7 +83,7 @@ public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, En
}

@Override
public int getLightValue(IBlockAccess world, BlockPos pos){
public int getLightValue(IBlockState state, IBlockAccess world, BlockPos pos){
return PosUtil.getMetadata(pos, world) == 1 ? 12 : 0;
}

@@ -12,6 +12,7 @@

import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityHeatCollector;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
@@ -25,7 +26,7 @@ public BlockHeatCollector(String name){
this.setHarvestLevel("pickaxe", 0);
this.setHardness(2.5F);
this.setResistance(10.0F);
this.setStepSound(soundTypeStone);
this.setStepSound(SoundType.STONE);
}

@Override
@@ -21,14 +21,16 @@
import de.ellpeck.actuallyadditions.mod.util.StringUtil;
import de.ellpeck.actuallyadditions.mod.util.Util;
import net.minecraft.block.Block;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;

public class BlockInputter extends BlockContainerBase{
@@ -42,7 +44,7 @@ public BlockInputter(boolean isAdvanced, String name){
this.setHarvestLevel("pickaxe", 0);
this.setHardness(1.5F);
this.setResistance(10.0F);
this.setStepSound(soundTypeStone);
this.setStepSound(SoundType.STONE);
this.setTickRandomly(true);
this.isAdvanced = isAdvanced;
}
@@ -53,7 +55,7 @@ public TileEntity createNewTileEntity(World world, int par2){
}

@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing par6, float par7, float par8, float par9){
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing par6, float par7, float par8, float par9){
if(!world.isRemote){
TileEntityInputter inputter = (TileEntityInputter)world.getTileEntity(pos);
if(inputter != null){
@@ -16,14 +16,16 @@
import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityItemRepairer;
import de.ellpeck.actuallyadditions.mod.util.PosUtil;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;

@@ -34,7 +36,7 @@ public BlockItemRepairer(String name){
this.setHarvestLevel("pickaxe", 0);
this.setHardness(20.0F);
this.setResistance(15.0F);
this.setStepSound(soundTypeStone);
this.setStepSound(SoundType.STONE);
this.setTickRandomly(true);
}

@@ -44,7 +46,7 @@ public TileEntity createNewTileEntity(World world, int par2){
}

@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing par6, float par7, float par8, float par9){
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing par6, float par7, float par8, float par9){
if(!world.isRemote){
TileEntityItemRepairer repairer = (TileEntityItemRepairer)world.getTileEntity(pos);
if(repairer != null){
@@ -56,7 +58,7 @@ public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, En
}

@Override
public int getLightValue(IBlockAccess world, BlockPos pos){
public int getLightValue(IBlockState state, IBlockAccess world, BlockPos pos){
return PosUtil.getMetadata(pos, world) == 1 ? 12 : 0;
}

@@ -16,13 +16,14 @@
import de.ellpeck.actuallyadditions.mod.util.WorldUtil;
import net.minecraft.block.Block;
import net.minecraft.block.BlockPistonBase;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.BlockPos;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;

public class BlockLampPowerer extends BlockBase{
@@ -34,7 +35,7 @@ public BlockLampPowerer(String name){
this.setHarvestLevel("pickaxe", 0);
this.setHardness(1.5F);
this.setResistance(10.0F);
this.setStepSound(soundTypeStone);
this.setStepSound(SoundType.STONE);
}

@Override
@@ -49,7 +50,7 @@ public void onBlockAdded(World world, BlockPos pos, IBlockState state){

@Override
public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase player, ItemStack stack){
int rotation = BlockPistonBase.getFacingFromEntity(world, pos, player).ordinal();
int rotation = BlockPistonBase.getFacingFromEntity(pos, player).ordinal();
PosUtil.setMetadata(pos, world, rotation, 2);

super.onBlockPlacedBy(world, pos, state, player, stack);
@@ -13,22 +13,19 @@
import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityLaserRelay;
import de.ellpeck.actuallyadditions.mod.util.PosUtil;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.world.IBlockAccess;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;

import java.util.List;

//TODO Fix bounding box
public class BlockLaserRelay extends BlockContainerBase{

private static final PropertyInteger META = PropertyInteger.create("meta", 0, 5);
@@ -38,22 +35,16 @@ public BlockLaserRelay(String name){
this.setHarvestLevel("pickaxe", 0);
this.setHardness(1.5F);
this.setResistance(10.0F);
this.setStepSound(soundTypeStone);
this.setStepSound(SoundType.STONE);
}

@Override
public boolean isFullCube(){
public boolean isFullCube(IBlockState state){
return false;
}

@Override
public void addCollisionBoxesToList(World world, BlockPos pos, IBlockState state, AxisAlignedBB axis, List list, Entity entity){
this.setBlockBoundsBasedOnState(world, pos);
super.addCollisionBoxesToList(world, pos, state, axis, list, entity);
}

@Override
public boolean isOpaqueCube(){
public boolean isOpaqueCube(IBlockState state){
return false;
}

@@ -62,31 +53,6 @@ public IBlockState onBlockPlaced(World world, BlockPos pos, EnumFacing side, flo
return this.getStateFromMeta(side.ordinal());
}

@Override
public void setBlockBoundsBasedOnState(IBlockAccess world, BlockPos pos){
int meta = PosUtil.getMetadata(pos, world);

float pixel = 1F/16F;
if(meta == 0){
this.setBlockBounds(3*pixel, 3*pixel, 3*pixel, 1F-3*pixel, 1F, 1F-3*pixel);
}
else if(meta == 1){
this.setBlockBounds(3*pixel, 0F, 3*pixel, 1F-3*pixel, 1F-3*pixel, 1F-3*pixel);
}
else if(meta == 2){
this.setBlockBounds(3*pixel, 3*pixel, 3*pixel, 1F-3*pixel, 1F-3*pixel, 1F);
}
else if(meta == 3){
this.setBlockBounds(3*pixel, 3*pixel, 0F, 1F-3*pixel, 1F-3*pixel, 1F-3*pixel);
}
else if(meta == 4){
this.setBlockBounds(3*pixel, 3*pixel, 3*pixel, 1F, 1F-3*pixel, 1F-3*pixel);
}
else if(meta == 5){
this.setBlockBounds(0F, 3*pixel, 3*pixel, 1F-3*pixel, 1F-3*pixel, 1F-3*pixel);
}
}

@Override
public EnumRarity getRarity(ItemStack stack){
return EnumRarity.EPIC;
@@ -14,6 +14,7 @@
import de.ellpeck.actuallyadditions.mod.tile.TileEntityLavaFactoryController;
import de.ellpeck.actuallyadditions.mod.util.ModUtil;
import de.ellpeck.actuallyadditions.mod.util.StringUtil;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.ScaledResolution;
@@ -22,7 +23,7 @@
import net.minecraft.item.ItemStack;
import net.minecraft.profiler.Profiler;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -34,7 +35,7 @@ public BlockLavaFactoryController(String name){
this.setHarvestLevel("pickaxe", 0);
this.setHardness(4.5F);
this.setResistance(20.0F);
this.setStepSound(soundTypeStone);
this.setStepSound(SoundType.STONE);
}

@Override
@@ -49,7 +50,7 @@ public EnumRarity getRarity(ItemStack stack){

@Override
@SideOnly(Side.CLIENT)
public void displayHud(Minecraft minecraft, EntityPlayer player, ItemStack stack, MovingObjectPosition posHit, Profiler profiler, ScaledResolution resolution){
public void displayHud(Minecraft minecraft, EntityPlayer player, ItemStack stack, RayTraceResult posHit, Profiler profiler, ScaledResolution resolution){
TileEntityLavaFactoryController factory = (TileEntityLavaFactoryController)minecraft.theWorld.getTileEntity(posHit.getBlockPos());
if(factory != null){
int state = factory.isMultiblock();
@@ -12,12 +12,13 @@

import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityLeafGenerator;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockPos;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;

public class BlockLeafGenerator extends BlockContainerBase{
@@ -27,7 +28,7 @@ public BlockLeafGenerator(String name){
this.setHarvestLevel("pickaxe", 0);
this.setHardness(5.0F);
this.setResistance(10.0F);
this.setStepSound(soundTypeMetal);
this.setStepSound(SoundType.METAL);
}

@Override
@@ -16,6 +16,7 @@
import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityMiner;
import de.ellpeck.actuallyadditions.mod.util.StringUtil;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft;
@@ -25,9 +26,10 @@
import net.minecraft.item.ItemStack;
import net.minecraft.profiler.Profiler;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -39,16 +41,16 @@ public BlockMiner(String name){
this.setHarvestLevel("pickaxe", 0);
this.setHardness(8F);
this.setResistance(30F);
this.setStepSound(soundTypeStone);
this.setStepSound(SoundType.STONE);
}

@Override
public boolean isOpaqueCube(){
public boolean isOpaqueCube(IBlockState state){
return false;
}

@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing par6, float par7, float par8, float par9){
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing par6, float par7, float par8, float par9){
if(!world.isRemote){
TileEntity tile = world.getTileEntity(pos);
if(tile instanceof TileEntityMiner){
@@ -76,7 +78,7 @@ public void breakBlock(World world, BlockPos pos, IBlockState state){

@Override
@SideOnly(Side.CLIENT)
public void displayHud(Minecraft minecraft, EntityPlayer player, ItemStack stack, MovingObjectPosition posHit, Profiler profiler, ScaledResolution resolution){
public void displayHud(Minecraft minecraft, EntityPlayer player, ItemStack stack, RayTraceResult posHit, Profiler profiler, ScaledResolution resolution){
TileEntity tile = minecraft.theWorld.getTileEntity(posHit.getBlockPos());
if(tile instanceof TileEntityMiner){
String info = ((TileEntityMiner)tile).layerAt <= 0 ? "Done Mining!" : "Mining at Y = "+((TileEntityMiner)tile).layerAt+".";
@@ -17,16 +17,18 @@
import de.ellpeck.actuallyadditions.mod.proxy.ClientProxy;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityOilGenerator;
import de.ellpeck.actuallyadditions.mod.util.PosUtil;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -42,7 +44,7 @@ public BlockOilGenerator(String name){
this.setHarvestLevel("pickaxe", 0);
this.setHardness(1.5F);
this.setResistance(10.0F);
this.setStepSound(soundTypeStone);
this.setStepSound(SoundType.STONE);
this.setTickRandomly(true);
}

@@ -53,7 +55,7 @@ public TileEntity createNewTileEntity(World world, int par2){

@Override
@SideOnly(Side.CLIENT)
public void randomDisplayTick(World world, BlockPos pos, IBlockState state, Random rand){
public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand){
if(PosUtil.getMetadata(state) == 1){
for(int i = 0; i < 5; i++){
world.spawnParticle(ClientProxy.bulletForMyValentine ? EnumParticleTypes.HEART : EnumParticleTypes.SMOKE_NORMAL, (double)pos.getX()+0.5F, (double)pos.getY()+1.0F, (double)pos.getZ()+0.5F, 0.0D, 0.0D, 0.0D);
@@ -62,7 +64,7 @@ public void randomDisplayTick(World world, BlockPos pos, IBlockState state, Rand
}

@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing par6, float par7, float par8, float par9){
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing par6, float par7, float par8, float par9){
if(!world.isRemote){
TileEntityOilGenerator generator = (TileEntityOilGenerator)world.getTileEntity(pos);
if(generator != null){
@@ -17,6 +17,7 @@
import de.ellpeck.actuallyadditions.mod.util.ModUtil;
import de.ellpeck.actuallyadditions.mod.util.PosUtil;
import de.ellpeck.actuallyadditions.mod.util.StringUtil;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft;
@@ -28,6 +29,10 @@
import net.minecraft.profiler.Profiler;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.*;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -43,7 +48,7 @@ public BlockPhantom(Type type, String name){
this.setHarvestLevel("pickaxe", 0);
this.setHardness(4.5F);
this.setResistance(10.0F);
this.setStepSound(soundTypeStone);
this.setStepSound(SoundType.STONE);

if(type == Type.FACE || type == Type.LIQUIFACE || type == Type.ENERGYFACE){
this.range = TileEntityPhantomface.RANGE;
@@ -78,7 +83,7 @@ public TileEntity createNewTileEntity(World world, int par2){
}

@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ){
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ){
if(this.tryToggleRedstone(world, pos, player)){
return true;
}
@@ -98,27 +103,27 @@ public EnumRarity getRarity(ItemStack stack){

@Override
@SideOnly(Side.CLIENT)
public void displayHud(Minecraft minecraft, EntityPlayer player, ItemStack stack, MovingObjectPosition posHit, Profiler profiler, ScaledResolution resolution){
public void displayHud(Minecraft minecraft, EntityPlayer player, ItemStack stack, RayTraceResult posHit, Profiler profiler, ScaledResolution resolution){
TileEntity tile = minecraft.theWorld.getTileEntity(posHit.getBlockPos());
if(tile != null){
if(tile instanceof IPhantomTile){
IPhantomTile phantom = (IPhantomTile)tile;
minecraft.fontRendererObj.drawStringWithShadow(EnumChatFormatting.GOLD+StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".blockPhantomRange.desc")+": "+phantom.getRange(), resolution.getScaledWidth()/2+5, resolution.getScaledHeight()/2-40, StringUtil.DECIMAL_COLOR_WHITE);
minecraft.fontRendererObj.drawStringWithShadow(TextFormatting.GOLD+StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".blockPhantomRange.desc")+": "+phantom.getRange(), resolution.getScaledWidth()/2+5, resolution.getScaledHeight()/2-40, StringUtil.DECIMAL_COLOR_WHITE);
if(phantom.hasBoundPosition()){
int distance = (int)new Vec3(posHit.getBlockPos()).distanceTo(new Vec3(phantom.getBoundPosition()));
int distance = (int)new Vec3d(posHit.getBlockPos()).distanceTo(new Vec3d(phantom.getBoundPosition()));
Item item = PosUtil.getItemBlock(phantom.getBoundPosition(), minecraft.theWorld);
String name = item == null ? "Absolutely Nothing" : item.getItemStackDisplayName(new ItemStack(PosUtil.getBlock(phantom.getBoundPosition(), minecraft.theWorld), 1, PosUtil.getMetadata(phantom.getBoundPosition(), minecraft.theWorld)));
StringUtil.drawSplitString(minecraft.fontRendererObj, StringUtil.localizeFormatted("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.blockInfo.desc", name, phantom.getBoundPosition().getX(), phantom.getBoundPosition().getY(), phantom.getBoundPosition().getZ(), distance), resolution.getScaledWidth()/2+5, resolution.getScaledHeight()/2-30, 200, StringUtil.DECIMAL_COLOR_WHITE, true);

if(phantom.isBoundThingInRange()){
StringUtil.drawSplitString(minecraft.fontRendererObj, EnumChatFormatting.DARK_GREEN+StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.connectedRange.desc"), resolution.getScaledWidth()/2+5, resolution.getScaledHeight()/2+25, 200, StringUtil.DECIMAL_COLOR_WHITE, true);
StringUtil.drawSplitString(minecraft.fontRendererObj, TextFormatting.DARK_GREEN+StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.connectedRange.desc"), resolution.getScaledWidth()/2+5, resolution.getScaledHeight()/2+25, 200, StringUtil.DECIMAL_COLOR_WHITE, true);
}
else{
StringUtil.drawSplitString(minecraft.fontRendererObj, EnumChatFormatting.DARK_RED+StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.connectedNoRange.desc"), resolution.getScaledWidth()/2+5, resolution.getScaledHeight()/2+25, 200, StringUtil.DECIMAL_COLOR_WHITE, true);
StringUtil.drawSplitString(minecraft.fontRendererObj, TextFormatting.DARK_RED+StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.connectedNoRange.desc"), resolution.getScaledWidth()/2+5, resolution.getScaledHeight()/2+25, 200, StringUtil.DECIMAL_COLOR_WHITE, true);
}
}
else{
minecraft.fontRendererObj.drawStringWithShadow(EnumChatFormatting.RED+StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.notConnected.desc"), resolution.getScaledWidth()/2+5, resolution.getScaledHeight()/2+25, StringUtil.DECIMAL_COLOR_WHITE);
minecraft.fontRendererObj.drawStringWithShadow(TextFormatting.RED+StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.notConnected.desc"), resolution.getScaledWidth()/2+5, resolution.getScaledHeight()/2+25, StringUtil.DECIMAL_COLOR_WHITE);
}
}
}
@@ -12,7 +12,9 @@

import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityPhantomBooster;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
@@ -25,19 +27,20 @@ public BlockPhantomBooster(String name){
this.setHarvestLevel("pickaxe", 0);
this.setHardness(1.5F);
this.setResistance(10.0F);
this.setStepSound(soundTypeStone);
this.setStepSound(SoundType.STONE);

float f = 1F/16F;
this.setBlockBounds(2*f, 0F, 2*f, 1-2*f, 1F, 1-2*f);
//TODO Fix block bounds
//float f = 1F/16F;
//this.setBlockBounds(2*f, 0F, 2*f, 1-2*f, 1F, 1-2*f);
}

@Override
public boolean isFullCube(){
public boolean isFullCube(IBlockState state){
return false;
}

@Override
public boolean isOpaqueCube(){
public boolean isOpaqueCube(IBlockState state){
return false;
}

@@ -14,14 +14,16 @@
import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase;
import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityRangedCollector;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;

public class BlockRangedCollector extends BlockContainerBase{
@@ -31,7 +33,7 @@ public BlockRangedCollector(String name){
this.setHarvestLevel("pickaxe", 0);
this.setHardness(1.5F);
this.setResistance(10.0F);
this.setStepSound(soundTypeStone);
this.setStepSound(SoundType.STONE);
}

@Override
@@ -40,7 +42,7 @@ public TileEntity createNewTileEntity(World world, int par2){
}

@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing par6, float par7, float par8, float par9){
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing par6, float par7, float par8, float par9){
if(!world.isRemote){
TileEntityRangedCollector breaker = (TileEntityRangedCollector)world.getTileEntity(pos);
if(breaker != null){
@@ -21,9 +21,11 @@
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;

@@ -40,21 +42,34 @@ public BlockSlabs(String name, Block fullBlock){
}

public BlockSlabs(String name, Block fullBlock, int meta){
super(fullBlock.getMaterial(), name);
super(fullBlock.getMaterial(fullBlock.getDefaultState()), name);
this.setHardness(1.5F);
this.setResistance(10.0F);
this.fullBlock = fullBlock;
this.meta = meta;
}

@Override
/*@Override
public void addCollisionBoxesToList(World world, BlockPos pos, IBlockState state, AxisAlignedBB axis, List list, Entity entity){
this.setBlockBoundsBasedOnState(world, pos);
super.addCollisionBoxesToList(world, pos, state, axis, list, entity);
}
@Override
public boolean isOpaqueCube(){
public void setBlockBoundsBasedOnState(IBlockAccess world, BlockPos pos){
int meta = PosUtil.getMetadata(pos, world);
float minY = meta == 1 ? 0.5F : 0.0F;
float maxY = meta == 1 ? 1.0F : 0.5F;
this.setBlockBounds(0.0F, minY, 0F, 1.0F, maxY, 1.0F);
}
@Override
public void setBlockBoundsForItemRender(){
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F);
}*/

@Override
public boolean isOpaqueCube(IBlockState state){
return false;
}

@@ -69,19 +84,6 @@ public IBlockState onBlockPlaced(World world, BlockPos pos, EnumFacing facing, f
return this.getStateFromMeta(meta);
}

@Override
public void setBlockBoundsBasedOnState(IBlockAccess world, BlockPos pos){
int meta = PosUtil.getMetadata(pos, world);
float minY = meta == 1 ? 0.5F : 0.0F;
float maxY = meta == 1 ? 1.0F : 0.5F;
this.setBlockBounds(0.0F, minY, 0F, 1.0F, maxY, 1.0F);
}

@Override
public void setBlockBoundsForItemRender(){
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F);
}

@Override
public Class<? extends ItemBlockBase> getItemBlock(){
return TheItemBlock.class;
@@ -106,15 +108,16 @@ public TheItemBlock(Block block){
}

@Override
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ){
public EnumActionResult onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ){
if(PosUtil.getBlock(pos, world) == this.block && ((side.ordinal() == 1 && PosUtil.getMetadata(pos, world) == 0) || (side.ordinal() == 0 && PosUtil.getMetadata(pos, world) == 1))){
if(PosUtil.setBlock(pos, world, ((BlockSlabs)this.block).fullBlock, ((BlockSlabs)this.block).meta, 3)){
world.playSoundEffect(pos.getX()+0.5F, pos.getY()+0.5F, pos.getZ()+0.5F, this.block.stepSound.getBreakSound(), (this.block.stepSound.getVolume()+1.0F)/2.0F, this.block.stepSound.frequency*0.8F);
//TODO Fix sounds
//world.playSoundEffect(pos.getX()+0.5F, pos.getY()+0.5F, pos.getZ()+0.5F, this.block.stepSound.getBreakSound(), (this.block.stepSound.getVolume()+1.0F)/2.0F, this.block.stepSound.frequency*0.8F);
stack.stackSize--;
return true;
return EnumActionResult.SUCCESS;
}
}
return super.onItemUse(stack, player, world, pos, side, hitX, hitY, hitZ);
return super.onItemUse(stack, player, world, pos, hand, side, hitX, hitY, hitZ);
}

@Override
@@ -18,6 +18,7 @@
import de.ellpeck.actuallyadditions.mod.tile.TileEntitySmileyCloud;
import de.ellpeck.actuallyadditions.mod.util.PosUtil;
import de.ellpeck.actuallyadditions.mod.util.Util;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.IBlockState;
@@ -28,6 +29,9 @@
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.*;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
@@ -44,29 +48,49 @@ public BlockSmileyCloud(String name){
super(Material.cloth, name);
this.setHardness(0.5F);
this.setResistance(5.0F);
this.setStepSound(soundTypeCloth);
this.setStepSound(SoundType.CLOTH);
this.setTickRandomly(true);
}

@Override
public boolean isFullCube(){
public boolean isFullCube(IBlockState state){
return false;
}

//TODO Fix bounding box
/*@Override
public void setBlockBoundsBasedOnState(IBlockAccess world, BlockPos pos){
int meta = PosUtil.getMetadata(pos, world);
float f = 0.0625F;
if(meta == 1){
this.setBlockBounds(0F, 0F, 0F, 1F, 1F-f*3F, 1F-f*2F);
}
if(meta == 3){
this.setBlockBounds(0F, 0F, 0F, 1F-f*2F, 1F-f*3F, 1F);
}
if(meta == 0){
this.setBlockBounds(0F, 0F, f*2F, 1F, 1F-f*3F, 1F);
}
if(meta == 2){
this.setBlockBounds(f*2F, 0F, 0F, 1F, 1F-f*3F, 1F);
}
}
@Override
public void addCollisionBoxesToList(World world, BlockPos pos, IBlockState state, AxisAlignedBB axis, List list, Entity entity){
this.setBlockBoundsBasedOnState(world, pos);
super.addCollisionBoxesToList(world, pos, state, axis, list, entity);
}
}*/

@Override
public boolean isOpaqueCube(){
public boolean isOpaqueCube(IBlockState state){
return false;
}

@Override
@SideOnly(Side.CLIENT)
public void randomDisplayTick(World world, BlockPos pos, IBlockState state, Random rand){
public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand){
if(Util.RANDOM.nextInt(30) == 0){
for(int i = 0; i < 2; i++){
double d = Util.RANDOM.nextGaussian()*0.02D;
@@ -78,37 +102,18 @@ public void randomDisplayTick(World world, BlockPos pos, IBlockState state, Rand
}

@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing f6, float f7, float f8, float f9){
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing f6, float f7, float f8, float f9){
if(!world.isRemote){
TileEntity tile = world.getTileEntity(pos);
if(tile instanceof TileEntitySmileyCloud){
player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.CLOUD.ordinal(), world, pos.getX(), pos.getY(), pos.getZ());

player.triggerAchievement(TheAchievements.NAME_SMILEY_CLOUD.ach);
player.addStat(TheAchievements.NAME_SMILEY_CLOUD.ach);
}
}
return true;
}

@Override
public void setBlockBoundsBasedOnState(IBlockAccess world, BlockPos pos){
int meta = PosUtil.getMetadata(pos, world);
float f = 0.0625F;

if(meta == 1){
this.setBlockBounds(0F, 0F, 0F, 1F, 1F-f*3F, 1F-f*2F);
}
if(meta == 3){
this.setBlockBounds(0F, 0F, 0F, 1F-f*2F, 1F-f*3F, 1F);
}
if(meta == 0){
this.setBlockBounds(0F, 0F, f*2F, 1F, 1F-f*3F, 1F);
}
if(meta == 2){
this.setBlockBounds(f*2F, 0F, 0F, 1F, 1F-f*3F, 1F);
}
}

@Override
public TileEntity createNewTileEntity(World world, int meta){
return new TileEntitySmileyCloud();
@@ -16,6 +16,7 @@
import de.ellpeck.actuallyadditions.mod.blocks.base.BlockBase;
import de.ellpeck.actuallyadditions.mod.util.PosUtil;
import de.ellpeck.actuallyadditions.mod.util.Util;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.IBlockState;
@@ -27,6 +28,8 @@
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.*;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -42,13 +45,13 @@ public BlockTreasureChest(String name){
this.setHarvestLevel("axe", 0);
this.setHardness(300.0F);
this.setResistance(50.0F);
this.setStepSound(soundTypeWood);
this.setStepSound(SoundType.WOOD);
this.setTickRandomly(true);
}

@Override
@SideOnly(Side.CLIENT)
public void randomDisplayTick(World world, BlockPos pos, IBlockState state, Random rand){
public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand){
for(int i = 0; i < 2; i++){
for(float f = 0; f <= 3; f += 0.5){
float particleX = rand.nextFloat();
@@ -64,13 +67,14 @@ public Item getItemDropped(IBlockState state, Random rand, int par3){
}

@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing par6, float par7, float par8, float par9){
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing par6, float par7, float par8, float par9){
if(!world.isRemote){
world.playSoundAtEntity(player, "random.chestopen", 0.2F, Util.RANDOM.nextFloat()*0.1F+0.9F);
//TODO Fix sounds
//world.playSoundAtEntity(player, "random.chestopen", 0.2F, Util.RANDOM.nextFloat()*0.1F+0.9F);
this.dropItems(world, pos);
world.setBlockToAir(pos);

player.triggerAchievement(TheAchievements.OPEN_TREASURE_CHEST.ach);
//player.triggerAchievement(TheAchievements.OPEN_TREASURE_CHEST.ach);
}
return true;
}
@@ -16,15 +16,16 @@
import net.minecraft.block.BlockFenceGate;
import net.minecraft.block.BlockWall;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.BlockStateBase;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
@@ -40,13 +41,17 @@ public BlockWallAA(String name, Block base){
this(name, base, 0);
}

protected static final AxisAlignedBB[] field_185751_g = new AxisAlignedBB[]{new AxisAlignedBB(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D), new AxisAlignedBB(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 1.0D), new AxisAlignedBB(0.0D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D), new AxisAlignedBB(0.0D, 0.0D, 0.25D, 0.75D, 1.0D, 1.0D), new AxisAlignedBB(0.25D, 0.0D, 0.0D, 0.75D, 1.0D, 0.75D), new AxisAlignedBB(0.3125D, 0.0D, 0.0D, 0.6875D, 0.875D, 1.0D), new AxisAlignedBB(0.0D, 0.0D, 0.0D, 0.75D, 1.0D, 0.75D), new AxisAlignedBB(0.0D, 0.0D, 0.0D, 0.75D, 1.0D, 1.0D), new AxisAlignedBB(0.25D, 0.0D, 0.25D, 1.0D, 1.0D, 0.75D), new AxisAlignedBB(0.25D, 0.0D, 0.25D, 1.0D, 1.0D, 1.0D), new AxisAlignedBB(0.0D, 0.0D, 0.3125D, 1.0D, 0.875D, 0.6875D), new AxisAlignedBB(0.0D, 0.0D, 0.25D, 1.0D, 1.0D, 1.0D), new AxisAlignedBB(0.25D, 0.0D, 0.0D, 1.0D, 1.0D, 0.75D), new AxisAlignedBB(0.25D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D), new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.75D), new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D)};
protected static final AxisAlignedBB[] field_185750_B = new AxisAlignedBB[]{field_185751_g[0].setMaxY(1.5D), field_185751_g[1].setMaxY(1.5D), field_185751_g[2].setMaxY(1.5D), field_185751_g[3].setMaxY(1.5D), field_185751_g[4].setMaxY(1.5D), field_185751_g[5].setMaxY(1.5D), field_185751_g[6].setMaxY(1.5D), field_185751_g[7].setMaxY(1.5D), field_185751_g[8].setMaxY(1.5D), field_185751_g[9].setMaxY(1.5D), field_185751_g[10].setMaxY(1.5D), field_185751_g[11].setMaxY(1.5D), field_185751_g[12].setMaxY(1.5D), field_185751_g[13].setMaxY(1.5D), field_185751_g[14].setMaxY(1.5D), field_185751_g[15].setMaxY(1.5D)};


public BlockWallAA(String name, Block base, int meta){
super(base.getMaterial(), name);
super(base.getMaterial(base.getDefaultState()), name);
this.meta = meta;

this.setHardness(1.5F);
this.setResistance(10F);
this.setStepSound(base.stepSound);
this.setStepSound(base.getStepSound());

this.setDefaultState(this.blockState.getBaseState().withProperty(BlockWall.UP, false).withProperty(BlockWall.NORTH, false).withProperty(BlockWall.EAST, false).withProperty(BlockWall.SOUTH, false).withProperty(BlockWall.WEST, false));
}
@@ -57,7 +62,7 @@ public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, Block
}

@Override
public boolean isFullCube(){
public boolean isFullCube(IBlockState state){
return false;
}

@@ -68,64 +73,50 @@ public boolean isPassable(IBlockAccess worldIn, BlockPos pos){

@Override
@SideOnly(Side.CLIENT)
public boolean shouldSideBeRendered(IBlockAccess worldIn, BlockPos pos, EnumFacing side){
return side != EnumFacing.DOWN || super.shouldSideBeRendered(worldIn, pos, side);
public boolean shouldSideBeRendered(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side){
return side != EnumFacing.DOWN || super.shouldSideBeRendered(blockState, blockAccess, pos, side);
}

@Override
public AxisAlignedBB getCollisionBoundingBox(World worldIn, BlockPos pos, IBlockState state){
this.setBlockBoundsBasedOnState(worldIn, pos);
this.maxY = 1.5D;
return super.getCollisionBoundingBox(worldIn, pos, state);
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos){
state = this.getActualState(state, source, pos);
return field_185751_g[figureOutSomeWallStuff(state)];
}

@Override
public boolean isOpaqueCube(){
return false;
public AxisAlignedBB getSelectedBoundingBox(IBlockState blockState, World worldIn, BlockPos pos){
blockState = this.getActualState(blockState, worldIn, pos);
return field_185750_B[figureOutSomeWallStuff(blockState)];
}

@Override
public int damageDropped(IBlockState state){
return meta;
}
private static int figureOutSomeWallStuff(IBlockState state){
int i = 0;

@Override
public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos){
boolean flag = this.canConnectTo(worldIn, pos.north());
boolean flag1 = this.canConnectTo(worldIn, pos.south());
boolean flag2 = this.canConnectTo(worldIn, pos.west());
boolean flag3 = this.canConnectTo(worldIn, pos.east());
float f = 0.25F;
float f1 = 0.75F;
float f2 = 0.25F;
float f3 = 0.75F;
float f4 = 1.0F;

if(flag){
f2 = 0.0F;
}
if(flag1){
f3 = 1.0F;
}
if(flag2){
f = 0.0F;
if(state.getValue(BlockWall.NORTH)){
i |= 1 << EnumFacing.NORTH.getHorizontalIndex();
}
if(flag3){
f1 = 1.0F;

if(state.getValue(BlockWall.EAST)){
i |= 1 << EnumFacing.EAST.getHorizontalIndex();
}

if(flag && flag1 && !flag2 && !flag3){
f4 = 0.8125F;
f = 0.3125F;
f1 = 0.6875F;
if(state.getValue(BlockWall.SOUTH)){
i |= 1 << EnumFacing.SOUTH.getHorizontalIndex();
}
else if(!flag && !flag1 && flag2 && flag3){
f4 = 0.8125F;
f2 = 0.3125F;
f3 = 0.6875F;

if(state.getValue(BlockWall.WEST)){
i |= 1 << EnumFacing.WEST.getHorizontalIndex();
}

this.setBlockBounds(f, 0.0F, f2, f1, f4, f3);
return i;
}

@Override
public boolean isOpaqueCube(IBlockState state){
return false;
}

@Override
public int damageDropped(IBlockState state){
return meta;
}

@SuppressWarnings("unchecked")
@@ -137,7 +128,8 @@ public void getSubBlocks(Item item, CreativeTabs tab, List list){

public boolean canConnectTo(IBlockAccess worldIn, BlockPos pos){
Block block = PosUtil.getBlock(pos, worldIn);
return block != Blocks.barrier && (!(block != this && !(block instanceof BlockFenceGate)) || ((block.getMaterial().isOpaque() && block.isFullCube()) && block.getMaterial() != Material.gourd));
IBlockState state = worldIn.getBlockState(pos);
return block != Blocks.barrier && (!(block != this && !(block instanceof BlockFenceGate)) || ((block.getMaterial(state).isOpaque() && block.isFullCube(state)) && block.getMaterial(state) != Material.gourd));
}

@Override
@@ -151,7 +143,7 @@ public int getMetaFromState(IBlockState state){
}

@Override
protected BlockState createBlockState(){
return new BlockState(this, BlockWall.UP, BlockWall.NORTH, BlockWall.EAST, BlockWall.WEST, BlockWall.SOUTH);
protected BlockStateContainer createBlockState(){
return new BlockStateContainer(this, BlockWall.UP, BlockWall.NORTH, BlockWall.EAST, BlockWall.WEST, BlockWall.SOUTH);
}
}
@@ -20,6 +20,7 @@
import de.ellpeck.actuallyadditions.mod.util.PosUtil;
import de.ellpeck.actuallyadditions.mod.util.StringUtil;
import net.minecraft.block.Block;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.IBlockState;
@@ -28,9 +29,10 @@
import net.minecraft.item.EnumRarity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
@@ -45,20 +47,20 @@ public class BlockWildPlant extends BlockBushBase{

public BlockWildPlant(String name){
super(name);
this.setStepSound(soundTypeGrass);
this.setStepSound(SoundType.PLANT);
}

@Override
public boolean canBlockStay(World world, BlockPos pos, IBlockState state){
BlockPos offset = PosUtil.offset(pos, 0, -1, 0);
return PosUtil.getMetadata(state) == TheWildPlants.RICE.ordinal() ? PosUtil.getMaterial(offset, world) == Material.water : PosUtil.getBlock(offset, world).canSustainPlant(world, offset, EnumFacing.UP, this);
return PosUtil.getMetadata(state) == TheWildPlants.RICE.ordinal() ? PosUtil.getMaterial(offset, world) == Material.water : PosUtil.getBlock(offset, world).canSustainPlant(world.getBlockState(offset), world, offset, EnumFacing.UP, this);
}

@Override
@SideOnly(Side.CLIENT)
public Item getItem(World world, BlockPos pos){
int metadata = PosUtil.getMetadata(pos, world);
return metadata >= allWildPlants.length ? null : ((BlockPlant)allWildPlants[metadata].wildVersionOf).seedItem;
public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player){
int metadata = PosUtil.getMetadata(pos, world);
return metadata >= allWildPlants.length ? null : new ItemStack(((BlockPlant)allWildPlants[metadata].wildVersionOf).seedItem);
}

@SuppressWarnings("all")
@@ -18,6 +18,7 @@
import de.ellpeck.actuallyadditions.mod.tile.TileEntityXPSolidifier;
import de.ellpeck.actuallyadditions.mod.util.PosUtil;
import de.ellpeck.actuallyadditions.mod.util.Util;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.IBlockState;
@@ -27,9 +28,10 @@
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.MathHelper;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.World;

public class BlockXPSolidifier extends BlockContainerBase{
@@ -41,7 +43,7 @@ public BlockXPSolidifier(String name){
this.setHarvestLevel("pickaxe", 0);
this.setHardness(2.5F);
this.setResistance(10.0F);
this.setStepSound(soundTypeStone);
this.setStepSound(SoundType.STONE);
}

@Override
@@ -50,7 +52,7 @@ public TileEntity createNewTileEntity(World world, int par2){
}

@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing par6, float par7, float par8, float par9){
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing par6, float par7, float par8, float par9){
if(!world.isRemote){
TileEntityXPSolidifier solidifier = (TileEntityXPSolidifier)world.getTileEntity(pos);
if(solidifier != null){
@@ -15,13 +15,13 @@
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.profiler.Profiler;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.math.RayTraceResult;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

public interface IHudDisplay{

@SideOnly(Side.CLIENT)
void displayHud(Minecraft minecraft, EntityPlayer player, ItemStack stack, MovingObjectPosition posHit, Profiler profiler, ScaledResolution resolution);
void displayHud(Minecraft minecraft, EntityPlayer player, ItemStack stack, RayTraceResult posHit, Profiler profiler, ScaledResolution resolution);

}
@@ -16,7 +16,7 @@
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
@@ -70,8 +70,8 @@ public int getMetaFromState(IBlockState state){
}

@Override
protected BlockState createBlockState(){
return this.getMetaProperty() == null ? super.createBlockState() : new BlockState(this, this.getMetaProperty());
protected BlockStateContainer createBlockState(){
return this.getMetaProperty() == null ? super.createBlockState() : new BlockStateContainer(this, this.getMetaProperty());
}

protected PropertyInteger getMetaProperty(){
@@ -14,8 +14,9 @@
import de.ellpeck.actuallyadditions.mod.util.ItemUtil;
import de.ellpeck.actuallyadditions.mod.util.ModUtil;
import net.minecraft.block.BlockBush;
import net.minecraft.block.SoundType;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
@@ -27,7 +28,7 @@ public class BlockBushBase extends BlockBush{

public BlockBushBase(String name){
this.name = name;
this.setStepSound(soundTypeGrass);
this.setStepSound(SoundType.PLANT);

this.register();
}
@@ -69,8 +70,8 @@ public int getMetaFromState(IBlockState state){
}

@Override
protected BlockState createBlockState(){
return this.getMetaProperty() == null ? super.createBlockState() : new BlockState(this, this.getMetaProperty());
protected BlockStateContainer createBlockState(){
return this.getMetaProperty() == null ? super.createBlockState() : new BlockStateContainer(this, this.getMetaProperty());
}

protected PropertyInteger getMetaProperty(){
@@ -20,7 +20,8 @@
import net.minecraft.block.BlockRedstoneTorch;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.BlockStateBase;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem;
@@ -31,8 +32,9 @@
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumBlockRenderType;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fluids.FluidStack;
@@ -118,7 +120,7 @@ public void dropSlotFromInventory(int i, TileEntityInventoryBase tile, World wor
}

public boolean tryToggleRedstone(World world, BlockPos pos, EntityPlayer player){
ItemStack stack = player.getCurrentEquippedItem();
ItemStack stack = player.getActiveItemStack();
if(stack != null && Block.getBlockFromItem(stack.getItem()) instanceof BlockRedstoneTorch){
TileEntity tile = world.getTileEntity(pos);
if(tile instanceof IRedstoneToggle){
@@ -224,12 +226,12 @@ public void onBlockHarvested(World world, BlockPos pos, IBlockState state, Entit
}

@Override
public boolean hasComparatorInputOverride(){
public boolean hasComparatorInputOverride(IBlockState state){
return true;
}

@Override
public int getComparatorInputOverride(World world, BlockPos pos){
public int getComparatorInputOverride(IBlockState state, World world, BlockPos pos){
TileEntity tile = world.getTileEntity(pos);
if(tile instanceof IInventory){
return Container.calcRedstoneFromInventory((IInventory)tile);
@@ -238,8 +240,8 @@ public int getComparatorInputOverride(World world, BlockPos pos){
}

@Override
protected BlockState createBlockState(){
return this.getMetaProperty() == null ? super.createBlockState() : new BlockState(this, this.getMetaProperty());
protected BlockStateContainer createBlockState(){
return this.getMetaProperty() == null ? super.createBlockState() : new BlockStateContainer(this, this.getMetaProperty());
}

@Override
@@ -290,7 +292,7 @@ protected PropertyInteger getMetaProperty(){
}

@Override
public int getRenderType(){
return 3;
public EnumBlockRenderType getRenderType(IBlockState state){
return EnumBlockRenderType.MODEL;
}
}
@@ -16,7 +16,7 @@
import net.minecraft.block.material.Material;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.BlockPos;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fluids.BlockFluidClassic;
@@ -20,9 +20,10 @@
import net.minecraft.item.EnumRarity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.EnumPlantType;
@@ -83,21 +84,21 @@ public int damageDropped(IBlockState state){
}

@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing facing, float hitX, float hitY, float hitZ){
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing facing, float hitX, float hitY, float hitZ){
if(getMetaFromState(state) >= 7){
if(!world.isRemote){

List<ItemStack> drops = getDrops(world, pos, state, 0);
boolean deductedSeedSize = false;
for(ItemStack stack : drops){
if(stack != null){
if(stack.getItem() == this.seedItem && !deductedSeedSize){
stack.stackSize--;
for(ItemStack drop : drops){
if(drop != null){
if(drop.getItem() == this.seedItem && !deductedSeedSize){
drop.stackSize--;
deductedSeedSize = true;
}

if(stack.stackSize > 0){
EntityItem entity = new EntityItem(world, pos.getX()+0.5, pos.getY()+0.5, pos.getZ()+0.5, stack);
if(drop.stackSize > 0){
EntityItem entity = new EntityItem(world, pos.getX()+0.5, pos.getY()+0.5, pos.getZ()+0.5, drop);
world.spawnEntityInWorld(entity);
}
}
@@ -110,11 +111,6 @@ public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, En
return false;
}

@Override
public int getDamageValue(World world, BlockPos pos){
return 0;
}

@Override
public Item getSeed(){
return this.seedItem;
@@ -29,7 +29,7 @@
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.item.ItemStack;
import net.minecraft.stats.Achievement;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.text.TextFormatting;

import java.awt.*;
import java.net.URI;
@@ -80,9 +80,9 @@ public static void drawTitle(GuiBooklet booklet){

//Draw No Entry title
if(booklet.currentEntrySet.entry == null){
String strg = EnumChatFormatting.DARK_GREEN+StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".booklet.manualName.1");
String strg = TextFormatting.DARK_GREEN+StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".booklet.manualName.1");
booklet.getFontRenderer().drawString(strg, booklet.guiLeft+booklet.xSize/2-booklet.getFontRenderer().getStringWidth(strg)/2-3, booklet.guiTop+12, 0);
strg = EnumChatFormatting.DARK_GREEN+StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".booklet.manualName.2");
strg = TextFormatting.DARK_GREEN+StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".booklet.manualName.2");
booklet.getFontRenderer().drawString(strg, booklet.guiLeft+booklet.xSize/2-booklet.getFontRenderer().getStringWidth(strg)/2-3, booklet.guiTop+12+booklet.getFontRenderer().FONT_HEIGHT, 0);

String version;
@@ -105,7 +105,7 @@ else if(playerName.equals("Ellpeck") || Util.isDevVersion()){
else{
version = StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".booklet.edition")+" "+ModUtil.VERSION.substring(ModUtil.VERSION.indexOf("r")+1);
}
strg = EnumChatFormatting.GOLD+EnumChatFormatting.ITALIC.toString()+"-"+version+"-";
strg = TextFormatting.GOLD+TextFormatting.ITALIC.toString()+"-"+version+"-";
booklet.getFontRenderer().drawString(strg, booklet.guiLeft+booklet.xSize/2-booklet.getFontRenderer().getStringWidth(strg)/2-3, booklet.guiTop+33, 0);
}

@@ -139,10 +139,10 @@ public static void drawAchievementInfo(GuiBooklet booklet, boolean pre, int mous
if(mouseX >= booklet.guiLeft+booklet.xSize+1 && mouseX < booklet.guiLeft+booklet.xSize+1+22 && mouseY >= booklet.guiTop-18 && mouseY < booklet.guiTop-18+21){
if(infoList == null){
infoList = new ArrayList<String>();
infoList.add(EnumChatFormatting.GOLD+"Achievements related to this chapter:");
infoList.add(TextFormatting.GOLD+"Achievements related to this chapter:");
}
infoList.add("-"+StringUtil.localize(achievement.statId));
infoList.add(EnumChatFormatting.GRAY+"("+achievement.getDescription()+")");
infoList.add(TextFormatting.GRAY+"("+achievement.getDescription()+")");
}
}
}
@@ -178,10 +178,10 @@ public static void renderPre(GuiBooklet booklet, int mouseX, int mouseY, int tic
//Renders the amount of words and chars the book has
else{
String wordCountString = StringUtil.localizeFormatted("booklet."+ModUtil.MOD_ID_LOWER+".amountOfWords", ClientProxy.bookletWordCount);
booklet.getFontRenderer().drawString(EnumChatFormatting.ITALIC+wordCountString, booklet.guiLeft+booklet.xSize-booklet.getFontRenderer().getStringWidth(wordCountString)-15, booklet.guiTop+booklet.ySize-18-booklet.getFontRenderer().FONT_HEIGHT, 0);
booklet.getFontRenderer().drawString(TextFormatting.ITALIC+wordCountString, booklet.guiLeft+booklet.xSize-booklet.getFontRenderer().getStringWidth(wordCountString)-15, booklet.guiTop+booklet.ySize-18-booklet.getFontRenderer().FONT_HEIGHT, 0);

String charCountString = StringUtil.localizeFormatted("booklet."+ModUtil.MOD_ID_LOWER+".amountOfChars", ClientProxy.bookletCharCount);
booklet.getFontRenderer().drawString(EnumChatFormatting.ITALIC+charCountString, booklet.guiLeft+booklet.xSize-booklet.getFontRenderer().getStringWidth(charCountString)-15, booklet.guiTop+booklet.ySize-18, 0);
booklet.getFontRenderer().drawString(TextFormatting.ITALIC+charCountString, booklet.guiLeft+booklet.xSize-booklet.getFontRenderer().getStringWidth(charCountString)-15, booklet.guiTop+booklet.ySize-18, 0);
}
}

@@ -34,9 +34,9 @@
import net.minecraft.client.gui.GuiTextField;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.IChatComponent;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TextFormatting;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import org.lwjgl.input.Keyboard;
@@ -164,7 +164,8 @@ public void drawScreen(int x, int y, float f){
public void keyTyped(char theChar, int key){
if(AND_HIS_NAME_IS.length > this.hisNameIsAt && AND_HIS_NAME_IS[this.hisNameIsAt] == key){
if(this.hisNameIsAt+1 >= AND_HIS_NAME_IS.length){
Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation(ModUtil.MOD_ID_LOWER, "duhDuhDuhDuuuh")));
//TODO Fix sound
//Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation(ModUtil.MOD_ID_LOWER, "duhDuhDuhDuuuh")));
ModUtil.LOGGER.info("AND HIS NAME IS JOHN CENA DUH DUH DUH DUUUH");
this.hisNameIsAt = 0;
}
@@ -274,46 +275,46 @@ public void initGui(){
this.guiLeft = (this.width-this.xSize)/2;
this.guiTop = (this.height-this.ySize)/2;

this.buttonForward = new TexturedButton(0, this.guiLeft+this.xSize-26, this.guiTop+this.ySize+1, 164, 0, 18, 10, Collections.singletonList(EnumChatFormatting.GOLD+"Next Page"));
this.buttonForward = new TexturedButton(0, this.guiLeft+this.xSize-26, this.guiTop+this.ySize+1, 164, 0, 18, 10, Collections.singletonList(TextFormatting.GOLD+"Next Page"));
this.buttonList.add(this.buttonForward);

this.buttonBackward = new TexturedButton(1, this.guiLeft+8, this.guiTop+this.ySize+1, 146, 0, 18, 10, Collections.singletonList(EnumChatFormatting.GOLD+"Previous Page"));
this.buttonBackward = new TexturedButton(1, this.guiLeft+8, this.guiTop+this.ySize+1, 146, 0, 18, 10, Collections.singletonList(TextFormatting.GOLD+"Previous Page"));
this.buttonList.add(this.buttonBackward);

this.buttonPreviousScreen = new TexturedButton(2, this.guiLeft+this.xSize/2-7, this.guiTop+this.ySize+1, 182, 0, 15, 10, Collections.singletonList(EnumChatFormatting.GOLD+"Back"));
this.buttonPreviousScreen = new TexturedButton(2, this.guiLeft+this.xSize/2-7, this.guiTop+this.ySize+1, 182, 0, 15, 10, Collections.singletonList(TextFormatting.GOLD+"Back"));
this.buttonList.add(this.buttonPreviousScreen);

ArrayList updateHover = new ArrayList();
if(UpdateChecker.checkFailed){
updateHover.add(IChatComponent.Serializer.jsonToComponent(StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".update.failed")).getFormattedText());
updateHover.add(ITextComponent.Serializer.jsonToComponent(StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".update.failed")).getFormattedText());
}
else if(UpdateChecker.needsUpdateNotify){
updateHover.add(IChatComponent.Serializer.jsonToComponent(StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".update.generic")).getFormattedText());
updateHover.add(IChatComponent.Serializer.jsonToComponent(StringUtil.localizeFormatted("info."+ModUtil.MOD_ID_LOWER+".update.versionCompare", ModUtil.VERSION, UpdateChecker.updateVersionString)).getFormattedText());
updateHover.add(ITextComponent.Serializer.jsonToComponent(StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".update.generic")).getFormattedText());
updateHover.add(ITextComponent.Serializer.jsonToComponent(StringUtil.localizeFormatted("info."+ModUtil.MOD_ID_LOWER+".update.versionCompare", ModUtil.VERSION, UpdateChecker.updateVersionString)).getFormattedText());
updateHover.add(StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".update.buttonOptions"));
}
this.buttonUpdate = new TexturedButton(4, this.guiLeft-11, this.guiTop-11, 245, 0, 11, 11, updateHover);
this.buttonUpdate.visible = UpdateChecker.needsUpdateNotify;
this.buttonList.add(this.buttonUpdate);

this.buttonTwitter = new TexturedButton(5, this.guiLeft, this.guiTop, 213, 0, 8, 8, Collections.singletonList(EnumChatFormatting.GOLD+"Open @ActAddMod on Twitter in Browser"));
this.buttonTwitter = new TexturedButton(5, this.guiLeft, this.guiTop, 213, 0, 8, 8, Collections.singletonList(TextFormatting.GOLD+"Open @ActAddMod on Twitter in Browser"));
this.buttonList.add(this.buttonTwitter);

this.buttonForum = new TexturedButton(6, this.guiLeft, this.guiTop+10, 221, 0, 8, 8, Collections.singletonList(EnumChatFormatting.GOLD+"Open Minecraft Forum Post in Browser"));
this.buttonForum = new TexturedButton(6, this.guiLeft, this.guiTop+10, 221, 0, 8, 8, Collections.singletonList(TextFormatting.GOLD+"Open Minecraft Forum Post in Browser"));
this.buttonList.add(this.buttonForum);

this.buttonAchievements = new TexturedButton(7, this.guiLeft+138, this.guiTop, 205, 0, 8, 8, Collections.singletonList(EnumChatFormatting.GOLD+"Show Achievements"));
this.buttonAchievements = new TexturedButton(7, this.guiLeft+138, this.guiTop, 205, 0, 8, 8, Collections.singletonList(TextFormatting.GOLD+"Show Achievements"));
this.buttonList.add(this.buttonAchievements);

ArrayList websiteHover = new ArrayList();
websiteHover.add(EnumChatFormatting.GOLD+"Open Author's Website");
websiteHover.add(TextFormatting.GOLD+"Open Author's Website");
websiteHover.add("(There's some cool stuff there!)");
websiteHover.add(EnumChatFormatting.GRAY+""+EnumChatFormatting.ITALIC+"Would you call this Product Placement?");
websiteHover.add(TextFormatting.GRAY+""+TextFormatting.ITALIC+"Would you call this Product Placement?");
this.buttonWebsite = new TexturedButton(-99, this.guiLeft, this.guiTop+20, 228, 0, 8, 8, websiteHover);
this.buttonList.add(this.buttonWebsite);

ArrayList configHover = new ArrayList();
configHover.add(EnumChatFormatting.GOLD+"Show Configuration GUI");
configHover.add(TextFormatting.GOLD+"Show Configuration GUI");
configHover.addAll(this.fontRendererObj.listFormattedStringToWidth("It is highly recommended that you restart your game after changing anything as that prevents possible bugs occuring!", 200));
this.buttonConfig = new TexturedButton(8, this.guiLeft+138, this.guiTop+10, 197, 0, 8, 8, configHover);
this.buttonList.add(this.buttonConfig);
@@ -416,7 +417,7 @@ public void renderTooltipAndTransferButton(BookletPage from, ItemStack stack, in
list.set(k, stack.getRarity().rarityColor+(String)list.get(k));
}
else{
list.set(k, EnumChatFormatting.GRAY+(String)list.get(k));
list.set(k, TextFormatting.GRAY+(String)list.get(k));
}
}

@@ -428,7 +429,8 @@ public void renderTooltipAndTransferButton(BookletPage from, ItemStack stack, in
if(mousePressed){
BookletUtils.openIndexEntry(this, page.getChapter().getEntry(), ActuallyAdditionsAPI.bookletEntries.indexOf(page.getChapter().getEntry())/GuiBooklet.CHAPTER_BUTTONS_AMOUNT+1, true);
BookletUtils.openChapter(this, page.getChapter(), page);
Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0F));
//TODO Fix sound
//Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0F));
}
}
}