Railcraft

Railcraft

34M Downloads

Feature Request: make use of Universal Bucket

MalkContent opened this issue ยท 18 comments

commented

Unless of course it is not used by choice. :)

commented

What do you mean with "Universal Bucket"? What is that?

commented

A bucket item from forge directly that can accept any registered fluid.

commented

I've never heard them called that, is that new in recent Forges? I've called them fluid containers.

Also could you elaborate on how this isn't used and should be used? Railcraft supports fluid containers, or will, once the port is complete, just like it did in 1.7.

commented

Well the ingame item is forge:bucketFilled and it has 2 nbt tags for the kind and the amount of fluid (iirc). Amount always being 1000, but you can extend the item to make your own kind of fluid storage.
Basically so mods don't all have to add their own bucket items with id.

Edit:
Also this allows for easier cross mod recipes.

commented

So this replaces the vanilla bucket then? The old fluid container stuff is still the same?

commented

Afaik it only replaces the vanilla bucket if some mods tells it to. I vaguely remember seeing that being used somewhere.
In any case, universal bucket is basically just the new standard now. Like with the IItemHandler for inventories.
I can't tell you much more, because I never actually used the thing in my modding attempts. I'm just a standardization enthusiast calling comments from the sidelines in this regard.

commented

the fluid container stuff has not been removed but the universal bucket is a new addition that indeed replaces the vanilla bucket. It will accept all fluid registered with forge and is intended so not all mods have to add their own bucket container, eliminating alot of hassle and cross mod issues

commented

So now you're just supposed to extend the forge bucket?

commented

unless it's a seperate container you shouldn't, just enable it and it'll do the rest

commented

I obviously meant if you want to implement a new container.

commented

yes, there is an example of that in the forge tests folder somewhere

commented

I though it was a user side thing requiring a config change... there really isn't any info out there.

commented

there is also a config option yes that the user can use to force the bucket but as you said: not much info on it out there so almost nobody knows that

@Forecaster i also just remembered that for implementing a container you can look at my mod Kinetic Revolution, it's outdated and not updated and never released but i messed around with new things including the containers in it

commented

For a bit of information on how to use it, essentially it's just a registry you add your fluids to. Tinkers does most of its fluids dynamically, but this line is where they get registered from there.

The other thing you need to do is enable the forge universal bucket statically in your main class, as shown here (Tinkers may not be the best example for that case as we use a module system and thus place that in one of the modules, but the modules are loaded statically making it called at the same time)


Alternatively if you are looking to add your own container using the registry to add fluids, it is a bit more complicated, but essentially the main line you need to get the availa le fluids is shown in my implementation from Ceramics for a clay bucket

commented

I will close those issues and move them here.

commented

This issue, in fact, has some priority as discussed on Discord.

commented

I did manage to implement this in my own branch. However, blocks are completely broken, and there are other considerations to make for this as well.