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.

Kantaga

Members
  • Joined

  • Last visited

Everything posted by Kantaga

  1. I fixed the issue. Thanks for pointing out that it was a side issue.
  2. So are there any default vanilla ways of sending this data to the server? Or should I create my own message for this using SimpleImpl?
  3. In my mod, I have an item that looks at all blocks of a specific type (tester) connected to the block (like a drawer controller from storage drawers), and calls a method on the tile entity of each tester. The tile entity has 2 fields, an integer and a boolean. The function called uses both fields. If I change the integer to a non-zero value, and then call the function that looks at all the testers, The value of the integer is zero. This is the part where I gather all the tileentities (This is defined in the class extending Block): Set<TileEntityTester> testPositions = new HashSet<>(); Queue<BlockPos> posQueue = new LinkedList<>(); posQueue.add(pos); while(posQueue.size() > 0) { BlockPos position = posQueue.poll(); BlockPos[] neighbours = PosUtil.getNeighbours(position); for (BlockPos npos : neighbours) { if (worldIn.getTileEntity(npos) instanceof TileEntityTester) { testPositions.add((TileEntityTester) worldIn.getTileEntity(npos)); posQueue.add(npos); } } } This is the part where I change the values of the tester tileentity (Defined in the GUI): tileEntity.expect = Integer.parseInt(text.getText()); tileEntity.markDirty(); tileEntity.errorMode = stateTriggered; tileEntity.markDirty();
  4. I've used the documentation on SimpleImpl to send it to the server-side, and it is now fixed. Thank you for helping me.
  5. So that would mean I either have to execute the program on the server-side, or I have to somehow retrieve the contents of the chest from the server. How would I go by doing that?
  6. Currently it executes after a press on a GUI button, so it's client side.
  7. For a feature in my mod, I need to loop through a (trapped) chest, and count the total number of items in the inventory. For some reason, it will always result to 0, even if there are items in the inventory. When using the debugger, and look at the inventory inside the capability, all slots show "1xtile.air@0" This is my code for the function. Outside the function I already ensure that there is a chest at the position. private int countChest(BlockPos pos) { TileEntityChest chest = (TileEntityChest) world.getTileEntity(pos); IItemHandler capability = chest.getSingleChestHandler(); int val = 0; for(int i = 0; i < capability.getSlots(); i++) { val += capability.getStackInSlot(i).getCount(); } return val; }

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.