Jump to content

StackSize porting mod error 1.12.2


richie995

Recommended Posts

I'm porting mob properties from 1.10.2 to 1.12.2 in eclipse and I've received the following error 

Spoiler
 
 
 
Spoiler

private int removeDrop(final Item item, final int damage, int count, final boolean infinite, final List<EntityItem> drops) {
        final Iterator<EntityItem> iterator = drops.iterator();
        while (iterator.hasNext()) {
            final EntityItem drop = iterator.next();
            final ItemStack dropStack = drop.getItem();
            if (item == dropStack.getItem() && (damage < 0 || damage == dropStack.getItemDamage())) {
                if (infinite) {
                    iterator.remove();
                }
                else {
                    count += dropStack.stackSize;
                    if (count < 0) {
                        iterator.remove();
                    }
                    else {
                        if (count == 0) {
                            iterator.remove();
                            return 0;
                        }
                        dropStack.stackSize = count;
                        drop.setEntityItemStack(dropStack);
                        return 0;

I'm relatively new to porting mod, so I'm unsure of what to do. The bolded functions are ones highlighted in red in eclipse. For the error "setEntityItemStack" when hovered over it says "The method setEntityItemStack(ItemStack) is undefined for the type EntityItem" and when hovering over "stacksize" it says "The field ItemStack.stackSize is not visible" I'm unsure of how to fix this error, and could use some help

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.