Files
MinecraftForge/src/main/java/net/minecraftforge/fluids/IFluidBlock.java
T
4ed9117799 Forge 1.19
* Bump pack.mcmeta formats
* 1.19 biome modifiers
* Mark ClientPlayerNetworkEvent.LoggedOutEvent's getters as nullable
* Add docs and package-info to client extension interfaces package
* Move RenderBlockOverlayEvent hooks to ForgeHooksClient
* Add package-infos to client events package
* Rename SoundLoadEvent to SoundEngineLoadEvent

This reduces confusion from consumers which may think the
name SoundLoadEvent refers to an individual sound being loaded rather
than the sound engine.
* Document and change SoundLoadEvent to fire on mod bus

Previously, it fired on both the mod bus and the Forge bus, which is
confusing for consumers.
* Delete SoundSetupEvent

Looking at its original implementation shows that there isn't an
appropriate place in the new sound code to reinsert the event, and the
place of 'sound engine/manager initialization event' is taken already by SoundLoadEvent.
* Perform some cleanup on client events

 - Removed nullable annotations from ClientPlayerNetworkEvent
 - Renamed #getPartialTicks methods to #getPartialTick, to be consistent
  with vanilla's naming of the partial tick
 - Cleanup documentation to remove line breaks, use the
  spelling 'cancelled' over
  'canceled', and improve docs on existing and
   new methods.
* Remove EntityEvent.CanUpdate

Closes MinecraftForge/MinecraftForge#6394
* Switch to Jetbrains nullability annotations
* New PlayLevelSoundEvent; replaces old PlaySoundAtEntityEvent
* Remove ForgeWorldPresetScreens
* Remove IForgeRegistryEntry
* Remove use of List<Throwable> in FML's CompletableFutures
* Add docs to mod loading stages, stages, and phases
* Gradle 7.4.2
* Use SLF4J in FMLLoader and other subprojects
* Switch dynamic versions in subprojects to pinned ones
* Switch ForgeRoot and MDK to FG plugin markers
* Configure Forge javadoc task

The task now uses a custom stylesheet with MCForge elements, and
configured to combine the generation from the four FML subprojects
(fmlloader, fmlcore, javafmllanguage, mclanguage) and the Forge project
into the javadoc output.
* Update docs/md files, for 1.19 update and the move away from IRC to Discord.
* Make "Potentially dangerous alternative prefix" a debug warning, not info.

Co-authored-by: Curle <[email protected]>
Co-authored-by: sciwhiz12 <[email protected]>
Signed-off-by: SizableShrimp <[email protected]>
2022-06-07 15:31:26 -05:00

66 lines
2.3 KiB
Java

/*
* Copyright (c) Forge Development LLC and contributors
* SPDX-License-Identifier: LGPL-2.1-only
*/
package net.minecraftforge.fluids;
import net.minecraft.world.level.material.Fluid;
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.Level;
import net.minecraftforge.fluids.capability.IFluidHandler;
import org.jetbrains.annotations.NotNull;
/**
* Implement this interface on Block classes which represent world-placeable Fluids.
*
*/
public interface IFluidBlock
{
/**
* Returns the Fluid associated with this Block.
*/
Fluid getFluid();
/**
* Attempts to place the block at a given position. The placed block's level will correspond
* to the provided fluid amount.
* This method should be called by fluid containers such as buckets, but it is recommended
* to use {@link FluidUtil}.
*
* @param level the level to place the block in
* @param pos the position to place the block at
* @param fluidStack the fluid stack to get the required data from
* @param action If SIMULATE, the placement will only be simulated
* @return the amount of fluid extracted from the provided stack to achieve some fluid level
*/
int place(Level level, BlockPos pos, @NotNull FluidStack fluidStack, IFluidHandler.FluidAction action);
/**
* Attempt to drain the block. This method should be called by devices such as pumps.
*
* NOTE: The block is intended to handle its own state changes.
*
* @param action
* If SIMULATE, the drain will only be simulated.
* @return the fluid stack after draining the block
*/
@NotNull
FluidStack drain(Level level, BlockPos pos, IFluidHandler.FluidAction action);
/**
* Check to see if a block can be drained. This method should be called by devices such as
* pumps.
*/
boolean canDrain(Level level, BlockPos pos);
/**
* Returns the amount of a single block is filled. Value between 0 and 1.
* 1 meaning the entire 1x1x1 cube is full, 0 meaning completely empty.
*
* If the return value is negative. It will be treated as filling the block
* from the top down instead of bottom up.
*/
float getFilledPercentage(Level level, BlockPos pos);
}