1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2024-11-17 23:34:51 +00:00
CC-Tweaked/src/main/java/dan200/computercraft/shared/util/PeripheralUtil.java
Daniel Ratcliffe 7d497f2835 ComputerCraft 1.80pr0
Updated the source code to the version shipped as the 1.80pr0 alpha
release. Also removed some unnecessary files from the LuaJ subfolder
which were bulking up the repository.
2017-05-01 14:51:26 +01:00

21 lines
594 B
Java

package dan200.computercraft.shared.util;
import dan200.computercraft.ComputerCraft;
import dan200.computercraft.api.peripheral.IPeripheral;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.world.World;
public class PeripheralUtil
{
public static IPeripheral getPeripheral( World world, BlockPos pos, EnumFacing side )
{
int y = pos.getY();
if( y >= 0 && y < world.getHeight() && !world.isRemote )
{
return ComputerCraft.getPeripheralAt( world, pos, side );
}
return null;
}
}