mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-11-26 17:55:14 +00:00
remap with yarrnforge
This commit is contained in:
@@ -1,35 +0,0 @@
|
||||
/*
|
||||
* This file is part of ComputerCraft - http://www.computercraft.info
|
||||
* Copyright Daniel Ratcliffe, 2011-2019. Do not distribute without permission.
|
||||
* Send enquiries to dratcliffe@gmail.com
|
||||
*/
|
||||
|
||||
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;
|
||||
|
||||
public class DefaultBundledRedstoneProvider implements IBundledRedstoneProvider {
|
||||
@Override
|
||||
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) {
|
||||
IBundledRedstoneBlock generic = (IBundledRedstoneBlock) block;
|
||||
if (generic.getBundledRedstoneConnectivity(world, pos, side)) {
|
||||
return generic.getBundledRedstoneOutput(world, pos, side);
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user