mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-20 20:22:28 +00:00
Some (sadly breaking) improvements to the Fluid API (#6110)
* Some (sadly breaking) improvements to the API, after feedback and concerns provided by users: - Moved calculation of the translation key to the FluidAttributes constructor, so that builders can be shared between still & flowing sub-fluids. - Moved biome-based coloring to a dedicated FluidAttributes.Water variant, which is not used by default. - Added logic to automatically gather fluid textures into the list of textures to bake. - Patched BucketItem and FlowingFluidBlock to avoid eager access to the fluid objects. - Added a ForgeFlowingFluid class, as a more user-friendly way to construct a new FlowingFluid.
This commit is contained in:
1 parent
281ef5a152
commit
b0c9d7cce9
17 files changed
+537
-277
No files matched your search
@@ -21,6 +21,8 @@ package net.minecraftforge.registries;
|
||||
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
|
||||
/**
|
||||
* A registry delegate for holding references to items or blocks
|
||||
@@ -31,7 +33,7 @@ import net.minecraft.util.ResourceLocation;
|
||||
*
|
||||
* @param <T> the type of thing we're holding onto
|
||||
*/
|
||||
public interface IRegistryDelegate<T> {
|
||||
public interface IRegistryDelegate<T> extends Supplier<T> {
|
||||
/**
|
||||
* Get the referent pointed at by this delegate. This will be the currently active item or block, and will change
|
||||
* as world saves come and go. Note that item.delegate.get() may NOT be the same object as item, due to item and
|
||||
|
||||
Reference in new issue
Block a user