Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Hello, I am trying to get my ISidedInvnetory code working how i want it.

Basically 1 have 2 slots, I wan to import into slot1 from all sides and export from all slots from slot2/

 

MY code so far.

 

 

private static final int[] slots_top = new int[] {0};

private static final int[] slots_bottom = new int[] {2, 1};

private static final int[] slots_sides = new int[] {1, 0};

 

 

  public int[] getAccessibleSlotsFromSide(int par1) {

    return par1 == 0 ? slots_bottom : (par1 == 1 ? slots_top : slots_sides);

}

 

 

public boolean canInsertItem(int par1, ItemStack par2ItemStack, int par3) {

      return this.isItemValidForSlot(par1, par2ItemStack);

}

public boolean canExtractItem(int par1, ItemStack par2ItemStack, int par3) {

return par3 != 0 || par3 != 1 || par3 != 2 || par1 != 0 || par2ItemStack.itemID == Item.bucketEmpty.itemID;

}

 

 

 

Been messing with the canExtractItem() functions for a while now and altough some stuff has changed i still cant get the right sides working.

 

If i knew the difference between par1 and par3 or what part of it is import and what is export i would be able to manage.

  • Author

Someone please help. I have spent the last 6 hours on this trying every combination of par1, par3, ==, !=, 0,  1,2 and everything else i could and still nothing. no searching on google, minecraftforums or forgeforums has helped me in the slightest. I've even taken into looking at source code from EnderIO and Thermal Expansion and that has not helped me either.

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.