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
|
|
|
|
*
|
2016-05-16 22:54:42 +02:00
|
|
|
* © 2015-2016 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
|
|
|
|
2016-01-05 04:47:35 +01:00
|
|
|
import de.ellpeck.actuallyadditions.mod.blocks.BlockPhantom;
|
|
|
|
import de.ellpeck.actuallyadditions.mod.util.WorldUtil;
|
2015-10-10 02:58:07 +02:00
|
|
|
import net.minecraft.tileentity.TileEntity;
|
2016-01-07 19:04:29 +01:00
|
|
|
import net.minecraft.util.EnumFacing;
|
2016-06-05 02:16:52 +02:00
|
|
|
import net.minecraftforge.common.capabilities.Capability;
|
|
|
|
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
|
|
|
|
import net.minecraftforge.fluids.capability.IFluidHandler;
|
2015-10-10 02:58:07 +02:00
|
|
|
|
2016-06-05 02:16:52 +02:00
|
|
|
public class TileEntityPhantomLiquiface extends TileEntityPhantomface{
|
2015-10-10 02:58:07 +02:00
|
|
|
|
|
|
|
public TileEntityPhantomLiquiface(){
|
|
|
|
super("liquiface");
|
|
|
|
this.type = BlockPhantom.Type.LIQUIFACE;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void updateEntity(){
|
|
|
|
super.updateEntity();
|
|
|
|
|
2016-05-02 17:46:53 +02:00
|
|
|
if(!this.worldObj.isRemote){
|
2016-06-05 02:16:52 +02:00
|
|
|
if(this.isRedstonePowered && this.isBoundThingInRange()){
|
|
|
|
for(EnumFacing side : EnumFacing.values()){
|
|
|
|
WorldUtil.pushFluid(this, side);
|
2015-10-10 02:58:07 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean isBoundThingInRange(){
|
2016-06-05 02:16:52 +02:00
|
|
|
return super.isBoundThingInRange() && this.worldObj.getTileEntity(this.boundPosition).hasCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, null);
|
2015-10-10 02:58:07 +02:00
|
|
|
}
|
|
|
|
}
|