2015-10-10 02:58:07 +02:00
|
|
|
/*
|
2016-05-16 22:52:27 +02:00
|
|
|
* This file ("TileEntityPhantomLiquiface.java") is part of the Actually Additions mod for Minecraft.
|
2015-10-10 02:58:07 +02:00
|
|
|
* It is created and owned by Ellpeck and distributed
|
|
|
|
* under the Actually Additions License to be found at
|
2016-05-16 22:52:27 +02:00
|
|
|
* http://ellpeck.de/actaddlicense
|
2015-10-10 02:58:07 +02:00
|
|
|
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
|
|
|
|
*
|
2017-01-01 16:23:26 +01:00
|
|
|
* © 2015-2017 Ellpeck
|
2015-10-10 02:58:07 +02:00
|
|
|
*/
|
|
|
|
|
2016-01-05 04:47:35 +01:00
|
|
|
package de.ellpeck.actuallyadditions.mod.tile;
|
2015-10-10 02:58:07 +02:00
|
|
|
|
2021-08-22 21:09:15 +02:00
|
|
|
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
|
2016-01-05 04:47:35 +01:00
|
|
|
import de.ellpeck.actuallyadditions.mod.blocks.BlockPhantom;
|
2016-06-07 23:22:26 +02:00
|
|
|
import net.minecraft.tileentity.TileEntity;
|
2021-02-27 13:24:45 +01:00
|
|
|
import net.minecraft.util.Direction;
|
2016-12-28 03:12:17 +01:00
|
|
|
import net.minecraftforge.common.capabilities.Capability;
|
2016-06-05 02:16:52 +02:00
|
|
|
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
|
2015-10-10 02:58:07 +02:00
|
|
|
|
2021-08-22 20:16:04 +02:00
|
|
|
public class TileEntityPhantomLiquiface extends TileEntityPhantomFace implements ISharingFluidHandler {
|
2015-10-10 02:58:07 +02:00
|
|
|
|
2019-05-02 09:10:29 +02:00
|
|
|
public TileEntityPhantomLiquiface() {
|
2021-08-22 21:09:15 +02:00
|
|
|
super(ActuallyBlocks.PHANTOM_LIQUIFACE.getTileEntityType());
|
2015-10-10 02:58:07 +02:00
|
|
|
this.type = BlockPhantom.Type.LIQUIFACE;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2019-05-02 09:10:29 +02:00
|
|
|
public boolean isBoundThingInRange() {
|
|
|
|
if (super.isBoundThingInRange()) {
|
2021-08-22 17:09:06 +02:00
|
|
|
TileEntity tile = this.level.getBlockEntity(this.boundPosition);
|
2019-05-02 09:10:29 +02:00
|
|
|
if (tile != null && !(tile instanceof TileEntityLaserRelayFluids)) {
|
2021-02-27 13:24:45 +01:00
|
|
|
for (Direction facing : Direction.values()) {
|
2021-02-27 16:33:00 +01:00
|
|
|
if (tile.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, facing).isPresent()) {
|
|
|
|
return true;
|
|
|
|
}
|
2016-09-02 08:33:54 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
2016-06-10 22:00:30 +02:00
|
|
|
}
|
|
|
|
|
2016-12-28 03:12:17 +01:00
|
|
|
@Override
|
2019-05-02 09:10:29 +02:00
|
|
|
protected boolean isCapabilitySupported(Capability<?> capability) {
|
2016-12-28 03:12:17 +01:00
|
|
|
return capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY;
|
|
|
|
}
|
|
|
|
|
2016-06-10 22:00:30 +02:00
|
|
|
@Override
|
2019-05-02 09:10:29 +02:00
|
|
|
public int getMaxFluidAmountToSplitShare() {
|
2016-08-31 20:16:36 +02:00
|
|
|
return Integer.MAX_VALUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2019-05-02 09:10:29 +02:00
|
|
|
public boolean doesShareFluid() {
|
2016-08-31 20:16:36 +02:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2021-02-27 13:24:45 +01:00
|
|
|
public Direction[] getFluidShareSides() {
|
|
|
|
return Direction.values();
|
2016-08-31 20:16:36 +02:00
|
|
|
}
|
2015-10-10 02:58:07 +02:00
|
|
|
}
|