2015-10-10 02:58:07 +02:00
|
|
|
/*
|
2016-05-16 22:52:27 +02:00
|
|
|
* This file ("TileEntityPhantomEnergyface.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-07-25 02:07:16 +02:00
|
|
|
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
2016-01-05 04:47:35 +01:00
|
|
|
import de.ellpeck.actuallyadditions.mod.blocks.BlockPhantom;
|
2016-07-24 02:54:07 +02:00
|
|
|
import de.ellpeck.actuallyadditions.mod.util.compat.TeslaUtil;
|
2015-10-10 02:58:07 +02:00
|
|
|
import net.minecraft.tileentity.TileEntity;
|
2016-01-07 18:20:59 +01:00
|
|
|
import net.minecraft.util.EnumFacing;
|
2016-11-26 19:00:02 +01:00
|
|
|
import net.minecraftforge.energy.CapabilityEnergy;
|
2015-10-10 02:58:07 +02:00
|
|
|
|
2016-11-26 20:43:50 +01:00
|
|
|
public class TileEntityPhantomEnergyface extends TileEntityPhantomface implements ISharingEnergyProvider{
|
2015-10-10 02:58:07 +02:00
|
|
|
|
|
|
|
public TileEntityPhantomEnergyface(){
|
|
|
|
super("energyface");
|
|
|
|
this.type = BlockPhantom.Type.ENERGYFACE;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean isBoundThingInRange(){
|
2016-07-24 02:54:07 +02:00
|
|
|
if(super.isBoundThingInRange()){
|
2016-11-26 21:32:27 +01:00
|
|
|
TileEntity tile = this.world.getTileEntity(this.boundPosition);
|
2016-12-27 11:24:31 +01:00
|
|
|
if(tile != null && !(tile instanceof TileEntityLaserRelayEnergy)){
|
2016-11-26 20:43:50 +01:00
|
|
|
for(EnumFacing facing : EnumFacing.values()){
|
|
|
|
if(tile.hasCapability(CapabilityEnergy.ENERGY, facing)){
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
else if(ActuallyAdditions.teslaLoaded){
|
|
|
|
if(tile.hasCapability(TeslaUtil.teslaHolder, facing)){
|
2016-09-02 08:33:54 +02:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2016-07-24 02:54:07 +02:00
|
|
|
}
|
2016-09-02 08:33:54 +02:00
|
|
|
return false;
|
2015-10-10 02:58:07 +02:00
|
|
|
}
|
|
|
|
|
2016-08-31 20:16:36 +02:00
|
|
|
@Override
|
|
|
|
public int getEnergyToSplitShare(){
|
|
|
|
return Integer.MAX_VALUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean doesShareEnergy(){
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public EnumFacing[] getEnergyShareSides(){
|
|
|
|
return EnumFacing.values();
|
|
|
|
}
|
2016-12-18 17:28:29 +01:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean canShareTo(TileEntity tile){
|
|
|
|
return true;
|
|
|
|
}
|
2015-10-10 02:58:07 +02:00
|
|
|
}
|