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.

IlluminatiJoe

Members
  • Joined

  • Last visited

  1. Got it to work, for anyone that has this same question, here's the code: - In the EntityMenu this.blockEntity.getCapability(ForgeCapabilities.ITEM_HANDLER).ifPresent(iItemHandler -> { this.addSlot(new SlotItemHandler(iItemHandler, 0, 12, 15) { @Override public int getMaxStackSize() { return 1; } @Override public int getMaxStackSize(@NotNull ItemStack stack) { return 1; } @Override public void set(@NotNull ItemStack stack) { ItemStack copiedItemStack = stack.copyWithCount(1); super.set(copiedItemStack); return; } }); this.addSlot(new SlotItemHandler(iItemHandler, 1, 86, 15)); this.addSlot(new SlotItemHandler(iItemHandler, 2, 86, 60)); }); Adding an anonymous class to the slot you want to have this, and in the class you override the three methods. Now if you want other number of items, replace the 1's in the methods with the number you want. PS. The return line at the end of set() is not needed.
  2. I tried that, and the problem is I can still insert a full stack by hand.
  3. I am trying to make a machine that has an upgrade slot that has an item limit of 1. I've tried overriding a lot of functions and even making a custom SlotItemHandler class, but nothing worked. How would one go about making this?

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.