mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-22 13:09:59 +00:00
Setup and import of 1.16 YEET
This commit is contained in:
931 files changed
+18847
-9127
No files matched your search
@@ -23,13 +23,13 @@ import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.fluid.Fluid;
|
||||
import net.minecraft.fluid.IFluidState;
|
||||
import net.minecraft.fluid.FluidState;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.particles.ParticleTypes;
|
||||
import net.minecraft.util.*;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.TranslationTextComponent;
|
||||
import net.minecraft.world.ILightReader;
|
||||
import net.minecraft.world.IBlockDisplayReader;
|
||||
|
||||
import java.util.function.BiFunction;
|
||||
import java.util.stream.Stream;
|
||||
@@ -152,22 +152,22 @@ public class FluidAttributes
|
||||
return new ItemStack(stack.getFluid().getFilledBucket());
|
||||
}
|
||||
|
||||
public BlockState getBlock(ILightReader reader, BlockPos pos, IFluidState state)
|
||||
public BlockState getBlock(IBlockDisplayReader reader, BlockPos pos, FluidState state)
|
||||
{
|
||||
return state.getBlockState();
|
||||
}
|
||||
|
||||
public IFluidState getStateForPlacement(ILightReader reader, BlockPos pos, FluidStack state)
|
||||
public FluidState getStateForPlacement(IBlockDisplayReader reader, BlockPos pos, FluidStack state)
|
||||
{
|
||||
return state.getFluid().getDefaultState();
|
||||
}
|
||||
|
||||
public final boolean canBePlacedInWorld(ILightReader reader, BlockPos pos, IFluidState state)
|
||||
public final boolean canBePlacedInWorld(IBlockDisplayReader reader, BlockPos pos, FluidState state)
|
||||
{
|
||||
return !getBlock(reader, pos, state).isAir(reader, pos);
|
||||
}
|
||||
|
||||
public final boolean canBePlacedInWorld(ILightReader reader, BlockPos pos, FluidStack state)
|
||||
public final boolean canBePlacedInWorld(IBlockDisplayReader reader, BlockPos pos, FluidStack state)
|
||||
{
|
||||
return !getBlock(reader, pos, getStateForPlacement(reader, pos, state)).isAir(reader, pos);
|
||||
}
|
||||
@@ -186,7 +186,7 @@ public class FluidAttributes
|
||||
* @param fluidStack The fluidStack is trying to be placed.
|
||||
* @return true if this fluid should vaporize in dimensions where water vaporizes when placed.
|
||||
*/
|
||||
public boolean doesVaporize(ILightReader reader, BlockPos pos, FluidStack fluidStack)
|
||||
public boolean doesVaporize(IBlockDisplayReader reader, BlockPos pos, FluidStack fluidStack)
|
||||
{
|
||||
BlockState blockstate = getBlock(reader, pos, getStateForPlacement(reader, pos, fluidStack));
|
||||
if (blockstate == null)
|
||||
@@ -314,17 +314,17 @@ public class FluidAttributes
|
||||
public SoundEvent getEmptySound(FluidStack stack) { return getEmptySound(); }
|
||||
|
||||
/* World-based Accessors */
|
||||
public int getLuminosity(ILightReader world, BlockPos pos){ return getLuminosity(); }
|
||||
public int getDensity(ILightReader world, BlockPos pos){ return getDensity(); }
|
||||
public int getTemperature(ILightReader world, BlockPos pos){ return getTemperature(); }
|
||||
public int getViscosity(ILightReader world, BlockPos pos){ return getViscosity(); }
|
||||
public boolean isGaseous(ILightReader world, BlockPos pos){ return isGaseous(); }
|
||||
public Rarity getRarity(ILightReader world, BlockPos pos){ return getRarity(); }
|
||||
public int getColor(ILightReader world, BlockPos pos){ return getColor(); }
|
||||
public ResourceLocation getStillTexture(ILightReader world, BlockPos pos) { return getStillTexture(); }
|
||||
public ResourceLocation getFlowingTexture(ILightReader world, BlockPos pos) { return getFlowingTexture(); }
|
||||
public SoundEvent getFillSound(ILightReader world, BlockPos pos) { return getFillSound(); }
|
||||
public SoundEvent getEmptySound(ILightReader world, BlockPos pos) { return getEmptySound(); }
|
||||
public int getLuminosity(IBlockDisplayReader world, BlockPos pos){ return getLuminosity(); }
|
||||
public int getDensity(IBlockDisplayReader world, BlockPos pos){ return getDensity(); }
|
||||
public int getTemperature(IBlockDisplayReader world, BlockPos pos){ return getTemperature(); }
|
||||
public int getViscosity(IBlockDisplayReader world, BlockPos pos){ return getViscosity(); }
|
||||
public boolean isGaseous(IBlockDisplayReader world, BlockPos pos){ return isGaseous(); }
|
||||
public Rarity getRarity(IBlockDisplayReader world, BlockPos pos){ return getRarity(); }
|
||||
public int getColor(IBlockDisplayReader world, BlockPos pos){ return getColor(); }
|
||||
public ResourceLocation getStillTexture(IBlockDisplayReader world, BlockPos pos) { return getStillTexture(); }
|
||||
public ResourceLocation getFlowingTexture(IBlockDisplayReader world, BlockPos pos) { return getFlowingTexture(); }
|
||||
public SoundEvent getFillSound(IBlockDisplayReader world, BlockPos pos) { return getFillSound(); }
|
||||
public SoundEvent getEmptySound(IBlockDisplayReader world, BlockPos pos) { return getEmptySound(); }
|
||||
|
||||
public static Builder builder(ResourceLocation stillTexture, ResourceLocation flowingTexture) {
|
||||
return new Builder(stillTexture, flowingTexture, FluidAttributes::new);
|
||||
@@ -441,7 +441,7 @@ public class FluidAttributes
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColor(ILightReader world, BlockPos pos)
|
||||
public int getColor(IBlockDisplayReader world, BlockPos pos)
|
||||
{
|
||||
return BiomeColors.getWaterColor(world, pos) | 0xFF000000;
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.*;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.BlockRayTraceResult;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.util.math.vector.Vector3d;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.LazyOptional;
|
||||
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
|
||||
@@ -548,7 +548,7 @@ public class FluidUtil
|
||||
return false;
|
||||
}
|
||||
|
||||
BlockItemUseContext context = new BlockItemUseContext(new ItemUseContext(player, hand, new BlockRayTraceResult(Vec3d.ZERO, Direction.UP, pos, false))); //TODO: This neds proper context...
|
||||
BlockItemUseContext context = new BlockItemUseContext(new ItemUseContext(player, hand, new BlockRayTraceResult(Vector3d.ZERO, Direction.UP, pos, false))); //TODO: This neds proper context...
|
||||
|
||||
// check that we can place the fluid at the destination
|
||||
BlockState destBlockState = world.getBlockState(pos);
|
||||
@@ -560,7 +560,7 @@ public class FluidUtil
|
||||
return false; // Non-air, solid, unreplacable block. We can't put fluid here.
|
||||
}
|
||||
|
||||
if (world.dimension.doesWaterVaporize() && fluid.getAttributes().doesVaporize(world, pos, resource))
|
||||
if (world.func_230315_m_().func_236040_e_() && fluid.getAttributes().doesVaporize(world, pos, resource))
|
||||
{
|
||||
FluidStack result = fluidSource.drain(resource, IFluidHandler.FluidAction.EXECUTE);
|
||||
if (!result.isEmpty())
|
||||
|
||||
@@ -25,7 +25,7 @@ import net.minecraft.block.Blocks;
|
||||
import net.minecraft.block.FlowingFluidBlock;
|
||||
import net.minecraft.fluid.FlowingFluid;
|
||||
import net.minecraft.fluid.Fluid;
|
||||
import net.minecraft.fluid.IFluidState;
|
||||
import net.minecraft.fluid.FluidState;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.state.StateContainer;
|
||||
@@ -90,7 +90,7 @@ public abstract class ForgeFlowingFluid extends FlowingFluid
|
||||
@Override
|
||||
protected void beforeReplacingBlock(IWorld worldIn, BlockPos pos, BlockState state)
|
||||
{
|
||||
TileEntity tileentity = state.getBlock().hasTileEntity() ? worldIn.getTileEntity(pos) : null;
|
||||
TileEntity tileentity = state.getBlock().hasTileEntity(state) ? worldIn.getTileEntity(pos) : null;
|
||||
Block.spawnDrops(state, worldIn.getWorld(), pos, tileentity);
|
||||
}
|
||||
|
||||
@@ -113,7 +113,7 @@ public abstract class ForgeFlowingFluid extends FlowingFluid
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean canDisplace(IFluidState state, IBlockReader world, BlockPos pos, Fluid fluidIn, Direction direction)
|
||||
protected boolean canDisplace(FluidState state, IBlockReader world, BlockPos pos, Fluid fluidIn, Direction direction)
|
||||
{
|
||||
// Based on the water implementation, may need to be overriden for mod fluids that shouldn't behave like water.
|
||||
return direction == Direction.DOWN && !isEquivalentTo(fluidIn);
|
||||
@@ -132,7 +132,7 @@ public abstract class ForgeFlowingFluid extends FlowingFluid
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockState getBlockState(IFluidState state)
|
||||
protected BlockState getBlockState(FluidState state)
|
||||
{
|
||||
if (block != null)
|
||||
return block.get().getDefaultState().with(FlowingFluidBlock.LEVEL, getLevelFromState(state));
|
||||
@@ -158,16 +158,16 @@ public abstract class ForgeFlowingFluid extends FlowingFluid
|
||||
setDefaultState(getStateContainer().getBaseState().with(LEVEL_1_8, 7));
|
||||
}
|
||||
|
||||
protected void fillStateContainer(StateContainer.Builder<Fluid, IFluidState> builder) {
|
||||
protected void fillStateContainer(StateContainer.Builder<Fluid, FluidState> builder) {
|
||||
super.fillStateContainer(builder);
|
||||
builder.add(LEVEL_1_8);
|
||||
}
|
||||
|
||||
public int getLevel(IFluidState state) {
|
||||
public int getLevel(FluidState state) {
|
||||
return state.get(LEVEL_1_8);
|
||||
}
|
||||
|
||||
public boolean isSource(IFluidState state) {
|
||||
public boolean isSource(FluidState state) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -179,11 +179,11 @@ public abstract class ForgeFlowingFluid extends FlowingFluid
|
||||
super(properties);
|
||||
}
|
||||
|
||||
public int getLevel(IFluidState state) {
|
||||
public int getLevel(FluidState state) {
|
||||
return 8;
|
||||
}
|
||||
|
||||
public boolean isSource(IFluidState state) {
|
||||
public boolean isSource(FluidState state) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
package net.minecraftforge.fluids.capability;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
@@ -43,9 +44,9 @@ public class TileFluidHandler extends TileEntity
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(CompoundNBT tag)
|
||||
public void func_230337_a_(BlockState state, CompoundNBT tag)
|
||||
{
|
||||
super.read(tag);
|
||||
super.func_230337_a_(state, tag);
|
||||
tank.readFromNBT(tag);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user