Jump to content

[1.8.9] Help with universalBucket


Pennyw95

Recommended Posts

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;

}

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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