diff --git a/src/main/java/com/simibubi/create/content/contraptions/base/KineticTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/base/KineticTileEntity.java index 29e5a8333..88f96feae 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/base/KineticTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/base/KineticTileEntity.java @@ -1,12 +1,5 @@ package com.simibubi.create.content.contraptions.base; -import static net.minecraft.util.text.TextFormatting.GOLD; -import static net.minecraft.util.text.TextFormatting.GRAY; - -import java.util.List; - -import javax.annotation.Nullable; - import com.simibubi.create.Create; import com.simibubi.create.content.contraptions.KineticNetwork; import com.simibubi.create.content.contraptions.RotationPropagator; @@ -20,7 +13,6 @@ import com.simibubi.create.foundation.item.TooltipHelper; import com.simibubi.create.foundation.tileEntity.SmartTileEntity; import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour; import com.simibubi.create.foundation.utility.Lang; - import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.client.resources.I18n; @@ -35,6 +27,12 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.util.text.TextFormatting; import net.minecraft.world.World; +import javax.annotation.Nullable; +import java.util.List; + +import static net.minecraft.util.text.TextFormatting.GOLD; +import static net.minecraft.util.text.TextFormatting.GRAY; + public abstract class KineticTileEntity extends SmartTileEntity implements ITickableTileEntity, IHaveGoggleInformation, IHaveHoveringInformation { @@ -352,13 +350,12 @@ public abstract class KineticTileEntity extends SmartTileEntity return; TileEntity tileEntityIn = world.getTileEntity(pos); + BlockState currentState = world.getBlockState(pos); boolean isKinetic = tileEntityIn instanceof KineticTileEntity; - if (tileEntityIn == null) + if (currentState == state) return; - if (tileEntityIn.getBlockState() == state) - return; - if (!isKinetic) { + if (tileEntityIn == null || !isKinetic) { world.setBlockState(pos, state, 3); return; } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/fan/NozzleBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/fan/NozzleBlock.java index 34fd10d4e..2c0a842ce 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/fan/NozzleBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/fan/NozzleBlock.java @@ -2,9 +2,7 @@ package com.simibubi.create.content.contraptions.components.fan; import com.simibubi.create.AllShapes; import com.simibubi.create.AllTileEntities; -import com.simibubi.create.content.contraptions.wrench.IWrenchable; import com.simibubi.create.foundation.block.ProperDirectionalBlock; - import mcp.MethodsReturnNonnullByDefault; import net.minecraft.block.Block; import net.minecraft.block.BlockState; @@ -24,7 +22,7 @@ import javax.annotation.ParametersAreNonnullByDefault; @MethodsReturnNonnullByDefault @ParametersAreNonnullByDefault -public class NozzleBlock extends ProperDirectionalBlock implements IWrenchable { +public class NozzleBlock extends ProperDirectionalBlock { public NozzleBlock(Properties p_i48415_1_) { super(p_i48415_1_); diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/PistonContraption.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/PistonContraption.java index 9e0e0972d..eb786c14e 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/PistonContraption.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/PistonContraption.java @@ -1,25 +1,11 @@ package com.simibubi.create.content.contraptions.components.structureMovement.piston; -import static com.simibubi.create.AllBlocks.MECHANICAL_PISTON_HEAD; -import static com.simibubi.create.AllBlocks.PISTON_EXTENSION_POLE; -import static com.simibubi.create.content.contraptions.components.structureMovement.piston.MechanicalPistonBlock.isExtensionPole; -import static com.simibubi.create.content.contraptions.components.structureMovement.piston.MechanicalPistonBlock.isPiston; -import static com.simibubi.create.content.contraptions.components.structureMovement.piston.MechanicalPistonBlock.isPistonHead; -import static com.simibubi.create.content.contraptions.components.structureMovement.piston.MechanicalPistonBlock.isStickyPiston; -import static net.minecraft.state.properties.BlockStateProperties.FACING; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.commons.lang3.tuple.Pair; - import com.simibubi.create.content.contraptions.components.structureMovement.AllContraptionTypes; import com.simibubi.create.content.contraptions.components.structureMovement.BlockMovementTraits; import com.simibubi.create.content.contraptions.components.structureMovement.TranslatingContraption; -import com.simibubi.create.content.contraptions.components.structureMovement.piston.MechanicalPistonBlock.PistonState; +import com.simibubi.create.content.contraptions.components.structureMovement.piston.MechanicalPistonBlock.*; import com.simibubi.create.foundation.config.AllConfigs; import com.simibubi.create.foundation.utility.VecHelper; - import net.minecraft.block.BlockState; import net.minecraft.block.CarpetBlock; import net.minecraft.nbt.CompoundNBT; @@ -32,6 +18,15 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.world.IWorld; import net.minecraft.world.World; import net.minecraft.world.gen.feature.template.Template.BlockInfo; +import org.apache.commons.lang3.tuple.Pair; + +import java.util.ArrayList; +import java.util.List; + +import static com.simibubi.create.AllBlocks.MECHANICAL_PISTON_HEAD; +import static com.simibubi.create.AllBlocks.PISTON_EXTENSION_POLE; +import static com.simibubi.create.content.contraptions.components.structureMovement.piston.MechanicalPistonBlock.*; +import static net.minecraft.state.properties.BlockStateProperties.FACING; public class PistonContraption extends TranslatingContraption { @@ -77,8 +72,7 @@ public class PistonContraption extends TranslatingContraption { return false; if (blockState.get(MechanicalPistonBlock.STATE) == PistonState.EXTENDED) { - while (isExtensionPole(nextBlock) && nextBlock.get(FACING) - .getAxis() == direction.getAxis() || isPistonHead(nextBlock) && nextBlock.get(FACING) == direction) { + while (PistonPolePlacementHelper.matchesAxis(nextBlock, direction.getAxis()) || isPistonHead(nextBlock) && nextBlock.get(FACING) == direction) { actualStart = actualStart.offset(direction); poles.add(new BlockInfo(actualStart, nextBlock.with(FACING, direction), null)); @@ -105,7 +99,7 @@ public class PistonContraption extends TranslatingContraption { nextBlock = world.getBlockState(end.offset(direction.getOpposite())); int extensionsInBack = 0; - while (isExtensionPole(nextBlock)) { + while (PistonPolePlacementHelper.matchesAxis(nextBlock, direction.getAxis())) { end = end.offset(direction.getOpposite()); poles.add(new BlockInfo(end, nextBlock.with(FACING, direction), null)); extensionsInBack++; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/PistonExtensionPoleBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/PistonExtensionPoleBlock.java index 7e38330ad..f2949639d 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/PistonExtensionPoleBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/PistonExtensionPoleBlock.java @@ -1,14 +1,11 @@ package com.simibubi.create.content.contraptions.components.structureMovement.piston; -import static com.simibubi.create.content.contraptions.components.structureMovement.piston.MechanicalPistonBlock.isExtensionPole; -import static com.simibubi.create.content.contraptions.components.structureMovement.piston.MechanicalPistonBlock.isPiston; -import static com.simibubi.create.content.contraptions.components.structureMovement.piston.MechanicalPistonBlock.isPistonHead; - +import com.simibubi.create.AllBlocks; import com.simibubi.create.AllShapes; -import com.simibubi.create.content.contraptions.components.structureMovement.piston.MechanicalPistonBlock.PistonState; +import com.simibubi.create.content.contraptions.components.structureMovement.piston.MechanicalPistonBlock.*; import com.simibubi.create.content.contraptions.wrench.IWrenchable; import com.simibubi.create.foundation.block.ProperDirectionalBlock; - +import com.simibubi.create.foundation.utility.Pair; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.IWaterLoggable; @@ -17,18 +14,24 @@ import net.minecraft.entity.player.PlayerEntity; import net.minecraft.fluid.Fluids; import net.minecraft.fluid.IFluidState; import net.minecraft.item.BlockItemUseContext; +import net.minecraft.item.ItemStack; import net.minecraft.state.StateContainer.Builder; import net.minecraft.state.properties.BlockStateProperties; +import net.minecraft.util.ActionResultType; import net.minecraft.util.Direction; import net.minecraft.util.Direction.Axis; import net.minecraft.util.Direction.AxisDirection; +import net.minecraft.util.Hand; import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.shapes.ISelectionContext; import net.minecraft.util.math.shapes.VoxelShape; import net.minecraft.world.IBlockReader; import net.minecraft.world.IWorld; import net.minecraft.world.World; +import static com.simibubi.create.content.contraptions.components.structureMovement.piston.MechanicalPistonBlock.*; + public class PistonExtensionPoleBlock extends ProperDirectionalBlock implements IWrenchable, IWaterLoggable { public PistonExtensionPoleBlock(Properties properties) { @@ -99,6 +102,34 @@ public class PistonExtensionPoleBlock extends ProperDirectionalBlock implements .with(BlockStateProperties.WATERLOGGED, Boolean.valueOf(ifluidstate.getFluid() == Fluids.WATER)); } + @Override + public ActionResultType onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult ray) { + ItemStack heldItem = player.getHeldItem(hand); + + if (AllBlocks.PISTON_EXTENSION_POLE.isIn(heldItem) && !player.isSneaking()) { + Pair offset = PistonPolePlacementHelper.getPlacementOffset(world, state.get(FACING).getAxis(), pos, ray.getHitVec()); + + if (offset == null || offset.getSecond() == 0) + return ActionResultType.PASS; + + BlockPos newPos = pos.offset(offset.getFirst(), offset.getSecond()); + + if (!world.getBlockState(newPos).getMaterial().isReplaceable()) + return ActionResultType.PASS; + + if (world.isRemote) + return ActionResultType.SUCCESS; + + world.setBlockState(newPos, AllBlocks.PISTON_EXTENSION_POLE.getDefaultState().with(FACING, offset.getFirst())); + if (!player.isCreative()) + heldItem.shrink(1); + + return ActionResultType.SUCCESS; + } + + return ActionResultType.PASS; + } + @Override public IFluidState getFluidState(BlockState state) { return state.get(BlockStateProperties.WATERLOGGED) ? Fluids.WATER.getStillFluidState(false) : Fluids.EMPTY.getDefaultState(); diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/PistonPolePlacementHelper.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/PistonPolePlacementHelper.java new file mode 100644 index 000000000..5559631e6 --- /dev/null +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/PistonPolePlacementHelper.java @@ -0,0 +1,126 @@ +package com.simibubi.create.content.contraptions.components.structureMovement.piston; + +import com.simibubi.create.AllBlocks; +import com.simibubi.create.CreateClient; +import com.simibubi.create.foundation.utility.Iterate; +import com.simibubi.create.foundation.utility.Pair; +import com.simibubi.create.foundation.utility.VecHelper; +import net.minecraft.block.BlockState; +import net.minecraft.client.Minecraft; +import net.minecraft.client.world.ClientWorld; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.util.Direction; +import net.minecraft.util.Hand; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.BlockRayTraceResult; +import net.minecraft.util.math.Vec3d; +import net.minecraft.world.World; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; + +import java.util.Arrays; + +public class PistonPolePlacementHelper { + + @OnlyIn(Dist.CLIENT) + public static void tick() { + Minecraft mc = Minecraft.getInstance(); + ClientWorld world = mc.world; + + if (!(mc.objectMouseOver instanceof BlockRayTraceResult)) + return; + + BlockRayTraceResult ray = (BlockRayTraceResult) mc.objectMouseOver; + + if (!isHoldingPole(mc.player)) + return; + + BlockPos pos = ray.getPos(); + BlockState state = world.getBlockState(pos); + if (!(state.getBlock() instanceof PistonExtensionPoleBlock)) + return; + + Pair offset = getPlacementOffset(world, state.get(PistonExtensionPoleBlock.FACING).getAxis(), pos, ray.getHitVec()); + if (offset == null || offset.getSecond() == 0) + return; + + Direction hitFace = ray.getFace(); + + if (hitFace.getAxis() == offset.getFirst().getAxis()) + return; + + Vec3d hitCenter = VecHelper.getCenterOf(pos).add(new Vec3d(hitFace.getDirectionVec()).scale(0.3)); + + //get the two perpendicular directions to form the arrow + Direction[] directions = Arrays.stream(Direction.Axis.values()).filter(axis -> axis != hitFace.getAxis() && axis != offset.getFirst().getAxis()).map(Iterate::directionsInAxis).findFirst().orElse(new Direction[]{}); + Vec3d startOffset = new Vec3d(offset.getFirst().getDirectionVec()); + Vec3d start = hitCenter.add(startOffset); + for (Direction dir : directions) { + Vec3d arrowOffset = new Vec3d(dir.getDirectionVec()).scale(.25); + Vec3d target = hitCenter.add(startOffset.scale(0.75)).add(arrowOffset); + CreateClient.outliner.showLine("poleHelp" + offset.getFirst() + dir, start, target).lineWidth(1/16f); + } + } + + // first indicates the direction that the position needs to be offset into + // second indicates by how many blocks the position needs to be offset by; is 0 if there was no valid position on either end of the pole + public static Pair getPlacementOffset(World world, Direction.Axis poleAxis, BlockPos pos, Vec3d hit) { + Pair offset = null; + double min = Double.MAX_VALUE; + Vec3d localPos = hit.subtract(VecHelper.getCenterOf(pos)); + + //find target direction + for (Direction dir : Iterate.directionsInAxis(poleAxis)) { + double distance = new Vec3d(dir.getDirectionVec()).distanceTo(localPos); + if (distance > min) + continue; + min = distance; + offset = Pair.of(dir, 0); + } + + if (offset == null)//?? + return null; + + //check for space at the end of the pole + int poles = attachedPoles(world, pos, offset.getFirst()); + BlockState state = world.getBlockState(pos.offset(offset.getFirst(), poles + 1)); + + if (state.getMaterial().isReplaceable()) { + offset.setSecond(poles + 1); + return offset; + } + + //check the other end of the pole + offset.setFirst(offset.getFirst().getOpposite()); + poles = attachedPoles(world, pos, offset.getFirst()); + state = world.getBlockState(pos.offset(offset.getFirst(), poles + 1)); + + if (state.getMaterial().isReplaceable()) { + offset.setSecond(poles + 1); + } + + return offset; + } + + public static int attachedPoles(World world, BlockPos pos, Direction direction) { + BlockPos checkPos = pos.offset(direction); + BlockState state = world.getBlockState(checkPos); + int count = 0; + while (matchesAxis(state, direction.getAxis())) { + count++; + checkPos = checkPos.offset(direction); + state = world.getBlockState(checkPos); + } + return count; + } + + //checks if the given state is a piston pole on the given axis + public static boolean matchesAxis(BlockState state, Direction.Axis axis) { + return AllBlocks.PISTON_EXTENSION_POLE.has(state) && state.get(PistonExtensionPoleBlock.FACING).getAxis() == axis; + } + + public static boolean isHoldingPole(PlayerEntity player) { + return Arrays.stream(Hand.values()).anyMatch(hand -> AllBlocks.PISTON_EXTENSION_POLE.isIn(player.getHeldItem(hand))); + } + +} diff --git a/src/main/java/com/simibubi/create/content/contraptions/goggles/GoggleOverlayRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/goggles/GoggleOverlayRenderer.java index f3ee2f579..fcab3bcda 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/goggles/GoggleOverlayRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/goggles/GoggleOverlayRenderer.java @@ -1,19 +1,21 @@ package com.simibubi.create.content.contraptions.goggles; -import java.util.ArrayList; -import java.util.List; - import com.mojang.blaze3d.systems.RenderSystem; +import com.simibubi.create.AllBlocks; import com.simibubi.create.AllItems; +import com.simibubi.create.content.contraptions.components.structureMovement.piston.PistonExtensionPoleBlock; +import com.simibubi.create.content.contraptions.components.structureMovement.piston.PistonPolePlacementHelper; import com.simibubi.create.foundation.config.AllConfigs; import com.simibubi.create.foundation.gui.GuiGameElement; - +import com.simibubi.create.foundation.utility.Iterate; +import net.minecraft.block.BlockState; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.world.ClientWorld; import net.minecraft.inventory.EquipmentSlotType; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.Direction; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.RayTraceResult; @@ -24,6 +26,11 @@ import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod.EventBusSubscriber; +import java.util.ArrayList; +import java.util.List; + +import static com.simibubi.create.content.contraptions.goggles.IHaveGoggleInformation.spacing; + @EventBusSubscriber(value = Dist.CLIENT) public class GoggleOverlayRenderer { @@ -41,36 +48,52 @@ public class GoggleOverlayRenderer { Minecraft mc = Minecraft.getInstance(); ClientWorld world = mc.world; BlockPos pos = result.getPos(); - ItemStack goggles = mc.player.getItemStackFromSlot(EquipmentSlotType.HEAD); + ItemStack headSlot = mc.player.getItemStackFromSlot(EquipmentSlotType.HEAD); TileEntity te = world.getTileEntity(pos); - boolean goggleInformation = te instanceof IHaveGoggleInformation; - boolean hoveringInformation = te instanceof IHaveHoveringInformation; + boolean wearingGoggles = AllItems.GOGGLES.isIn(headSlot); - if (!goggleInformation && !hoveringInformation) - return; + boolean hasGoggleInformation = te instanceof IHaveGoggleInformation; + boolean hasHoveringInformation = te instanceof IHaveHoveringInformation; + + boolean goggleAddedInformation = false; + boolean hoverAddedInformation = false; List tooltip = new ArrayList<>(); - if (goggleInformation && AllItems.GOGGLES.isIn(goggles)) { + if (hasGoggleInformation && wearingGoggles) { IHaveGoggleInformation gte = (IHaveGoggleInformation) te; - if (!gte.addToGoggleTooltip(tooltip, mc.player.isSneaking())) - goggleInformation = false; + goggleAddedInformation = gte.addToGoggleTooltip(tooltip, mc.player.isSneaking()); } - if (hoveringInformation) { - boolean goggleAddedInformation = !tooltip.isEmpty(); - if (goggleAddedInformation) + if (hasHoveringInformation) { + if (!tooltip.isEmpty()) tooltip.add(""); IHaveHoveringInformation hte = (IHaveHoveringInformation) te; - if (!hte.addToTooltip(tooltip, mc.player.isSneaking())) - hoveringInformation = false; - if (goggleAddedInformation && !hoveringInformation) + hoverAddedInformation = hte.addToTooltip(tooltip, mc.player.isSneaking()); + + if (goggleAddedInformation && !hoverAddedInformation) tooltip.remove(tooltip.size() - 1); } - if (!goggleInformation && !hoveringInformation) + //break early if goggle or hover returned false when present + if ((hasGoggleInformation && !goggleAddedInformation) && (hasHoveringInformation && !hoverAddedInformation)) return; + + //check for piston poles if goggles are worn + BlockState state = world.getBlockState(pos); + if (wearingGoggles && AllBlocks.PISTON_EXTENSION_POLE.has(state)) { + Direction[] directions = Iterate.directionsInAxis(state.get(PistonExtensionPoleBlock.FACING).getAxis()); + int poles = 1; + for (Direction dir : directions) + poles += PistonPolePlacementHelper.attachedPoles(world, pos, dir); + + if (!tooltip.isEmpty()) + tooltip.add(""); + + tooltip.add(spacing + "Pole length: " + poles); + } + if (tooltip.isEmpty()) return; @@ -87,7 +110,6 @@ public class GoggleOverlayRenderer { GuiGameElement.of(item).at(posX + 10, posY - 16).render(); RenderSystem.popMatrix(); } - private static final class TooltipScreen extends Screen { private TooltipScreen(ITextComponent p_i51108_1_) { diff --git a/src/main/java/com/simibubi/create/content/logistics/block/inventories/CrateBlock.java b/src/main/java/com/simibubi/create/content/logistics/block/inventories/CrateBlock.java index 12ff27a6e..a54b6b92b 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/inventories/CrateBlock.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/inventories/CrateBlock.java @@ -3,7 +3,6 @@ package com.simibubi.create.content.logistics.block.inventories; import com.simibubi.create.AllShapes; import com.simibubi.create.content.contraptions.wrench.IWrenchable; import com.simibubi.create.foundation.block.ProperDirectionalBlock; - import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.item.BlockItemUseContext; @@ -80,6 +79,11 @@ public class CrateBlock extends ProperDirectionalBlock implements IWrenchable { return getDefaultState(); } + @Override + public BlockState getRotatedBlockState(BlockState originalState, Direction targetedFace) { + return originalState; + } + @Override protected void fillStateContainer(Builder builder) { super.fillStateContainer(builder.add(DOUBLE)); diff --git a/src/main/java/com/simibubi/create/content/logistics/block/redstone/RedstoneContactBlock.java b/src/main/java/com/simibubi/create/content/logistics/block/redstone/RedstoneContactBlock.java index 5815f778b..a467c4cd4 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/redstone/RedstoneContactBlock.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/redstone/RedstoneContactBlock.java @@ -1,14 +1,7 @@ package com.simibubi.create.content.logistics.block.redstone; -import java.util.Random; - -import javax.annotation.Nullable; -import javax.annotation.ParametersAreNonnullByDefault; - import com.simibubi.create.AllBlocks; -import com.simibubi.create.content.contraptions.wrench.IWrenchable; import com.simibubi.create.foundation.block.ProperDirectionalBlock; - import mcp.MethodsReturnNonnullByDefault; import net.minecraft.block.Block; import net.minecraft.block.BlockState; @@ -23,9 +16,13 @@ import net.minecraft.world.IWorld; import net.minecraft.world.World; import net.minecraft.world.server.ServerWorld; +import javax.annotation.Nullable; +import javax.annotation.ParametersAreNonnullByDefault; +import java.util.Random; + @ParametersAreNonnullByDefault @MethodsReturnNonnullByDefault -public class RedstoneContactBlock extends ProperDirectionalBlock implements IWrenchable { +public class RedstoneContactBlock extends ProperDirectionalBlock { public static final BooleanProperty POWERED = BlockStateProperties.POWERED; diff --git a/src/main/java/com/simibubi/create/content/logistics/block/redstone/RedstoneLinkBlock.java b/src/main/java/com/simibubi/create/content/logistics/block/redstone/RedstoneLinkBlock.java index bedc6d494..8d645f75b 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/redstone/RedstoneLinkBlock.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/redstone/RedstoneLinkBlock.java @@ -2,12 +2,10 @@ package com.simibubi.create.content.logistics.block.redstone; import com.simibubi.create.AllShapes; import com.simibubi.create.AllTileEntities; -import com.simibubi.create.content.contraptions.wrench.IWrenchable; import com.simibubi.create.content.logistics.block.funnel.FunnelBlock; import com.simibubi.create.foundation.block.ITE; import com.simibubi.create.foundation.block.ProperDirectionalBlock; import com.simibubi.create.foundation.utility.Iterate; - import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.entity.player.PlayerEntity; @@ -28,7 +26,7 @@ import net.minecraft.world.IBlockReader; import net.minecraft.world.IWorldReader; import net.minecraft.world.World; -public class RedstoneLinkBlock extends ProperDirectionalBlock implements ITE, IWrenchable { +public class RedstoneLinkBlock extends ProperDirectionalBlock implements ITE { public static final BooleanProperty POWERED = BlockStateProperties.POWERED; public static final BooleanProperty RECEIVER = BooleanProperty.create("receiver"); @@ -152,7 +150,12 @@ public class RedstoneLinkBlock extends ProperDirectionalBlock implements ITE hereAndBelow(BlockPos pos) { return Arrays.asList(pos, pos.down()); } - - }