mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2024-11-17 23:34:51 +00:00
7d497f2835
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.
21 lines
594 B
Java
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;
|
|
}
|
|
}
|