1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-11-20 23:34:48 +00:00
This commit is contained in:
Devan-Kerman
2020-08-29 18:01:01 -05:00
parent 605e1f6b9b
commit 621bc526be
757 changed files with 23755 additions and 74210 deletions

View File

@@ -6,31 +6,28 @@
package dan200.computercraft.shared.common;
import javax.annotation.Nonnull;
import dan200.computercraft.api.redstone.IBundledRedstoneProvider;
import net.minecraft.block.Block;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.world.World;
import javax.annotation.Nonnull;
public class DefaultBundledRedstoneProvider implements IBundledRedstoneProvider
{
public class DefaultBundledRedstoneProvider implements IBundledRedstoneProvider {
@Override
public int getBundledRedstoneOutput( @Nonnull World world, @Nonnull BlockPos pos, @Nonnull Direction side )
{
return getDefaultBundledRedstoneOutput( world, pos, side );
public int getBundledRedstoneOutput(@Nonnull World world, @Nonnull BlockPos pos, @Nonnull Direction side) {
return getDefaultBundledRedstoneOutput(world, pos, side);
}
public static int getDefaultBundledRedstoneOutput( World world, BlockPos pos, Direction side )
{
Block block = world.getBlockState( pos ).getBlock();
if( block instanceof IBundledRedstoneBlock )
{
public static int getDefaultBundledRedstoneOutput(World world, BlockPos pos, Direction side) {
Block block = world.getBlockState(pos)
.getBlock();
if (block instanceof IBundledRedstoneBlock) {
IBundledRedstoneBlock generic = (IBundledRedstoneBlock) block;
if( generic.getBundledRedstoneConnectivity( world, pos, side ) )
{
return generic.getBundledRedstoneOutput( world, pos, side );
if (generic.getBundledRedstoneConnectivity(world, pos, side)) {
return generic.getBundledRedstoneOutput(world, pos, side);
}
}
return -1;