• 0

    posted a message on Custom Furnace Not showing gui and fuel slot deny to place corespodning fuel.

    This is furnace that damages item till zero....only thing needs to be registerd are tileentity and guihandler ...gui handlers deal with containers and gui.

    Posted in: Modification Development
  • 0

    posted a message on Custom Furnace Not showing gui and fuel slot deny to place corespodning fuel.

    ClientProxy


    package com.vladan899.main;

    import com.vladan899.blocks.BlockList;
    import com.vladan899.items.ItemList;

    public class ClientProxy extends ServerProxy{
    @Override
    public void RegisterRender(){
    ItemList.RegisterRender();
    BlockList.RegisterRender();
    }
    }

    ServerProxy


    package com.vladan899.main;

    public class ServerProxy {

    public void RegisterRender(){

    }
    }


    If i have any errors please tell me and i can't get to figure out itemstack.damageItem(int, entiyliving) or itemstack.apptemtitemDamage(-1,random)??

    Posted in: Modification Development
  • 0

    posted a message on Custom Furnace Not showing gui and fuel slot deny to place corespodning fuel.

    yes


    Edit: fixed For loop ...just instead of j++ was i++ i replaced i with j

    Edit2: Fixed GUI forgot to call draw function "this.drawTexturedModalRect".


    Still have issue with Fuel slot no aceppting StoneGrinder that has burning time of 200 and damage of 16

    Posted in: Modification Development
  • 0

    posted a message on Custom Furnace Not showing gui and fuel slot deny to place corespodning fuel.

    Here is stuff:

    TileEntity:


    package com.vladan899.tileentity;

    import java.util.Random;

    import com.vladan899.MachinesRecpie.SmasherRecpie;
    import com.vladan899.blocks.properties.BlockMachineSmasher;
    import com.vladan899.container.ContainerOreSmasher;
    import com.vladan899.items.ItemList;

    import net.minecraft.block.Block;
    import net.minecraft.block.BlockFurnace;
    import net.minecraft.block.material.Material;
    import net.minecraft.entity.player.EntityPlayer;
    import net.minecraft.entity.player.InventoryPlayer;
    import net.minecraft.init.Blocks;
    import net.minecraft.init.Items;
    import net.minecraft.inventory.Container;
    import net.minecraft.inventory.ContainerFurnace;
    import net.minecraft.inventory.IInventory;
    import net.minecraft.inventory.SlotFurnaceFuel;
    import net.minecraft.item.Item;
    import net.minecraft.item.ItemBlock;
    import net.minecraft.item.ItemHoe;
    import net.minecraft.item.ItemStack;
    import net.minecraft.item.ItemSword;
    import net.minecraft.item.ItemTool;
    import net.minecraft.item.crafting.FurnaceRecipes;
    import net.minecraft.nbt.NBTTagCompound;
    import net.minecraft.nbt.NBTTagList;
    import net.minecraft.tileentity.TileEntity;
    import net.minecraft.util.IChatComponent;
    import net.minecraft.util.MathHelper;
    import net.minecraftforge.fml.common.registry.GameRegistry;
    import net.minecraft.util.ChatComponentText;

    public class TileEntitySmasher extends TileEntity implements IInventory {


    private static final int[] slotsTop = new int[] {0};
    private static final int[] slotsBottom = new int[] {2, 1};
    private static final int[] slotsSides = new int[] {1};
    private ItemStack[] numberOfSlots = new ItemStack[5];

    public int timeCanGrind = 200;
    public static int currentItemGrindTime;
    public static int ticksGrindingItemSoFar;
    public static int ticksPerItem;

    private String furnaceCustomName;

    //Fuels Burning time
    public static int StoneFuelGrindeer = 200; // 1 item = 200 ticks


    public Container createContainer(InventoryPlayer playerInventory, EntityPlayer playerIn)
    {
    return new ContainerOreSmasher(playerInventory, this);
    }
    @Override
    public String getName()
    {

    return this.hasCustomName() ? this.furnaceCustomName : "oreSmasher";
    }

    public void setCustomInventoryName(String displayName)
    {
    this.furnaceCustomName = displayName;
    }

    @Override
    public boolean hasCustomName()
    {
    return this.furnaceCustomName != null && this.furnaceCustomName.length() > 0;
    }

    @Override
    public IChatComponent getDisplayName()
    {
    return new ChatComponentText(this.getName());
    }

    @Override
    public int getSizeInventory() {

    return this.numberOfSlots.length;
    }

    @Override
    public ItemStack getStackInSlot(int index) {

    return this.numberOfSlots[index];
    }

    @Override
    public ItemStack decrStackSize(int index, int count) {
    if (this.numberOfSlots[index] != null)
    {
    ItemStack itemstack;

    if (this.numberOfSlots[index].stackSize <= count)
    {
    itemstack = this.numberOfSlots[index];
    this.numberOfSlots[index] = null;
    return itemstack;
    }
    else
    {
    itemstack = this.numberOfSlots[index].splitStack(count);

    if (this.numberOfSlots[index].stackSize == 0)
    {
    this.numberOfSlots[index] = null;
    }

    return itemstack;
    }
    }
    else
    {
    return null;
    }
    }

    @Override
    public ItemStack getStackInSlotOnClosing(int index) {
    if (this.numberOfSlots[index] != null)
    {
    ItemStack itemstack = this.numberOfSlots[index];
    this.numberOfSlots[index] = null;
    return itemstack;
    }
    else
    {
    return null;
    }
    }

    @Override
    public void setInventorySlotContents(int index, ItemStack stack)
    {
    boolean flag = stack != null && stack.isItemEqual(this.numberOfSlots[index]) && ItemStack.areItemStackTagsEqual(stack, this.numberOfSlots[index]);
    this.numberOfSlots[index] = stack;

    if (stack != null && stack.stackSize > this.getInventoryStackLimit())
    {
    stack.stackSize = this.getInventoryStackLimit();
    }

    if (index == 0 && !flag)
    {
    this.ticksGrindingItemSoFar = this.TimeToSmashOneItem(stack);
    this.ticksPerItem = 0;
    this.markDirty();
    }
    }
    public int TimeToSmashOneItem(ItemStack stack)
    {
    return 200;
    }



    @Override
    public int getInventoryStackLimit() {

    return 64;
    }

    @Override
    public boolean isUseableByPlayer(EntityPlayer player) {

    return this.worldObj.getTileEntity(this.pos) != this ? false : player.getDistanceSq((double)this.pos.getX() + 0.5D, (double)this.pos.getY() + 0.5D, (double)this.pos.getZ() + 0.5D) <= 64.0D;
    }

    @Override
    public void openInventory(EntityPlayer player) {}

    @Override
    public void closeInventory(EntityPlayer player) {}

    @Override
    public boolean isItemValidForSlot(int index, ItemStack stack) {
    return index == 2 ? false : (index != 1 ? true : isItemFuel(stack) || SlotFurnaceFuel.isBucket(stack));
    }

    @Override
    public int getField(int id) {
    switch (id)
    {
    case 0:
    return this.timeCanGrind;
    case 1:
    return this.currentItemGrindTime;
    case 2:
    return this.ticksGrindingItemSoFar;
    case 3:
    return this.ticksPerItem;
    default:
    return 0;
    }
    }

    @Override
    public void setField(int id, int value)
    {
    switch (id)
    {
    case 0:
    this.timeCanGrind = value;
    break;
    case 1:
    this.currentItemGrindTime = value;
    break;
    case 2:
    this.ticksGrindingItemSoFar = value;
    break;
    case 3:
    this.ticksPerItem = value;
    break;
    }
    }


    @Override
    public int getFieldCount()
    {
    return 3;
    }

    @Override
    public void clear()
    {
    for (int i = 0; i < this.numberOfSlots.length; ++i)
    {
    this.numberOfSlots = null;
    }

    }

    public static boolean isItemFuel(ItemStack stack)
    {
    /**
    * Returns the number of ticks that the supplied fuel item will keep the furnace burning, or 0 if the item isn't
    * fuel
    */
    return getItemBurnTime(stack) > 0;
    }

    public static int getItemBurnTime(ItemStack itemStack)
    {

    if (itemStack == null)
    {
    return 0;
    }
    else
    {
    Item item = itemStack.getItem();

    if (item == ItemList.StoneGrineder) return 200;

    return GameRegistry.getFuelValue(itemStack);
    }
    }

    public void smeltItem()
    {
    if (this.canSmelt())
    {
    ItemStack itemstack = SmasherRecpie.instance().getSmeltingResult(this.numberOfSlots[0]);

    if (this.numberOfSlots[2] == null)
    {
    this.numberOfSlots[2] = itemstack.copy();
    }
    else if (this.numberOfSlots[2].getItem() == itemstack.getItem())
    {
    this.numberOfSlots[2].stackSize += itemstack.stackSize; // Forge BugFix: Results may have multiple items
    }

    if (this.numberOfSlots[0].getItem() == Item.getItemFromBlock(Blocks.sponge) && this.numberOfSlots[0].getMetadata() == 1 && this.numberOfSlots[1] != null && this.numberOfSlots[1].getItem() == Items.bucket)
    {
    this.numberOfSlots[1] = new ItemStack(Items.water_bucket);
    }

    --this.numberOfSlots[0].stackSize;

    if (this.numberOfSlots[0].stackSize <= 0)
    {
    this.numberOfSlots[0] = null;
    }
    }
    }

    private boolean canSmelt()
    {
    if (this.numberOfSlots[0] == null)
    {
    return false;
    }
    else
    {
    ItemStack itemstack = FurnaceRecipes.instance().getSmeltingResult(this.numberOfSlots[0]);
    if (itemstack == null) return false;
    if (this.numberOfSlots[2] == null) return true;
    if (!this.numberOfSlots[2].isItemEqual(itemstack)) return false;
    int result = numberOfSlots[2].stackSize + itemstack.stackSize;
    return result <= getInventoryStackLimit() && result <= this.numberOfSlots[2].getMaxStackSize(); //Forge BugFix: Make it respect stack sizes properly.
    }
    }


    public void update()
    {
    boolean flag = this.isBurning();
    boolean flag1 = false;

    if (this.isBurning())
    {
    --this.currentItemGrindTime;
    }

    if (!this.worldObj.isRemote)
    {
    if (this.currentItemGrindTime == 0 && this.canSmelt())
    {
    if (this.isBurning() && this.ticksPerItem > 0)
    {
    this.ticksGrindingItemSoFar = this.ticksPerItem = this.getItemBurnTime(this.numberOfSlots[1]);
    if (this.isBurning() )
    {
    flag1 = true;
    if(this.numberOfSlots[1] != null)
    {

    Random random = new Random();
    random.ints(1, 1);

    this.numberOfSlots[1].attemptDamageItem(1, random);

    if(this.numberOfSlots[1].getItemDamage() == 0)
    {
    this.numberOfSlots[1] = this.numberOfSlots[1].getItem().getContainerItem(this.numberOfSlots[1]);
    }
    }
    }
    }
    if(this.isBurning() && this.canSmelt())
    {
    this.ticksPerItem ++;
    if(this.ticksPerItem == this.timeCanGrind)
    {
    this.ticksPerItem = 0;
    this.smeltItem();
    flag1 = true;
    }
    }
    else
    this.ticksPerItem = 0;
    }
    if(flag1 != this.isBurning())
    {
    flag1= true;
    BlockMachineSmasher.setState(this.isBurning(), this.worldObj, this.pos);
    }
    }
    if (flag1)
    {
    this.markDirty();
    }
    }

    @Override
    public void readFromNBT(NBTTagCompound compound)
    {
    super.readFromNBT(compound);
    NBTTagList nbttaglist = compound.getTagList("Items", 10);
    numberOfSlots = new ItemStack[getSizeInventory()];

    for (int i = 0; i < nbttaglist.tagCount(); ++i)
    {
    NBTTagCompound nbtTagCompound = nbttaglist.getCompoundTagAt(i);
    byte b0 = nbtTagCompound.getByte("Slot");

    if (b0 >= 0 && b0 < numberOfSlots.length)
    {
    numberOfSlots[b0] = ItemStack.loadItemStackFromNBT(

    nbtTagCompound);
    }
    }

    timeCanGrind = compound.getShort("GrindTime");
    ticksGrindingItemSoFar = compound.getShort("CookTime");
    ticksPerItem = compound.getShort("CookTimeTotal");

    if (compound.hasKey("CustomName", 8))
    {
    furnaceCustomName = compound.getString("CustomName");
    }
    }

    @Override
    public void writeToNBT(NBTTagCompound compound)
    {
    super.writeToNBT(compound);
    compound.setShort("GrindTime", (short)timeCanGrind);
    compound.setShort("CookTime", (short)ticksGrindingItemSoFar);
    compound.setShort("CookTimeTotal", (short)ticksPerItem);
    NBTTagList nbttaglist = new NBTTagList();

    for (int i = 0; i < numberOfSlots.length; ++i)
    {
    if (numberOfSlots != null)
    {
    NBTTagCompound nbtTagCompound = new NBTTagCompound();
    nbtTagCompound.setByte("Slot", (byte)i);
    numberOfSlots.writeToNBT(nbtTagCompound);
    nbttaglist.appendTag(nbtTagCompound);
    }
    }

    compound.setTag("Items", nbttaglist);

    if (hasCustomName())
    {
    compound.setString("CustomName", furnaceCustomName);
    }
    }


    public boolean isBurning( )
    {
    return this.currentItemGrindTime > 0;
    }

    public int getCookProgressScaled(int i)
    {
    return this.currentItemGrindTime * i / this.timeCanGrind;
    }
    public int getBurnTimeRemaningScaled(int i)
    {
    if(this.ticksGrindingItemSoFar == 0)
    {
    this.ticksGrindingItemSoFar = this.timeCanGrind;
    }
    return this.currentItemGrindTime * i / this.ticksGrindingItemSoFar;
    }

    }

    Blockitself:


    Put your spoiler here.package com.vladan899.blocks.properties;

    import java.util.Random;


    import com.vladan899.blocks.BlockList;
    import com.vladan899.main.Main;
    import com.vladan899.tileentity.TileEntitySmasher;

    import net.minecraft.block.Block;
    import net.minecraft.block.BlockContainer;
    import net.minecraft.block.material.Material;
    import net.minecraft.block.properties.IProperty;
    import net.minecraft.block.properties.PropertyDirection;
    import net.minecraft.block.state.BlockState;
    import net.minecraft.block.state.IBlockState;
    import net.minecraft.entity.EntityLivingBase;
    import net.minecraft.entity.player.EntityPlayer;
    import net.minecraft.init.Blocks;
    import net.minecraft.inventory.Container;
    import net.minecraft.item.Item;
    import net.minecraft.item.ItemStack;
    import net.minecraft.tileentity.TileEntity;
    import net.minecraft.tileentity.TileEntityFurnace;
    import net.minecraft.util.BlockPos;
    import net.minecraft.util.EnumFacing;
    import net.minecraft.world.World;
    import net.minecraftforge.fml.relauncher.Side;
    import net.minecraftforge.fml.relauncher.SideOnly;

    public class BlockMachineSmasher extends BlockContainer
    {
    public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL);
    private final boolean isBurning;
    private static boolean keepInventory;

    public BlockMachineSmasher(boolean isBurning ) {
    super(Material.iron);
    this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH));
    this.isBurning = isBurning;
    }

    @Override
    public TileEntity createNewTileEntity(World worldIn, int meta)
    {
    // TODO Auto-generated method stub
    return new TileEntitySmasher();
    }

    public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ)
    {
    if (!world.isRemote)
    {
    playerIn.openGui(Main.instance, BlockList.GuiIDSmasher, world, pos.getX(), pos.getY(), pos.getZ());
    }
    return true;

    }

    public static void setState(boolean active, World worldIn, BlockPos pos)
    {
    IBlockState iblockstate = worldIn.getBlockState(pos);
    TileEntity tileentity = worldIn.getTileEntity(pos);
    keepInventory = true;

    if (active)
    {
    worldIn.setBlockState(pos, BlockList.SmasherOn.getDefaultState().withProperty(FACING, iblockstate.getValue(FACING)), 3);
    worldIn.setBlockState(pos, BlockList.SmasherOn.getDefaultState().withProperty(FACING, iblockstate.getValue(FACING)), 3);
    }
    else
    {
    worldIn.setBlockState(pos, BlockList.SmasherOff.getDefaultState().withProperty(FACING, iblockstate.getValue(FACING)), 3);
    worldIn.setBlockState(pos, BlockList.SmasherOff.getDefaultState().withProperty(FACING, iblockstate.getValue(FACING)), 3);
    }

    keepInventory = false;

    if (tileentity != null)
    {
    tileentity.validate();
    worldIn.setTileEntity(pos, tileentity);
    }
    }

    public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack)
    {
    worldIn.setBlockState(pos, state.withProperty(FACING, placer.getHorizontalFacing().getOpposite()), 2);

    if (stack.hasDisplayName())
    {
    TileEntity tileentity = worldIn.getTileEntity(pos);

    if (tileentity instanceof TileEntitySmasher)
    {
    ((TileEntitySmasher)tileentity).setCustomInventoryName(stack.getDisplayName());
    }
    }
    }

    public Item getItemDropped(IBlockState state, Random rand, int fortune)
    {
    return Item.getItemFromBlock(BlockList.SmasherOff);
    }

    public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state)
    {
    this.setDefaultFacing(worldIn, pos, state);
    }

    public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer)
    {
    return this.getDefaultState().withProperty(FACING, placer.getHorizontalFacing().getOpposite());
    }


    public boolean hasComparatorInputOverride()
    {
    return true;
    }

    public int getComparatorInputOverride(World worldIn, BlockPos pos)
    {
    return Container.calcRedstone(worldIn.getTileEntity(pos));
    }

    @SideOnly(Side.CLIENT)
    public Item getItem(World worldIn, BlockPos pos)
    {
    return Item.getItemFromBlock(BlockList.SmasherOff);
    }

    private void setDefaultFacing(World worldIn, BlockPos pos, IBlockState state)
    {
    if (!worldIn.isRemote)
    {
    Block block = worldIn.getBlockState(pos.north()).getBlock();
    Block block1 = worldIn.getBlockState(pos.south()).getBlock();
    Block block2 = worldIn.getBlockState(pos.west()).getBlock();
    Block block3 = worldIn.getBlockState(pos.east()).getBlock();
    EnumFacing enumfacing = (EnumFacing)state.getValue(FACING);

    if (enumfacing == EnumFacing.NORTH && block.isFullBlock() && !block1.isFullBlock())
    {
    enumfacing = EnumFacing.SOUTH;
    }
    else if (enumfacing == EnumFacing.SOUTH && block1.isFullBlock() && !block.isFullBlock())
    {
    enumfacing = EnumFacing.NORTH;
    }
    else if (enumfacing == EnumFacing.WEST && block2.isFullBlock() && !block3.isFullBlock())
    {
    enumfacing = EnumFacing.EAST;
    }
    else if (enumfacing == EnumFacing.EAST && block3.isFullBlock() && !block2.isFullBlock())
    {
    enumfacing = EnumFacing.WEST;
    }

    worldIn.setBlockState(pos, state.withProperty(FACING, enumfacing), 2);
    }
    }

    public int getRenderType()
    {
    return 3;
    }

    public IBlockState getStateFromMeta(int meta)
    {
    EnumFacing enumfacing = EnumFacing.getFront(meta);

    if (enumfacing.getAxis() == EnumFacing.Axis.Y)
    {
    enumfacing = EnumFacing.NORTH;
    }

    return this.getDefaultState().withProperty(FACING, enumfacing);
    }

    public int getMetaFromState(IBlockState state)
    {
    return ((EnumFacing)state.getValue(FACING)).getIndex();
    }

    protected BlockState createBlockState()
    {
    return new BlockState(this, new IProperty[] {FACING});
    }

    }

    Container:


    package com.vladan899.container;

    import com.vladan899.customTemplates.CustomUpgradeSlot;
    import com.vladan899.main.Main;
    import com.vladan899.tileentity.TileEntitySmasher;

    import net.minecraft.entity.player.EntityPlayer;
    import net.minecraft.entity.player.InventoryPlayer;
    import net.minecraft.inventory.Container;
    import net.minecraft.inventory.ICrafting;
    import net.minecraft.inventory.Slot;
    import net.minecraft.inventory.SlotFurnaceFuel;
    import net.minecraft.inventory.SlotFurnaceOutput;
    import net.minecraft.item.ItemStack;
    import net.minecraft.item.crafting.FurnaceRecipes;
    import net.minecraft.tileentity.TileEntityFurnace;
    import net.minecraft.util.ResourceLocation;

    public class ContainerOreSmasher extends Container
    {
    public static final ResourceLocation Bground = new ResourceLocation(Main.modID + ":" + "textures/gui/SmasherGUI.png");
    public TileEntitySmasher tileEntity;


    private int totalFurnaceSpeed;
    private int totalCurrentItemGrindTime;
    private int totalTicksGrindingItemSoFar;
    private int totalTicksPerItem;

    public ContainerOreSmasher(InventoryPlayer playerInventory, TileEntitySmasher SmasherInventory)
    {

    addSlotToContainer(new Slot(SmasherInventory, 0, 60, 12));
    addSlotToContainer(new SlotFurnaceFuel(SmasherInventory, 1, 60, 48));
    addSlotToContainer(new SlotFurnaceOutput(playerInventory.player, SmasherInventory, 2, 106, 30));


    //Add Upgrade Slot 2 rows , 1 slot
    /*for (int i = 0; i < 2; i++)
    {
    for(int j = 0; j < 1; i++)
    {
    addSlotToContainer(new CustomUpgradeSlot(SmasherInventory, i+j,8 + j * 18, 6+i*18));
    }
    }
    */

    //Player Inventory
    for (int i = 0; i < 3; i++)
    {
    for (int j = 0; j < 9; j++)
    {
    addSlotToContainer(new Slot(playerInventory, j+i*9+9,
    8+j*18, 84+i*18));
    }
    }
    //Player hotbar
    for (int i = 0; i < 9; ++i)
    {
    this.addSlotToContainer(new Slot(playerInventory, i, 8 + i * 18, 142));
    }
    }

    @Override
    public boolean canInteractWith(EntityPlayer playerIn)
    {
    return true;
    }

    public void detectAndSendChanges()
    {
    super.detectAndSendChanges();

    /*
    for (int i = 0; i < this.crafters.size(); ++i)

    {
    ICrafting icrafting = (ICrafting)this.crafters.get(i);

    if (this.totalFurnaceSpeed != this.tileEntity.getField(0))
    {
    icrafting.sendProgressBarUpdate(this, 0, this.tileEntity.getField(0));
    }

    if (this.totalCurrentItemGrindTime != this.tileEntity.getField(1))
    {
    icrafting.sendProgressBarUpdate(this, 1, this.tileEntity.getField(1));
    }

    if (this.totalTicksGrindingItemSoFar != this.tileEntity.getField(1))
    {
    icrafting.sendProgressBarUpdate(this, 2, this.tileEntity.getField(2));
    }

    if (this.totalTicksPerItem != this.tileEntity.getField(2))
    {
    icrafting.sendProgressBarUpdate(this, 3, this.tileEntity.getField(3));
    }


    }

    this.totalFurnaceSpeed = this.tileEntity.getField(0);
    this.totalCurrentItemGrindTime = this.tileEntity.getField(1);
    this.totalTicksGrindingItemSoFar = this.tileEntity.getField(2);
    this.totalTicksPerItem = this.tileEntity.getField(3);
    */
    }



    public void updateProgressBar(int id, int data)
    {
    this.tileEntity.setField(id, data);
    }

    public ItemStack transferStackInSlot(EntityPlayer playerIn, int index)
    {
    ItemStack itemstack = null;
    Slot slot = (Slot)this.inventorySlots.get(index);

    if (slot != null && slot.getHasStack())
    {
    ItemStack itemstack1 = slot.getStack();
    itemstack = itemstack1.copy();

    if (index == 2)
    {
    if (!this.mergeItemStack(itemstack1, 3, 39, true))
    {
    return null;
    }

    slot.onSlotChange(itemstack1, itemstack);
    }
    else if (index != 1 && index != 0)
    {
    if (FurnaceRecipes.instance().getSmeltingResult(itemstack1) != null)
    {
    if (!this.mergeItemStack(itemstack1, 0, 1, false))
    {
    return null;
    }
    }
    else if (TileEntityFurnace.isItemFuel(itemstack1))
    {
    if (!this.mergeItemStack(itemstack1, 1, 2, false))
    {
    return null;
    }
    }
    else if (index >= 3 && index < 30)
    {
    if (!this.mergeItemStack(itemstack1, 30, 39, false))
    {
    return null;
    }
    }
    else if (index >= 30 && index < 39 && !this.mergeItemStack(itemstack1, 3, 30, false))
    {
    return null;
    }
    }
    else if (!this.mergeItemStack(itemstack1, 3, 39, false))
    {
    return null;
    }

    if (itemstack1.stackSize == 0)
    {
    slot.putStack((ItemStack)null);
    }
    else
    {
    slot.onSlotChanged();
    }

    if (itemstack1.stackSize == itemstack.stackSize)
    {
    return null;
    }

    slot.onPickupFromSlot(playerIn, itemstack1);
    }
    return itemstack;
    }
    }

    GUI:


    package com.vladan899.blocks.Gui;

    import com.vladan899.container.ContainerOreSmasher;
    import com.vladan899.main.Main;
    import com.vladan899.tileentity.TileEntitySmasher;

    import net.minecraft.client.gui.inventory.GuiContainer;
    import net.minecraft.client.renderer.GlStateManager;
    import net.minecraft.entity.player.InventoryPlayer;
    import net.minecraft.inventory.Container;
    import net.minecraft.inventory.IInventory;
    import net.minecraft.util.ResourceLocation;

    public class GuiOreSmasher extends GuiContainer
    {

    private static final ResourceLocation furnaceGuiTextures = new ResourceLocation(Main.modID + ":" + "textures/gui/SmasherGUI.png");

    private final InventoryPlayer playerInventory;
    private TileEntitySmasher tileEntity;

    public GuiOreSmasher(InventoryPlayer inventory, TileEntitySmasher entity)
    {
    super(new ContainerOreSmasher(inventory,entity));
    playerInventory = inventory;
    tileEntity = entity;

    }

    protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
    {
    String s = this.tileEntity.getDisplayName().getUnformattedText();
    this.fontRendererObj.drawString(s, this.xSize / 2 - this.fontRendererObj.getStringWidth(s) / 2, 6, 4210752);
    this.fontRendererObj.drawString(this.playerInventory.getDisplayName().getUnformattedText(), 8, this.ySize - 96 + 2, 4210752);
    }

    @Override
    protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY)
    {
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    mc.getTextureManager().bindTexture(furnaceGuiTextures);

    }

    }

    Posted in: Modification Development
  • 0

    posted a message on Flower is not rendered when placed
    Quote from Neuroticcheeze»
    Ohh how I HATE this God forsaken json system..


    but,

    You used "Blue_Flower" instead of "Flower_Blue"

    Blue_Flower is name of .png File...it references it as texture

    Posted in: Modification Development
  • 0

    posted a message on Flower is not rendered when placed
    In console it gives me this error : [13:12:16] [Client thread/ERROR] [FML]: Model definition for location expansion:Blue_Flower#type=dandelion not found



    BlockList : http://pastebin.com/7WHpCxYT
    BlockBlueFlower : http://pastebin.com/Ai4P8H1U

    Main : http://pastebin.com/yHD9PFw6

    Here is BlockState for Flower_Blue.json : http://pastebin.com/045Sw1q0
    Here is Block Flower_Blue.json : http://pastebin.com/EiVBMSUy



    I can't find Type Dandelion.json or some method that i am missing......and i can't find it
    Any help would be appreciate!
    Posted in: Modification Development
  • 0

    posted a message on [Mod Request] RCV (Remote Controlled Vehicle)
    I wanna create cars...not flying ..with more features
    Posted in: Requests / Ideas For Mods
  • 0

    posted a message on How to spawn Entity from item...and how to turn that entity back into item entity.
    Basacily i wanna have item that can spawn mob...mob is passive...just an entity. Blank for now, and when i right click with my other item to revert back to original item.

    I hope this little explanation helps
    Posted in: Modification Development
  • 0

    posted a message on [Modder needed] RCV (Remote Controlled Vehicle)
    Contains of two items RCV and entity than can be controlled by RCV that has GUI witch has camera implemented into it.
    Basically RCV have gui that has camera of Entity like in spectator mod in 1.8.

    Thing is this "entity" is 1 block high and can be moved with RCV without moving player cuz player will be able to see on RCV what he sees.



    It will display texture from entity to CRV GUI as it moves ....if possible in real time
    Posted in: Modification Development
  • 0

    posted a message on [Mod Request] RCV (Remote Controlled Vehicle)
    bump
    Posted in: Requests / Ideas For Mods
  • 0

    posted a message on [Mod Request] RCV (Remote Controlled Vehicle)
    Contains of two items RCV and entity than can be controlled by CRV that has GUI witch has camera implemented into it.
    Basically RCV have gui that has camera of Entity like in spectator mod in 1.8.

    Thing is this "entity" is 1 block high and can be moved with RCV without moving player cuz player will be able to see on RCV what he sees.



    It will display texture from entity to CRV GUI as it moves ....if possible in real time
    Posted in: Requests / Ideas For Mods
  • 0

    posted a message on .setTexture ERRORPLEASE HELP!!!
    Here are tutorials for 1.8 https://www.youtube.com/playlist?list=PL9OcRPNj4hElw8n5dEEjyYuwx3Tw1bw7A Episode 3 and 4

    3 for item 4 for blocks...
    Posted in: Modification Development
  • 0

    posted a message on 1.8 Custom Furance [Need Help]
    Okie i'lll try to use that method
    player.openGui(args)? how to call that and where?
    Posted in: Modification Development
  • 0

    posted a message on Furnace tileentity, gui and container
    this is 1.8 lots have changed since 1.6.4 https://github.com/Vladan899/Expansion
    Check github for all files and if you wanna learn and help help would be gladly appriciated
    Posted in: Modification Development
  • 0

    posted a message on 1.8 Custom Furance [Need Help]
    https://github.com/Vladan899/Expansion
    Here is call code smart ass and try it your own code and see it yourself. Cuz i can't keep explaining myself that your code dose not work...
    Make github account fork ...download source and make changes...cuz i can't help you cuz you are one that dose not understand
    Posted in: Modification Development
  • To post a comment, please .