mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-07-03 10:32:52 +00:00

It's been a long time comin' But tonight is the end of the war, my friend Tomorrow only one style will remain.
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.EnumFacing;
|
|
import net.minecraft.util.math.BlockPos;
|
|
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;
|
|
}
|
|
}
|