• 0

    posted a message on OptiFine HD (FPS Boost, Dynamic Lights, Shaders and much more)

    Chrome has done the same. Likely due to the amount of malicious ads hosted there. Generally you shouldn't use websites that use Adfly as it's nothing more than a service which spreads malware in exchange for ad revenue.


    I'd highly recommend moving Optifine's downloads to Curse or Github. I've always used the mirror so that I can avoid Adfly and I can only assume everyone else does as well. Using the Adfly links never actually provides a download of Optifine anyway. It just downloads some shady installer.

    Posted in: Minecraft Mods
  • 0

    posted a message on Mekanism v9.4.0 - Industrial Turbines, Thermoelectric Boilers, Fusion Reactors!
    Quote from spannerman79»
    Don't use other peoples modpacks - make your own. Most if not all modpacks are designed and setup in particular ways. Take for example Infinity Evolved Expert. You can't just add random mods in and expect those mods to work.

    That simply isn't true. The mods will work just fine unless some mod purposefully forces the game to crash upon loading a specific mod (which is a major no-no [I'm looking at you Gregtech]) You can add any mod to any pack and it will work, however gameplay may be affected by changes in recipes, balance, etc. The only exception to this is mods that cause some sort of conflict, though that's a very rare case due to the removal of item and block ID conflicts.

    The only reason Mekanism would say that your are missing Mekanism is if you are trying to run Mekanism Generators and/ore Mekanism Tools without the main Mekanism core. Generators and Tools require the base mod to be installed as well. You should probably be using the Curse launcher to download mods if you aren't sure how compatibility and dependencies work as Curse (or Twitch as it now seems to be called) will generally handle things like that for you. For instance if you try to install Mekanism Tools it will automatically download Mekanism as well since it's required.
    Posted in: Minecraft Mods
  • 0

    posted a message on Carpenter's Blocks
    Quote from Anthony_Kane»

    1.7.10 was just the opposite. Everything seemed so refined and fleshed out.


    What, do you think that all mods for 1.7.10 just worked right off the bat? The transition from 1.6 was a huge mess and it took several months for 1.7 forge to even get created. Every major Minecraft version is going to cause a big change, especially moving forward from 1.7.10 because they basically rewrote the entire game for 1.8+ with the new model files, tile entity capabilities, and a whole lot of other things that don't come to mind at the moment. Everything that you mentioned is the fault of the mod author, not Forge or Minecraft in general.
    Posted in: Minecraft Mods
  • 0

    posted a message on [FORGE] Quadrum v0.8.1 for MC 1.12 - Simplified block/item addition for the average user

    A way to add a different ore dictionary value per block variant would be nice. I can't figure out if that's possible yet since the documentation for things with variants is currently a wee bit lacking in clarity (well, to be honest all of the documentation is a bit vague.)

    Posted in: Minecraft Mods
  • 0

    posted a message on Carpenter's Blocks

    DEV versions are for use by developers. Download the STABLE version unless you're using the mod in a developer environment.

    Posted in: Minecraft Mods
  • 0

    posted a message on Hoppers not respecting "canExtractItem()" when pulling items from above Tile Entity

    I see. That makes sense. Anyway thanks to Choonster's information and generous access to his source code I was able to get an understanding of the new Capabilities system and solve my issue.


    If anyone has a similar issue simply make sure that you are using the capability system and in the hasCapability() method of your Tile Entity return false if the direction is EnumFacing.DOWN. Higher up in the Hopper's update method(s) it makes a call to this. This happens in TileEntityHopper.class around line 384.

    Posted in: Modification Development
  • 0

    posted a message on How should I start buying a minecraft server?

    Well, if you have a decent spare PC you should host the server yourself. Minecraft servers are very easy to set up these days. If that's out of the option allow me to bring a few things to light for you. While I can't answer your first question directly I still have somethings to share.


    1. Lag is caused by several different things. The main reason a server would be laggy for any player is a PING. Ping is essentially the time it takes for information from the server to be sent to the client and vise versa. Distance is the main cause of a high ping. If your friends are on the other side of the planet no matter who hosts your server there will be a noticable delay for them regardless of how well the server is performing. Another cause of lag is too much going on for the server to keep up with. This is easily fixed by allowing the server to access more RAM. You'll want at least 2GB of RAM for your server to preform smoothly. Personally I usually run a server with 8GB but that's generally extreme overkill unless it's heavily modded or there is about a hundred people online. Too much RAM can also be an issue for reasons not worth going into.


    2. All server hosts should allow you access to every aspect of your server including each and every file and folder. You should be able to add plugins, maps, etc whenever you please via a File Transfer Protocol. Even the lowest quality of server hosts allow you to edit such files as it would be pointless if you couldn't customize your own server.


    3. Server hosting can be quite expensive and I don't think it's personally worth investing a lot of time and money if you've got so few people playing. If you want to invest your money well I recommend buying a cheap desktop PC to use as your own server. For around $400 you could get a pretty beefy PC. It's more expensive, but you get a brand new computer out of it. It makes a bit more sense because a server could easily cost you $100 a year for just one thing and a PC will last for a decade.


    4. Realms. You should look into Minecraft Realms and see if that fits your needs. I don't know too much about it but it sounds like it might be all you need.

    Posted in: Discussion
  • 0

    posted a message on Hoppers not respecting "canExtractItem()" when pulling items from above Tile Entity

    Thank you for your reply! I will see what I can do with this information. It should be enough to verify if the aforementioned methods are simply being ignored as a result of this depreciation or other such changes.


    I am curious why IInventory and ISidedInventory works fine for vanilla classes, but not for modded classes. It's rather odd, don't you think?

    Posted in: Modification Development
  • 0

    posted a message on Nether Fortress with ZERO loot

    That's the nature of pseudo-randomly generated structures. Every so often you'll get a seed doesn't produce very interesting results. Statistically every world has the same percent chance of generating a boring fortress with no loot. Your world just happened to put one close to spawn (or wherever you happened to be at the time). The next fortress you find could have more loot than you thought possible!

    Posted in: Survival Mode
  • 0

    posted a message on Hoppers not respecting "canExtractItem()" when pulling items from above Tile Entity

    EDIT: Oh my the BBCode on this site is VERY buggy isn't it? :( Pardon the messy formatting. I'll try to sort that out.

    When a (vanilla) hopper tile entity attempts to pull an item from an inventory located above the hopper this method is called:

    private static boolean pullItemFromSlot(IHopper hopper, IInventory inventoryIn, int index, EnumFacing direction)
        {
            ItemStack itemstack = inventoryIn.getStackInSlot(index);
    
            if (itemstack != null && canExtractItemFromSlot(inventoryIn, itemstack, index, direction))
            {
                ItemStack itemstack1 = itemstack.copy();
                ItemStack itemstack2 = putStackInInventoryAllSlots(hopper, inventoryIn.decrStackSize(index, 1), (EnumFacing)null);
    
                if (itemstack2 == null || itemstack2.stackSize == 0)
                {
                    inventoryIn.markDirty();
                    return true;
                }
    
                inventoryIn.setInventorySlotContents(index, itemstack1);
            }
    
            return false;
        }


    As you can see in order for something to be extracted this line must return TRUE.

     if (itemstack != null && canExtractItemFromSlot(inventoryIn, itemstack, index, direction))

    Assuming that the item stack isn't null the if statement will require the second condition to be true as well, obviously. Now, canExtractItemFromSlot calls another method in the hopper tile entity class which is as follows:

    private static boolean canExtractItemFromSlot(IInventory inventoryIn, ItemStack stack, int index, EnumFacing side)
    {
     return !(inventoryIn instanceof ISidedInventory) || ((ISidedInventory)inventoryIn).canExtractItem(index, stack, side);
    }

    In order for this to return true the inventory must either NOT be an instance of ISidedInventory OR be an instance of ISidedInventory and return true upon calling "canExtractItem()." In my ISidedInventory I have the following method:

    @Override
    	public boolean canExtractItem(int index, ItemStack stack, EnumFacing direction) {return false;}




    Despite returning false items are still pulled out of the inventory. I can't figure out how this is possible. For some reason the Hopper is never even calling the "canExtractItem()" method in the ISidedInventory despite clearly requiring it. I've tested this using System.out.println() in the canExtractItem method and nothing ever gets printed, which suggests that it is somehow being completely ignored and simply returns true no matter what. Here is the rest of my work plus the vanilla hopper tile entity class for reference:

    Hopper:


    package net.minecraft.tileentity;
    
    import java.util.List;
    import net.minecraft.block.Block;
    import net.minecraft.block.BlockChest;
    import net.minecraft.block.BlockHopper;
    import net.minecraft.entity.Entity;
    import net.minecraft.entity.item.EntityItem;
    import net.minecraft.entity.player.EntityPlayer;
    import net.minecraft.entity.player.InventoryPlayer;
    import net.minecraft.inventory.Container;
    import net.minecraft.inventory.ContainerHopper;
    import net.minecraft.inventory.IInventory;
    import net.minecraft.inventory.ISidedInventory;
    import net.minecraft.inventory.ItemStackHelper;
    import net.minecraft.item.ItemStack;
    import net.minecraft.nbt.NBTTagCompound;
    import net.minecraft.nbt.NBTTagList;
    import net.minecraft.util.EntitySelectors;
    import net.minecraft.util.EnumFacing;
    import net.minecraft.util.ITickable;
    import net.minecraft.util.math.AxisAlignedBB;
    import net.minecraft.util.math.BlockPos;
    import net.minecraft.util.math.MathHelper;
    import net.minecraft.world.World;
    
    public class TileEntityHopper extends TileEntityLockableLoot implements IHopper, ITickable
    {
        private ItemStack[] inventory = new ItemStack[5];
        private String customName;
        private int transferCooldown = -1;
    
        public void readFromNBT(NBTTagCompound compound)
        {
            super.readFromNBT(compound);
            this.inventory = new ItemStack[this.getSizeInventory()];
    
            if (compound.hasKey("CustomName", 8))
            {
                this.customName = compound.getString("CustomName");
            }
    
            this.transferCooldown = compound.getInteger("TransferCooldown");
    
            if (!this.checkLootAndRead(compound))
            {
                NBTTagList nbttaglist = compound.getTagList("Items", 10);
    
                for (int i = 0; i < nbttaglist.tagCount(); ++i)
                {
                    NBTTagCompound nbttagcompound = nbttaglist.getCompoundTagAt(i);
                    int j = nbttagcompound.getByte("Slot");
    
                    if (j >= 0 && j < this.inventory.length)
                    {
                        this.inventory[j] = ItemStack.loadItemStackFromNBT(nbttagcompound);
                    }
                }
            }
        }
    
        public void writeToNBT(NBTTagCompound compound)
        {
            super.writeToNBT(compound);
    
            if (!this.checkLootAndWrite(compound))
            {
                NBTTagList nbttaglist = new NBTTagList();
    
                for (int i = 0; i < this.inventory.length; ++i)
                {
                    if (this.inventory[i] != null)
                    {
                        NBTTagCompound nbttagcompound = new NBTTagCompound();
                        nbttagcompound.setByte("Slot", (byte)i);
                        this.inventory[i].writeToNBT(nbttagcompound);
                        nbttaglist.appendTag(nbttagcompound);
                    }
                }
    
                compound.setTag("Items", nbttaglist);
            }
    
            compound.setInteger("TransferCooldown", this.transferCooldown);
    
            if (this.hasCustomName())
            {
                compound.setString("CustomName", this.customName);
            }
        }
    
        /**
         * Returns the number of slots in the inventory.
         */
        public int getSizeInventory()
        {
            return this.inventory.length;
        }
    
        /**
         * Returns the stack in the given slot.
         */
        public ItemStack getStackInSlot(int index)
        {
            this.fillWithLoot((EntityPlayer)null);
            return this.inventory[index];
        }
    
        /**
         * Removes up to a specified number of items from an inventory slot and returns them in a new stack.
         */
        public ItemStack decrStackSize(int index, int count)
        {
            this.fillWithLoot((EntityPlayer)null);
            return ItemStackHelper.func_188382_a(this.inventory, index, count);
        }
    
        /**
         * Removes a stack from the given slot and returns it.
         */
        public ItemStack removeStackFromSlot(int index)
        {
            this.fillWithLoot((EntityPlayer)null);
            return ItemStackHelper.func_188383_a(this.inventory, index);
        }
    
        /**
         * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections).
         */
        public void setInventorySlotContents(int index, ItemStack stack)
        {
            this.fillWithLoot((EntityPlayer)null);
            this.inventory[index] = stack;
    
            if (stack != null && stack.stackSize > this.getInventoryStackLimit())
            {
                stack.stackSize = this.getInventoryStackLimit();
            }
        }
    
        /**
         * Get the name of this object. For players this returns their username
         */
        public String getName()
        {
            return this.hasCustomName() ? this.customName : "container.hopper";
        }
    
        /**
         * Returns true if this thing is named
         */
        public boolean hasCustomName()
        {
            return this.customName != null && !this.customName.isEmpty();
        }
    
        public void setCustomName(String customNameIn)
        {
            this.customName = customNameIn;
        }
    
        /**
         * Returns the maximum stack size for a inventory slot. Seems to always be 64, possibly will be extended.
         */
        public int getInventoryStackLimit()
        {
            return 64;
        }
    
        /**
         * Do not make give this method the name canInteractWith because it clashes with Container
         */
        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;
        }
    
        public void openInventory(EntityPlayer player)
        {
        }
    
        public void closeInventory(EntityPlayer player)
        {
        }
    
        /**
         * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot.
         */
        public boolean isItemValidForSlot(int index, ItemStack stack)
        {
            return true;
        }
    
        /**
         * Like the old updateEntity(), except more generic.
         */
        public void update()
        {
            if (this.worldObj != null && !this.worldObj.isRemote)
            {
                --this.transferCooldown;
    
                if (!this.isOnTransferCooldown())
                {
                    this.setTransferCooldown(0);
                    this.updateHopper();
                }
            }
        }
    
        public boolean updateHopper()
        {
            if (this.worldObj != null && !this.worldObj.isRemote)
            {
                if (!this.isOnTransferCooldown() && BlockHopper.isEnabled(this.getBlockMetadata()))
                {
                    boolean flag = false;
    
                    if (!this.isEmpty())
                    {
                        flag = this.transferItemsOut();
                    }
    
                    if (!this.isFull())
                    {
                        flag = captureDroppedItems(this) || flag;
                    }
    
                    if (flag)
                    {
                        this.setTransferCooldown(8);
                        this.markDirty();
                        return true;
                    }
                }
    
                return false;
            }
            else
            {
                return false;
            }
        }
    
        private boolean isEmpty()
        {
            for (ItemStack itemstack : this.inventory)
            {
                if (itemstack != null)
                {
                    return false;
                }
            }
    
            return true;
        }
    
        private boolean isFull()
        {
            for (ItemStack itemstack : this.inventory)
            {
                if (itemstack == null || itemstack.stackSize != itemstack.getMaxStackSize())
                {
                    return false;
                }
            }
    
            return true;
        }
    
        private boolean transferItemsOut()
        {
            if (net.minecraftforge.items.VanillaInventoryCodeHooks.insertHook(this)) { return true; }
            IInventory iinventory = this.getInventoryForHopperTransfer();
    
            if (iinventory == null)
            {
                return false;
            }
            else
            {
                EnumFacing enumfacing = BlockHopper.getFacing(this.getBlockMetadata()).getOpposite();
    
                if (this.isInventoryFull(iinventory, enumfacing))
                {
                    return false;
                }
                else
                {
                    for (int i = 0; i < this.getSizeInventory(); ++i)
                    {
                        if (this.getStackInSlot(i) != null)
                        {
                            ItemStack itemstack = this.getStackInSlot(i).copy();
                            ItemStack itemstack1 = putStackInInventoryAllSlots(iinventory, this.decrStackSize(i, 1), enumfacing);
    
                            if (itemstack1 == null || itemstack1.stackSize == 0)
                            {
                                iinventory.markDirty();
                                return true;
                            }
    
                            this.setInventorySlotContents(i, itemstack);
                        }
                    }
    
                    return false;
                }
            }
        }
    
        /**
         * Returns false if the inventory has any room to place items in
         */
        private boolean isInventoryFull(IInventory inventoryIn, EnumFacing side)
        {
            if (inventoryIn instanceof ISidedInventory)
            {
                ISidedInventory isidedinventory = (ISidedInventory)inventoryIn;
                int[] aint = isidedinventory.getSlotsForFace(side);
    
                for (int k = 0; k < aint.length; ++k)
                {
                    ItemStack itemstack1 = isidedinventory.getStackInSlot(aint[k]);
    
                    if (itemstack1 == null || itemstack1.stackSize != itemstack1.getMaxStackSize())
                    {
                        return false;
                    }
                }
            }
            else
            {
                int i = inventoryIn.getSizeInventory();
    
                for (int j = 0; j < i; ++j)
                {
                    ItemStack itemstack = inventoryIn.getStackInSlot(j);
    
                    if (itemstack == null || itemstack.stackSize != itemstack.getMaxStackSize())
                    {
                        return false;
                    }
                }
            }
    
            return true;
        }
    
        /**
         * Returns false if the specified IInventory contains any items
         */
        private static boolean isInventoryEmpty(IInventory inventoryIn, EnumFacing side)
        {
            if (inventoryIn instanceof ISidedInventory)
            {
                ISidedInventory isidedinventory = (ISidedInventory)inventoryIn;
                int[] aint = isidedinventory.getSlotsForFace(side);
    
                for (int i = 0; i < aint.length; ++i)
                {
                    if (isidedinventory.getStackInSlot(aint[i]) != null)
                    {
                        return false;
                    }
                }
            }
            else
            {
                int j = inventoryIn.getSizeInventory();
    
                for (int k = 0; k < j; ++k)
                {
                    if (inventoryIn.getStackInSlot(k) != null)
                    {
                        return false;
                    }
                }
            }
    
            return true;
        }
    
        public static boolean captureDroppedItems(IHopper p_145891_0_)
        {
            if (net.minecraftforge.items.VanillaInventoryCodeHooks.extractHook(p_145891_0_)) { return true; }
            IInventory iinventory = getHopperInventory(p_145891_0_);
    
            if (iinventory != null)
            {
                EnumFacing enumfacing = EnumFacing.DOWN;
    
                if (isInventoryEmpty(iinventory, enumfacing))
                {
                    return false;
                }
    
                if (iinventory instanceof ISidedInventory)
                {
                    ISidedInventory isidedinventory = (ISidedInventory)iinventory;
                    int[] aint = isidedinventory.getSlotsForFace(enumfacing);
    
                    for (int i = 0; i < aint.length; ++i)
                    {
                        if (pullItemFromSlot(p_145891_0_, iinventory, aint[i], enumfacing))
                        {
                            return true;
                        }
                    }
                }
                else
                {
                    int j = iinventory.getSizeInventory();
    
                    for (int k = 0; k < j; ++k)
                    {
                        if (pullItemFromSlot(p_145891_0_, iinventory, k, enumfacing))
                        {
                            return true;
                        }
                    }
                }
            }
            else
            {
                for (EntityItem entityitem : getCaptureItems(p_145891_0_.getWorld(), p_145891_0_.getXPos(), p_145891_0_.getYPos(), p_145891_0_.getZPos()))
                {
                    if (putDropInInventoryAllSlots(p_145891_0_, entityitem))
                    {
                        return true;
                    }
                }
            }
    
            return false;
        }
    
        /**
         * Pulls from the specified slot in the inventory and places in any available slot in the hopper. Returns true if
         * the entire stack was moved
         */
        private static boolean pullItemFromSlot(IHopper hopper, IInventory inventoryIn, int index, EnumFacing direction)
        {
            ItemStack itemstack = inventoryIn.getStackInSlot(index);
    
            if (itemstack != null && canExtractItemFromSlot(inventoryIn, itemstack, index, direction))
            {
                ItemStack itemstack1 = itemstack.copy();
                ItemStack itemstack2 = putStackInInventoryAllSlots(hopper, inventoryIn.decrStackSize(index, 1), (EnumFacing)null);
    
                if (itemstack2 == null || itemstack2.stackSize == 0)
                {
                    inventoryIn.markDirty();
                    return true;
                }
    
                inventoryIn.setInventorySlotContents(index, itemstack1);
            }
    
            return false;
        }
    
        /**
         * Attempts to place the passed EntityItem's stack into the inventory using as many slots as possible. Returns false
         * if the stackSize of the drop was not depleted.
         */
        public static boolean putDropInInventoryAllSlots(IInventory p_145898_0_, EntityItem itemIn)
        {
            boolean flag = false;
    
            if (itemIn == null)
            {
                return false;
            }
            else
            {
                ItemStack itemstack = itemIn.getEntityItem().copy();
                ItemStack itemstack1 = putStackInInventoryAllSlots(p_145898_0_, itemstack, (EnumFacing)null);
    
                if (itemstack1 != null && itemstack1.stackSize != 0)
                {
                    itemIn.setEntityItemStack(itemstack1);
                }
                else
                {
                    flag = true;
                    itemIn.setDead();
                }
    
                return flag;
            }
        }
    
        /**
         * Attempts to place the passed stack in the inventory, using as many slots as required. Returns leftover items
         */
        public static ItemStack putStackInInventoryAllSlots(IInventory inventoryIn, ItemStack stack, EnumFacing side)
        {
            if (inventoryIn instanceof ISidedInventory && side != null)
            {
                ISidedInventory isidedinventory = (ISidedInventory)inventoryIn;
                int[] aint = isidedinventory.getSlotsForFace(side);
    
                for (int k = 0; k < aint.length && stack != null && stack.stackSize > 0; ++k)
                {
                    stack = insertStack(inventoryIn, stack, aint[k], side);
                }
            }
            else
            {
                int i = inventoryIn.getSizeInventory();
    
                for (int j = 0; j < i && stack != null && stack.stackSize > 0; ++j)
                {
                    stack = insertStack(inventoryIn, stack, j, side);
                }
            }
    
            if (stack != null && stack.stackSize == 0)
            {
                stack = null;
            }
    
            return stack;
        }
    
        /**
         * Can this hopper insert the specified item from the specified slot on the specified side?
         */
        private static boolean canInsertItemInSlot(IInventory inventoryIn, ItemStack stack, int index, EnumFacing side)
        {
            return !inventoryIn.isItemValidForSlot(index, stack) ? false : !(inventoryIn instanceof ISidedInventory) || ((ISidedInventory)inventoryIn).canInsertItem(index, stack, side);
        }
    
        /**
         * Can this hopper extract the specified item from the specified slot on the specified side?
         */
        private static boolean canExtractItemFromSlot(IInventory inventoryIn, ItemStack stack, int index, EnumFacing side)
        {
            return !(inventoryIn instanceof ISidedInventory) || ((ISidedInventory)inventoryIn).canExtractItem(index, stack, side);
        }
    
        /**
         * Insert the specified stack to the specified inventory and return any leftover items
         */
        private static ItemStack insertStack(IInventory inventoryIn, ItemStack stack, int index, EnumFacing side)
        {
            ItemStack itemstack = inventoryIn.getStackInSlot(index);
    
            if (canInsertItemInSlot(inventoryIn, stack, index, side))
            {
                boolean flag = false;
    
                if (itemstack == null)
                {
                    //Forge: BUGFIX: Again, make things respect max stack sizes.
                    int max = Math.min(stack.getMaxStackSize(), inventoryIn.getInventoryStackLimit());
                    if (max >= stack.stackSize)
                    {
                    inventoryIn.setInventorySlotContents(index, stack);
                    stack = null;
                    }
                    else
                    {
                        inventoryIn.setInventorySlotContents(index, stack.splitStack(max));
                    }
                    flag = true;
                }
                else if (canCombine(itemstack, stack))
                {
                    //Forge: BUGFIX: Again, make things respect max stack sizes.
                    int max = Math.min(stack.getMaxStackSize(), inventoryIn.getInventoryStackLimit());
                    if (max > itemstack.stackSize)
                    {
                    int i = max - itemstack.stackSize;
                    int j = Math.min(stack.stackSize, i);
                    stack.stackSize -= j;
                    itemstack.stackSize += j;
                    flag = j > 0;
                    }
                }
    
                if (flag)
                {
                    if (inventoryIn instanceof TileEntityHopper)
                    {
                        TileEntityHopper tileentityhopper = (TileEntityHopper)inventoryIn;
    
                        if (tileentityhopper.mayTransfer())
                        {
                            tileentityhopper.setTransferCooldown(8);
                        }
    
                        inventoryIn.markDirty();
                    }
    
                    inventoryIn.markDirty();
                }
            }
    
            return stack;
        }
    
        /**
         * Returns the IInventory that this hopper is pointing into
         */
        private IInventory getInventoryForHopperTransfer()
        {
            EnumFacing enumfacing = BlockHopper.getFacing(this.getBlockMetadata());
            /**
             * Returns the IInventory (if applicable) of the TileEntity at the specified position
             */
            return getInventoryAtPosition(this.getWorld(), this.getXPos() + (double)enumfacing.getFrontOffsetX(), this.getYPos() + (double)enumfacing.getFrontOffsetY(), this.getZPos() + (double)enumfacing.getFrontOffsetZ());
        }
    
        /**
         * Returns the IInventory for the specified hopper
         */
        public static IInventory getHopperInventory(IHopper hopper)
        {
            /**
             * Returns the IInventory (if applicable) of the TileEntity at the specified position
             */
            return getInventoryAtPosition(hopper.getWorld(), hopper.getXPos(), hopper.getYPos() + 1.0D, hopper.getZPos());
        }
    
        public static List getCaptureItems(World worldIn, double p_184292_1_, double p_184292_3_, double p_184292_5_)
        {
            return worldIn.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(p_184292_1_ - 0.5D, p_184292_3_, p_184292_5_ - 0.5D, p_184292_1_ + 0.5D, p_184292_3_ + 1.5D, p_184292_5_ + 0.5D), EntitySelectors.IS_ALIVE);
        }
    
        /**
         * Returns the IInventory (if applicable) of the TileEntity at the specified position
         */
        public static IInventory getInventoryAtPosition(World worldIn, double x, double y, double z)
        {
            IInventory iinventory = null;
            int i = MathHelper.floor_double(x);
            int j = MathHelper.floor_double(y);
            int k = MathHelper.floor_double(z);
            BlockPos blockpos = new BlockPos(i, j, k);
            Block block = worldIn.getBlockState(blockpos).getBlock();
    
            if (block.hasTileEntity())
            {
                TileEntity tileentity = worldIn.getTileEntity(blockpos);
    
                if (tileentity instanceof IInventory)
                {
                    iinventory = (IInventory)tileentity;
    
                    if (iinventory instanceof TileEntityChest && block instanceof BlockChest)
                    {
                        iinventory = ((BlockChest)block).getLockableContainer(worldIn, blockpos);
                    }
                }
            }
    
            if (iinventory == null)
            {
                List list = worldIn.getEntitiesInAABBexcluding((Entity)null, new AxisAlignedBB(x - 0.5D, y - 0.5D, z - 0.5D, x + 0.5D, y + 0.5D, z + 0.5D), EntitySelectors.HAS_INVENTORY);
    
                if (!list.isEmpty())
                {
                    iinventory = (IInventory)list.get(worldIn.rand.nextInt(list.size()));
                }
            }
    
            return iinventory;
        }
    
        private static boolean canCombine(ItemStack stack1, ItemStack stack2)
        {
            return stack1.getItem() != stack2.getItem() ? false : (stack1.getMetadata() != stack2.getMetadata() ? false : (stack1.stackSize > stack1.getMaxStackSize() ? false : ItemStack.areItemStackTagsEqual(stack1, stack2)));
        }
    
        /**
         * Gets the world X position for this hopper entity.
         */
        public double getXPos()
        {
            return (double)this.pos.getX() + 0.5D;
        }
    
        /**
         * Gets the world Y position for this hopper entity.
         */
        public double getYPos()
        {
            return (double)this.pos.getY() + 0.5D;
        }
    
        /**
         * Gets the world Z position for this hopper entity.
         */
        public double getZPos()
        {
            return (double)this.pos.getZ() + 0.5D;
        }
    
        public void setTransferCooldown(int ticks)
        {
            this.transferCooldown = ticks;
        }
    
        public boolean isOnTransferCooldown()
        {
            return this.transferCooldown > 0;
        }
    
        public boolean mayTransfer()
        {
            return this.transferCooldown <= 1;
        }
    
        public String getGuiID()
        {
            return "minecraft:hopper";
        }
    
        public Container createContainer(InventoryPlayer playerInventory, EntityPlayer playerIn)
        {
            this.fillWithLoot(playerIn);
            return new ContainerHopper(playerInventory, this, playerIn);
        }
    
        public int getField(int id)
        {
            return 0;
        }
    
        public void setField(int id, int value)
        {
        }
    
        public int getFieldCount()
        {
            return 0;
        }
    
        public void clear()
        {
            this.fillWithLoot((EntityPlayer)null);
    
            for (int i = 0; i < this.inventory.length; ++i)
            {
                this.inventory[i] = null;
            }
        }
    
    
        protected net.minecraftforge.items.IItemHandler createUnSidedHandler()
        {
            return new net.minecraftforge.items.VanillaHopperItemHandler(this);
        }
    }

    My ISidedInventory tile entity:

     package net.levelonegaming.resrclib.TileEntities;
    
    import net.levelonegaming.resrclib.Containers.ContainerStoneCraftingTable;
    import net.minecraft.entity.player.EntityPlayer;
    import net.minecraft.entity.player.InventoryPlayer;
    import net.minecraft.inventory.Container;
    import net.minecraft.inventory.ISidedInventory;
    import net.minecraft.inventory.ItemStackHelper;
    import net.minecraft.item.ItemStack;
    import net.minecraft.nbt.NBTTagCompound;
    import net.minecraft.nbt.NBTTagList;
    import net.minecraft.tileentity.TileEntityLockable;
    import net.minecraft.util.EnumFacing;
    
    public class TileEntityStoneCraftingTable extends TileEntityLockable implements ISidedInventory
    {
     /*
     public TileEntityStoneCraftingTable()
     {
     super();
     this.inventory = new ItemStack[9];
     }
     
     @Override
     public Container createContainer(InventoryPlayer playerInventory, EntityPlayer playerIn) {return new ContainerStoneCraftingTable(playerInventory, this);}
    */
     protected ItemStack[] inventory = new ItemStack[9];
     protected String guiID;
     protected String defaultName;
     protected String customName;
     
     @Override
     public Container createContainer(InventoryPlayer playerInventory, EntityPlayer playerIn) {return new ContainerStoneCraftingTable(playerInventory, this);}
    
     @Override
     public String getGuiID() {return guiID;}
     
     @Override
     public String getName() {return this.hasCustomName() ? this.customName : this.defaultName;}
    
     @Override
     public boolean hasCustomName() {return this.customName != null && !this.customName.isEmpty();}
    
     @Override
     public int getSizeInventory() {return inventory.length;}
    
     @Override
     public ItemStack getStackInSlot(int index) {return inventory[index];}
    
     @Override
     public ItemStack decrStackSize(int index, int count) {ItemStack itemstack = ItemStackHelper.func_188382_a(this.inventory, index, count); if (itemstack != null) {this.markDirty();} return itemstack;}
     
     @Override
     public ItemStack removeStackFromSlot(int index) {return ItemStackHelper.func_188383_a(this.inventory, index);}
    
     @Override
     public void setInventorySlotContents(int index, ItemStack stack) {this.inventory[index] = stack; if (stack != null && stack.stackSize > this.getInventoryStackLimit()) {stack.stackSize = this.getInventoryStackLimit();} this.markDirty();}
    
     @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 false;}
    
     @Override
     public int getField(int id) {return 0;}
    
     @Override
     public void setField(int id, int value) {}
    
     @Override
     public int getFieldCount() {return 0;}
    
     @Override
     public void clear()
     {
     for (int i = 0; i < this.inventory.length; ++i)
     {
     this.inventory[i] = null;
     }
     }
     
     @Override
     public void readFromNBT(NBTTagCompound compound)
     {
     super.readFromNBT(compound);
     NBTTagList nbttaglist = compound.getTagList("Items", 10);
     this.inventory = new ItemStack[this.getSizeInventory()];
    
     for (int i = 0; i < nbttaglist.tagCount(); ++i)
     {
     NBTTagCompound nbttagcompound = nbttaglist.getCompoundTagAt(i);
     int j = nbttagcompound.getByte("Slot") & 255;
    
     if (j >= 0 && j < this.inventory.length)
     {
     this.inventory[j] = ItemStack.loadItemStackFromNBT(nbttagcompound);
     }
     }
    
     if (compound.hasKey("CustomName", 8))
     {
     this.customName = compound.getString("CustomName");
     }
     }
    
     @Override
     public void writeToNBT(NBTTagCompound compound)
     {
     super.writeToNBT(compound);
     NBTTagList nbttaglist = new NBTTagList();
    
     for (int i = 0; i < this.inventory.length; ++i)
     {
     if (this.inventory[i] != null)
     {
     NBTTagCompound nbttagcompound = new NBTTagCompound();
     nbttagcompound.setByte("Slot", (byte)i);
     this.inventory[i].writeToNBT(nbttagcompound);
     nbttaglist.appendTag(nbttagcompound);
     }
     }
    
     compound.setTag("Items", nbttaglist);
    
     if (this.hasCustomName())
     {
     compound.setString("CustomName", this.customName);
     }
     }
    
     @Override
     public int[] getSlotsForFace(EnumFacing side) {return null;}
    
     @Override
     public boolean canInsertItem(int index, ItemStack itemStackIn,EnumFacing direction) {return false;}
    
     @Override
     public boolean canExtractItem(int index, ItemStack stack, EnumFacing direction) {return false;}
    }
    [/i][/i][/i]

    Any information would be greatly appreciated.

    Side note: I am working with Forge version 1.9-12.16.0.1865-1.9. Slightly outdated, but a solid build nonetheless. Vanilla classes seem to have no problem with this so I don't think it's a problem in Forge. Regardless if you think that's the case I will updated if one provides a link to a proper bug report on this very case.

    Posted in: Modification Development
  • 0

    posted a message on MalisisAdvert 1.12.6.1.0 / 1.11.2-5.1.0 (01/02/2018)

    Very cool mod. I've always wanted a way to display custom images in game. This will be very useful for creating tutorials and information boards. If I may make a suggestion, I would like the ability to change the size of the board. The 2:3 dimensions are quite restricting and it would be nice to be able to add or subtract by at least half a block on all four edges of the sign. :)

    Posted in: Minecraft Mods
  • 0

    posted a message on [v0.5.0]Project Bench - 1.9 Support Added! [WIP]

    Something I would like to see from this is better hopper support. Right now hoppers just fill the crafting grid up. It'd be nice if hoppers went into the bench's inventory slot instead. And maybe if a hopper under the bench would automatically craft and pull out the item.

    Posted in: WIP Mods
  • 0

    posted a message on [1.6.X/1.7.X] Artifice - The correct term is ~mauve~

    I'm currently having a problem with Artifice generating thousands of blocks of uranium ore per vein... that's ridiculous. I've collected over 10 stacks so far and that doesn't seem to even be making a dent in the amount that has spawned... It's just not a reasonable spawn rate for such as precious material.

    Posted in: Minecraft Mods
  • 0

    posted a message on Mekanism v9.4.0 - Industrial Turbines, Thermoelectric Boilers, Fusion Reactors!
    It would be really nice if Mekanism integrated the ore dictionary into the registering of the ore processing items (crystals, clumps, etc) Gregtech does something along those lines by checking all of the registered ores and automatically creating dusts, crushed ore, and so on so foreign ores can all be processed in the same way. For example, I would like to be able to process metals from Metallurgy via Mekanism to get the 5x multiplier.
    Posted in: Minecraft Mods
  • 0

    posted a message on Tinkers Construct
    EDIT: Problems seem to have been partially resolved. Another mod seems to be causing the issue. Still, as long as MFR isn't installed there is no problem. It might be a three way incompatibility, which is more understandable.

    The 1.6.4 version appears to be incompatible with Minefactory Reloaded, despite supposedly having implemented compatibility. Unfortunately I don't have an error report to back any of this up with, but I can explain.

    With Tinkers' and MFR both installed upon reaching the 'Building World' part of the loading screen the text will vanish, the window will go non-responsive, and then it will say 'Shutting down internal server.' After this point the window will regain responsiveness, only to lose it again seconds later. Then the game must be forced to close via Taskmanager, or waiting until Windows realizes that it's broken and presents that 'XYZ has stopped responding' dialog.

    Now, with either of the mods removed, everything works flawlessly and the mods perform as they should. Just when the two are paired together things go wrong.

    I know 1.6.4 is quite outdated at this point, but I would appreciate a little feedback as to how to solve this if it is a problem on my end. I am trying to build a more modern version of the ancient Feed the Beast packs to play with some friends.

    Note: I'm using the most recent version of MFR and Power Crystals Core.
    Posted in: Minecraft Mods
  • To post a comment, please or register a new account.