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

Hi, I need some help understanding what's not working here...

Basically I wanted to rewrite my tank multiblock's onBlockActivated code so that it also works with TConstruct buckets (which use the universalBucket).

I got them working, but now FluidUtil.interactWithTank returns false with vanilla buckets (water,lava)!

I tried debugging, but I'm still clueless...I couldn't find much info about the universalBucket, so I might be missing some obvious details, I hope you can help me.

 

(Naturally TileFountain implements IFluidHandler)

 

Original code:

 

if (world.isRemote) true

       

        val master = (for {

          x <- -1 to 1

          z <- -1 to 1

        } yield world.getTileEntity (pos.add (x, 3, z))) collectFirst { case f: TileFountain => f }

        val item = Option.apply (player.getHeldItem)

       

        master exists (t =>

            item exists (i =>

              if (FluidUtil.interactWithTank(i, player, t, side.getOpposite))

                true

              else

                FluidContainerRegistry.isFilledContainer(i) ||

                i.getItem.isInstanceOf[iFluidContainerItem]))

 

 

Trimmed java version:

 

 

if (world.isRemote())

    return true;

       

        IFluidHandler master =  ...;  // code

        ItemStack item = player.getHeldItem();

       

        if (master != null && item != null) {

                if (FluidUtil.interactWithTank(item, player, master, side.getOpposite()))

                  return true;

                else

                  return FluidContainerRegistry.isFilledContainer(item) ||

                            item.getItem() instanceof IFluidContainerItem;

}

 

  • Author

Update to 1.10.2 and use the fluid capabilities.

 

I am working on an addon for another mod that is currently 1.8.9 only, so that is unfortunately not an option.

Guest
This topic is now closed to further replies.

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.