Rotation Speed Controller

- Added the Rotation Speed Controller for achieving precise speed values in survival mode (like the motor in 0.1)
- Introduced a builder pattern for voxelshape(r) creation
This commit is contained in:
simibubi 2020-02-28 22:17:40 +01:00
parent 068b7c0c37
commit b8eb35e5c5
27 changed files with 690 additions and 359 deletions

View file

@ -40,6 +40,7 @@ import com.simibubi.create.modules.contraptions.components.waterwheel.WaterWheel
import com.simibubi.create.modules.contraptions.processing.BasinBlock;
import com.simibubi.create.modules.contraptions.redstone.AnalogLeverBlock;
import com.simibubi.create.modules.contraptions.redstone.ContactBlock;
import com.simibubi.create.modules.contraptions.relays.advanced.SpeedControllerBlock;
import com.simibubi.create.modules.contraptions.relays.belt.BeltBlock;
import com.simibubi.create.modules.contraptions.relays.belt.BeltTunnelBlock;
import com.simibubi.create.modules.contraptions.relays.elementary.CogWheelBlock;
@ -165,6 +166,7 @@ public enum AllBlocks {
MECHANICAL_CRAFTER(new MechanicalCrafterBlock()),
FLYWHEEL(new FlywheelBlock()),
FURNACE_ENGINE(new FurnaceEngineBlock()),
ROTATION_SPEED_CONTROLLER(new SpeedControllerBlock()),
__LOGISTICS__(),
CONTACT(new ContactBlock()),

View file

@ -48,6 +48,8 @@ import com.simibubi.create.modules.contraptions.processing.BasinTileEntity;
import com.simibubi.create.modules.contraptions.processing.BasinTileEntityRenderer;
import com.simibubi.create.modules.contraptions.redstone.AnalogLeverTileEntity;
import com.simibubi.create.modules.contraptions.redstone.AnalogLeverTileEntityRenderer;
import com.simibubi.create.modules.contraptions.relays.advanced.SpeedControllerRenderer;
import com.simibubi.create.modules.contraptions.relays.advanced.SpeedControllerTileEntity;
import com.simibubi.create.modules.contraptions.relays.belt.BeltTileEntity;
import com.simibubi.create.modules.contraptions.relays.belt.BeltTileEntityRenderer;
import com.simibubi.create.modules.contraptions.relays.belt.BeltTunnelTileEntity;
@ -119,7 +121,10 @@ public enum AllTileEntities {
MECHANICAL_BEARING(MechanicalBearingTileEntity::new, AllBlocks.MECHANICAL_BEARING),
CLOCKWORK_BEARING(ClockworkBearingTileEntity::new, AllBlocks.CLOCKWORK_BEARING),
ROPE_PULLEY(PulleyTileEntity::new, AllBlocks.ROPE_PULLEY),
CHASSIS(ChassisTileEntity::new, AllBlocks.ROTATION_CHASSIS, AllBlocks.TRANSLATION_CHASSIS,
CHASSIS(
ChassisTileEntity::new,
AllBlocks.ROTATION_CHASSIS,
AllBlocks.TRANSLATION_CHASSIS,
AllBlocks.TRANSLATION_CHASSIS_SECONDARY),
DRILL(DrillTileEntity::new, AllBlocks.DRILL),
SAW(SawTileEntity::new, AllBlocks.SAW),
@ -134,6 +139,7 @@ public enum AllTileEntities {
DEPLOYER(DeployerTileEntity::new, AllBlocks.DEPLOYER),
BASIN(BasinTileEntity::new, AllBlocks.BASIN),
MECHANICAL_CRAFTER(MechanicalCrafterTileEntity::new, AllBlocks.MECHANICAL_CRAFTER),
ROTATION_SPEED_CONTROLLER(SpeedControllerTileEntity::new, AllBlocks.ROTATION_SPEED_CONTROLLER),
SPEED_GAUGE(SpeedGaugeTileEntity::new, AllBlocks.SPEED_GAUGE),
STRESS_GAUGE(StressGaugeTileEntity::new, AllBlocks.STRESS_GAUGE),
ANALOG_LEVER(AnalogLeverTileEntity::new, AllBlocks.ANALOG_LEVER),
@ -145,7 +151,9 @@ public enum AllTileEntities {
EXTRACTOR(ExtractorTileEntity::new, AllBlocks.EXTRACTOR, AllBlocks.VERTICAL_EXTRACTOR),
LINKED_EXTRACTOR(LinkedExtractorTileEntity::new, AllBlocks.LINKED_EXTRACTOR, AllBlocks.VERTICAL_LINKED_EXTRACTOR),
TRANSPOSER(TransposerTileEntity::new, AllBlocks.TRANSPOSER, AllBlocks.VERTICAL_TRANSPOSER),
LINKED_TRANSPOSER(LinkedTransposerTileEntity::new, AllBlocks.LINKED_TRANSPOSER,
LINKED_TRANSPOSER(
LinkedTransposerTileEntity::new,
AllBlocks.LINKED_TRANSPOSER,
AllBlocks.VERTICAL_LINKED_TRANSPOSER),
BELT_FUNNEL(FunnelTileEntity::new, AllBlocks.BELT_FUNNEL, AllBlocks.VERTICAL_FUNNEL),
ENTITY_DETECTOR(BeltObserverTileEntity::new, AllBlocks.ENTITY_DETECTOR),
@ -220,6 +228,7 @@ public enum AllTileEntities {
bind(DeployerTileEntity.class, new DeployerTileEntityRenderer());
bind(FlywheelTileEntity.class, new FlywheelRenderer());
bind(FurnaceEngineTileEntity.class, new EngineRenderer<>());
bind(SpeedControllerTileEntity.class, new SpeedControllerRenderer());
bind(RedstoneLinkTileEntity.class, new SmartTileEntityRenderer<>());
bind(ExtractorTileEntity.class, new SmartTileEntityRenderer<>());

View file

@ -44,7 +44,7 @@ public class ValueBoxRenderer {
AxisAlignedBB bb = box.bb;
WorldRenderer.drawBoundingBox(bufferbuilder, bb.minX, bb.minY, bb.minZ, bb.maxX, bb.maxY, bb.maxZ,
(float) color.x, (float) color.y, (float) color.z, 1f);
GlStateManager.lineWidth(2);
GlStateManager.lineWidth(1);
TessellatorHelper.draw();
GlStateManager.enableTexture();

View file

@ -11,7 +11,7 @@ public class ScrollOptionBehaviour<E extends Enum<E> & INamedIconOptions> extend
super(label, te, slot);
options = enum_.getEnumConstants();
between(0, options.length - 1);
withStepFunction((i, b) -> -1);
withStepFunction((c) -> -1);
}
INamedIconOptions getIconForSelected() {

View file

@ -1,6 +1,5 @@
package com.simibubi.create.foundation.behaviour.scrollvalue;
import java.util.function.BiFunction;
import java.util.function.Consumer;
import java.util.function.Function;
@ -34,7 +33,7 @@ public class ScrollValueBehaviour extends TileEntityBehaviour {
Consumer<Integer> clientCallback;
Function<Integer, String> formatter;
Function<Integer, String> unit;
BiFunction<Integer, Boolean, Integer> step;
Function<StepContext, Integer> step;
boolean needsWrench;
public ScrollValueBehaviour(String label, SmartTileEntity te, ValueBoxTransform slot) {
@ -47,7 +46,7 @@ public class ScrollValueBehaviour extends TileEntityBehaviour {
};
textShift = Vec3d.ZERO;
formatter = i -> Integer.toString(i);
step = (i, b) -> 1;
step = (c) -> 1;
value = 0;
ticksUntilScrollPacket = -1;
}
@ -130,7 +129,7 @@ public class ScrollValueBehaviour extends TileEntityBehaviour {
return this;
}
public ScrollValueBehaviour withStepFunction(BiFunction<Integer, Boolean, Integer> step) {
public ScrollValueBehaviour withStepFunction(Function<StepContext, Integer> step) {
this.step = step;
return this;
}
@ -176,5 +175,12 @@ public class ScrollValueBehaviour extends TileEntityBehaviour {
public void setLabel(String label) {
this.label = label;
}
public static class StepContext {
public int currentValue;
public boolean forward;
public boolean shift;
public boolean control;
}
}

View file

@ -5,6 +5,7 @@ import com.simibubi.create.AllKeys;
import com.simibubi.create.foundation.behaviour.ValueBoxTransform.Sided;
import com.simibubi.create.foundation.behaviour.base.SmartTileEntity;
import com.simibubi.create.foundation.behaviour.base.TileEntityBehaviour;
import com.simibubi.create.foundation.behaviour.scrollvalue.ScrollValueBehaviour.StepContext;
import net.minecraft.client.Minecraft;
import net.minecraft.client.world.ClientWorld;
@ -59,10 +60,16 @@ public class ScrollValueHandler {
protected static void applyTo(double delta, ScrollValueBehaviour scrolling) {
scrolling.ticksUntilScrollPacket = 10;
int valueBefore = scrolling.scrollableValue;
scrolling.scrollableValue = (int) MathHelper.clamp(
scrolling.scrollableValue
+ Math.signum(delta) * scrolling.step.apply(scrolling.scrollableValue, delta > 0),
scrolling.min, scrolling.max);
StepContext context = new StepContext();
context.control = AllKeys.ctrlDown();
context.shift = AllKeys.shiftDown();
context.currentValue = scrolling.scrollableValue;
context.forward = delta > 0;
double newValue = scrolling.scrollableValue + Math.signum(delta) * scrolling.step.apply(context);
scrolling.scrollableValue = (int) MathHelper.clamp(newValue, scrolling.min, scrolling.max);
if (valueBefore != scrolling.scrollableValue)
scrolling.clientCallback.accept(scrolling.scrollableValue);
}

View file

@ -1,175 +1,175 @@
package com.simibubi.create.foundation.utility;
import static net.minecraft.block.Block.makeCuboidShape;
import static net.minecraft.util.Direction.EAST;
import static net.minecraft.util.Direction.SOUTH;
import static net.minecraft.util.Direction.UP;
import java.util.Arrays;
import java.util.function.BiFunction;
import net.minecraft.block.Block;
import net.minecraft.block.Blocks;
import net.minecraft.block.DirectionalBlock;
import net.minecraft.block.PistonHeadBlock;
import net.minecraft.util.Direction;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.Direction.Axis;
import net.minecraft.util.math.shapes.IBooleanFunction;
import net.minecraft.util.math.shapes.VoxelShape;
import net.minecraft.util.math.shapes.VoxelShapes;
public class AllShapes {
// Independent Shapers
public static final VoxelShaper
SHORT_CASING_14_VOXEL = VoxelShaper.forDirectional(makeCuboidShape(0, 0, 0, 16, 14, 16), Direction.UP),
SHORT_CASING_12_VOXEL = VoxelShaper.forDirectional(makeCuboidShape(0, 0, 0, 16, 12, 16), Direction.UP),
SHORT_CASING_11_VOXEL = VoxelShaper.forDirectional(makeCuboidShape(0, 0, 0, 16, 11, 16), Direction.UP),
HARVESTER_BASE = VoxelShaper.forHorizontal(makeCuboidShape(0, 2, 0, 16, 14, 3), Direction.SOUTH),
MOTOR_BLOCK = VoxelShaper.forHorizontal(makeCuboidShape(0, 3, 3, 16, 13, 13), Direction.EAST),
FOUR_VOXEL_POLE = VoxelShaper.forDirectionalAxis(makeCuboidShape(6, 0, 6, 10, 16, 10), Direction.Axis.Y),
SIX_VOXEL_POLE = VoxelShaper.forDirectionalAxis(makeCuboidShape(5, 0, 5, 11, 16, 11), Direction.Axis.Y),
BELT_FUNNEL = VoxelShaper.forHorizontal(makeCuboidShape(3, -4, 11, 13, 8, 17), Direction.SOUTH),
FUNNEL = VoxelShaper.forDirectional(makeCuboidShape(1, 1, 13, 15, 15, 17), Direction.SOUTH),
EXTRACTOR = VoxelShaper.forDirectional(makeCuboidShape(4, 2, 11, 12, 10, 17), Direction.SOUTH)
.withVerticalShapes(makeCuboidShape(4, 11, 4, 12, 17, 12)),
TRANSPOSER = VoxelShaper.forDirectional(VoxelShapes.or(
makeCuboidShape(4, 4, -1, 12, 12, 1),
makeCuboidShape(5, 5, 0, 11, 11, 16),
makeCuboidShape(4, 4, 11, 12, 12, 17)), Direction.SOUTH),
FURNACE_ENGINE = VoxelShaper.forHorizontal(VoxelShapes.or(
makeCuboidShape(1, 1, 0, 15, 15, 16),
makeCuboidShape(0, 0, 9, 16, 16, 14)), Direction.SOUTH),
PORTABLE_STORAGE_INTERFACE = VoxelShaper.forDirectional(VoxelShapes.or(
makeCuboidShape(0, 0, 0, 16, 12, 16),
makeCuboidShape(3, 12, 3, 13, 16, 13)), Direction.UP),
PULLEY = VoxelShaper.forHorizontalAxis(VoxelShapes.or(
makeCuboidShape(0, 0, 0, 16, 16, 2),
makeCuboidShape(1, 1, 2, 15, 15, 14),
makeCuboidShape(0, 0, 14, 16, 16, 16)), Direction.SOUTH)
;
SHORT_CASING_14_VOXEL = shape(0, 0, 0, 16, 14, 16).forDirectional(),
SHORT_CASING_12_VOXEL = shape(0, 0, 0, 16, 12, 16).forDirectional(),
SHORT_CASING_11_VOXEL = shape(0, 0, 0, 16, 11, 16).forDirectional(),
MOTOR_BLOCK = shape(0, 3, 3, 16, 13, 13).forHorizontal(EAST),
FOUR_VOXEL_POLE = shape(6, 0, 6, 10, 16, 10).forAxis(),
SIX_VOXEL_POLE = shape(5, 0, 5, 11, 16, 11).forAxis(),
BELT_FUNNEL = shape(3, -4, 11, 13, 8, 17).forHorizontal(SOUTH),
FUNNEL = shape(1, 1, 13, 15, 15, 17).forDirectional(SOUTH),
EXTRACTOR = shape(4, 2, 11, 12, 10, 17).forDirectional(SOUTH)
.withVerticalShapes(cuboid(4, 11, 4, 12, 17, 12)),
TRANSPOSER = shape(4, 4, -1, 12, 12, 1).add(5, 5, 0, 11, 11, 16).add(4, 4, 11, 12, 12, 17)
.forDirectional(SOUTH),
FURNACE_ENGINE = shape(1, 1, 0, 15, 15, 16).add(0, 0, 9, 16, 16, 14).forHorizontal(Direction.SOUTH),
PORTABLE_STORAGE_INTERFACE = shape(0, 0, 0, 16, 12, 16).add(3, 12, 3, 13, 16, 13).forDirectional(),
PULLEY = shape(0, 0, 0, 16, 16, 2).add(1, 1, 2, 15, 15, 14).add(0, 0, 14, 16, 16, 16).forHorizontalAxis(),
SPEED_CONTROLLER = shape(0, 0, 0, 16, 2, 16).add(1, 1, 1, 15, 15, 15).erase(0, 8, 5, 16, 16, 11)
.add(2, 9, 2, 14, 14, 14).erase(6, 11, 0, 10, 16, 16).forHorizontalAxis(),
HARVESTER_BASE = shape(0, 2, 0, 16, 14, 3).forDirectional(SOUTH)
;
// Internally Shared Shapes (TODO: Use builder pattern)
private static final VoxelShape
LOGISTICAL_CASING_MIDDLE_SHAPE = VoxelShapes.or(
makeCuboidShape(1,0,1,15,16,15),
makeCuboidShape(0,0,0,2,16,2),
makeCuboidShape(14,0,0,16,16,2),
makeCuboidShape(0,0,14,2,16,16),
makeCuboidShape(14,0,14,16,16,16)),
LOGISTICAL_CASING_CAP_SHAPE = VoxelShapes.or(
LOGISTICAL_CASING_MIDDLE_SHAPE,
makeCuboidShape(0,0,0,16,2,16)),
CART_ASSEMBLER_SHAPE = VoxelShapes.or(
VoxelShapes.fullCube(),
makeCuboidShape(-2, 0, 1, 18, 13, 15)),
MECHANICAL_PISTON_HEAD_SHAPE_UP = Blocks.PISTON_HEAD.getStateContainer().getBaseState().with(DirectionalBlock.FACING, Direction.UP).with(PistonHeadBlock.SHORT, true).getShape(null, null),
MECHANICAL_PISTON_EXTENDED_SHAPE_UP = VoxelShapes.or(
SHORT_CASING_12_VOXEL.get(Direction.UP),
FOUR_VOXEL_POLE.get(Direction.Axis.Y)),
SMALL_GEAR_SHAPE = makeCuboidShape(2, 6, 2, 14, 10, 14),
LARGE_GEAR_SHAPE = makeCuboidShape(0, 6, 0, 16, 10, 16),
VERTICAL_TABLET_SHAPE_SOUTH = makeCuboidShape(3, 1, -1, 13, 15, 3),
SQUARE_TABLET_SHAPE_SOUTH = makeCuboidShape(2, 2, -1, 14, 14, 3),
PACKAGE_FUNNEL_SHAPE_UP = makeCuboidShape(1, -1, 1, 15, 3, 15),
TABLE_POLE_SHAPE = VoxelShapes.or(
makeCuboidShape(4, 0, 4, 12, 2, 12),
makeCuboidShape(5, 2, 5, 11, 14, 11)),
LOGISTICS_TABLE_SLOPE_SOUTH = VoxelShapes.or(
makeCuboidShape(0, 10D, 15, 16, 14, 10.667),
makeCuboidShape(0, 12, 10.667, 16, 16, 6.333),
makeCuboidShape(0, 14, 6.333, 16, 18, 2)),
SCHEMATICS_TABLE_SLOPE_SOUTH = VoxelShapes.or(
makeCuboidShape(0, 10, 16, 16, 14, 11),
makeCuboidShape(0, 12, 11, 16, 16, 6),
makeCuboidShape(0, 14, 6, 16, 18, 1)),
GAUGE_SHAPE_UP = VoxelShapes.or(
makeCuboidShape(1, 0, 0, 15, 2, 16),//plate
makeCuboidShape(2, 2, 1, 14, 14, 15)),//log
NOZZLE_SHAPE_UP = VoxelShapes.or(
makeCuboidShape(2, 0, 2, 14, 14, 14),
VoxelShapes.combine(
makeCuboidShape(1, 13, 1, 15, 15, 15),
makeCuboidShape(3, 13, 3, 13, 15, 13),
IBooleanFunction.ONLY_FIRST)),
CRANK_SHAPE_UP = VoxelShapes.or(
makeCuboidShape(5, 0, 5, 11, 6, 11),
makeCuboidShape(1, 3, 1, 15, 8, 15)
)
;
CART_ASSEMBLER_SHAPE = VoxelShapes.or(VoxelShapes.fullCube(), makeCuboidShape(-2, 0, 1, 18, 13, 15)),
MECHANICAL_PISTON_HEAD_SHAPE_UP = Blocks.PISTON_HEAD.getStateContainer().getBaseState()
.with(DirectionalBlock.FACING, UP).with(PistonHeadBlock.SHORT, true).getShape(null, null),
MECHANICAL_PISTON_EXTENDED_SHAPE_UP = VoxelShapes.or(SHORT_CASING_12_VOXEL.get(UP),
FOUR_VOXEL_POLE.get(Direction.Axis.Y)),
SMALL_GEAR_SHAPE = makeCuboidShape(2, 6, 2, 14, 10, 14),
LARGE_GEAR_SHAPE = makeCuboidShape(0, 6, 0, 16, 10, 16),
VERTICAL_TABLET_SHAPE_SOUTH = makeCuboidShape(3, 1, -1, 13, 15, 3),
SQUARE_TABLET_SHAPE_SOUTH = makeCuboidShape(2, 2, -1, 14, 14, 3),
LOGISTICS_TABLE_SLOPE_SOUTH = VoxelShapes.or(makeCuboidShape(0, 10D, 15, 16, 14, 10.667),
makeCuboidShape(0, 12, 10.667, 16, 16, 6.333), makeCuboidShape(0, 14, 6.333, 16, 18, 2)),
SCHEMATICS_TABLE_SLOPE_SOUTH = VoxelShapes.or(makeCuboidShape(0, 10, 16, 16, 14, 11),
makeCuboidShape(0, 12, 11, 16, 16, 6), makeCuboidShape(0, 14, 6, 16, 18, 1)),
NOZZLE_SHAPE_UP = VoxelShapes.or(makeCuboidShape(2, 0, 2, 14, 14, 14),
VoxelShapes.combine(makeCuboidShape(1, 13, 1, 15, 15, 15), makeCuboidShape(3, 13, 3, 13, 15, 13),
IBooleanFunction.ONLY_FIRST)),
CRANK_SHAPE_UP = VoxelShapes.or(makeCuboidShape(5, 0, 5, 11, 6, 11), makeCuboidShape(1, 3, 1, 15, 8, 15))
;
// Static Block Shapes
public static final VoxelShape
LOGISTICAL_CASING_SINGLE_SHAPE = VoxelShapes.or(
makeCuboidShape(0, 0, 0, 16, 2, 16),
makeCuboidShape(1, 1, 1, 15, 15, 15),
makeCuboidShape(0, 14, 0, 16, 16, 16)),
BASIN_BLOCK_SHAPE = VoxelShapes.or(
makeCuboidShape(2, 0, 2, 14, 2, 14),
VoxelShapes.combine(
makeCuboidShape(0, 2, 0, 16, 13, 16),
makeCuboidShape(2, 5, 2, 14, 14, 14),
IBooleanFunction.ONLY_FIRST)),
CRUSHING_WHEEL_COLLISION_SHAPE = makeCuboidShape(0, 0, 0, 16, 22, 16),
MECHANICAL_PROCESSOR_SHAPE = VoxelShapes.combineAndSimplify(
VoxelShapes.fullCube(),
makeCuboidShape(4, 0, 4, 12, 16, 12),
IBooleanFunction.ONLY_FIRST),
TURNTABLE_SHAPE = VoxelShapes.or(
makeCuboidShape(1, 4, 1, 15, 8, 15),
makeCuboidShape(5, 0, 5, 11, 4, 11)),
CRATE_BLOCK_SHAPE = makeCuboidShape(1, 0, 1, 15, 14, 15),
LOGISTICS_TABLE_BASE = TABLE_POLE_SHAPE,
BELT_COLLISION_MASK = makeCuboidShape(0, 0, 0, 16, 19, 16),
SCHEMATICANNON_SHAPE = VoxelShapes.or(
makeCuboidShape(1, 0, 1, 15, 8, 15),
makeCuboidShape(0.5, 8, 0.5, 15.5, 11, 15.5)),
PULLEY_MAGNET = VoxelShapes.or(
makeCuboidShape(3, 0, 3, 13, 2, 13),
FOUR_VOXEL_POLE.get(Direction.UP))
;
BASIN_BLOCK_SHAPE = shape(0, 2, 0, 16, 13, 16).erase(2, 5, 2, 14, 14, 14).add(2, 0, 2, 14, 2, 14).build(),
CRUSHING_WHEEL_COLLISION_SHAPE = cuboid(0, 0, 0, 16, 22, 16),
MECHANICAL_PROCESSOR_SHAPE = shape(VoxelShapes.fullCube()).erase(4, 0, 4, 12, 16, 12).build(),
TURNTABLE_SHAPE = shape(1, 4, 1, 15, 8, 15).add(5, 0, 5, 11, 4, 11).build(),
CRATE_BLOCK_SHAPE = cuboid(1, 0, 1, 15, 14, 15),
TABLE_POLE_SHAPE = shape(4, 0, 4, 12, 2, 12).add(5, 2, 5, 11, 14, 11).build(),
BELT_COLLISION_MASK = cuboid(0, 0, 0, 16, 19, 16),
SCHEMATICANNON_SHAPE = shape(1, 0, 1, 15, 8, 15).add(0.5, 8, 0.5, 15.5, 11, 15.5).build(),
PULLEY_MAGNET = shape(3, 0, 3, 13, 2, 13).add(FOUR_VOXEL_POLE.get(UP)).build(),
GAUGE_SHAPE_UP = shape(1, 0, 0, 15, 2, 16).add(2, 2, 1, 14, 14, 15).build()
;
// Advanced Shapers (TODO: Use builder pattern)
public static final VoxelShaper
LOGISTICAL_CASING_MIDDLE = VoxelShaper.forDirectional(LOGISTICAL_CASING_MIDDLE_SHAPE, Direction.UP),
LOGISTICAL_CASING_CAP = VoxelShaper.forDirectional(LOGISTICAL_CASING_CAP_SHAPE, Direction.UP),
NOZZLE = VoxelShaper.forDirectional(NOZZLE_SHAPE_UP, Direction.UP),
CRANK = VoxelShaper.forDirectional(CRANK_SHAPE_UP, Direction.UP),
CART_ASSEMBLER = VoxelShaper.forHorizontalAxis(CART_ASSEMBLER_SHAPE, Direction.SOUTH),
MECHANICAL_PISTON_HEAD = VoxelShaper.forDirectional(MECHANICAL_PISTON_HEAD_SHAPE_UP, Direction.UP),
MECHANICAL_PISTON = SHORT_CASING_12_VOXEL,
MECHANICAL_PISTON_EXTENDED = VoxelShaper.forDirectional(MECHANICAL_PISTON_EXTENDED_SHAPE_UP, Direction.UP),
SMALL_GEAR = VoxelShaper.forDirectionalAxis(VoxelShapes.or(SMALL_GEAR_SHAPE, SIX_VOXEL_POLE.get(Direction.Axis.Y)), Direction.Axis.Y),
LARGE_GEAR = VoxelShaper.forDirectionalAxis(VoxelShapes.or(LARGE_GEAR_SHAPE, SIX_VOXEL_POLE.get(Direction.Axis.Y)), Direction.Axis.Y),
LOGISTICAL_CONTROLLER = VoxelShaper.forDirectional(SQUARE_TABLET_SHAPE_SOUTH, Direction.SOUTH),
REDSTONE_BRIDGE = VoxelShaper.forHorizontal(VERTICAL_TABLET_SHAPE_SOUTH, Direction.SOUTH).withVerticalShapes(LOGISTICAL_CONTROLLER.get(Direction.UP)),
LOGISTICAL_INDEX = REDSTONE_BRIDGE,
PACKAGE_FUNNEL = VoxelShaper.forDirectional(PACKAGE_FUNNEL_SHAPE_UP, Direction.UP),
LOGISTICS_TABLE = VoxelShaper.forHorizontal(VoxelShapes.or(TABLE_POLE_SHAPE, LOGISTICS_TABLE_SLOPE_SOUTH), Direction.SOUTH),
SCHEMATICS_TABLE = VoxelShaper.forDirectional(VoxelShapes.or(TABLE_POLE_SHAPE, SCHEMATICS_TABLE_SLOPE_SOUTH), Direction.SOUTH)
;
NOZZLE = VoxelShaper.forDirectional(NOZZLE_SHAPE_UP, UP), CRANK = VoxelShaper.forDirectional(CRANK_SHAPE_UP, UP),
CART_ASSEMBLER = VoxelShaper.forHorizontalAxis(CART_ASSEMBLER_SHAPE, Axis.Z),
MECHANICAL_PISTON_HEAD = VoxelShaper.forDirectional(MECHANICAL_PISTON_HEAD_SHAPE_UP, UP),
MECHANICAL_PISTON = SHORT_CASING_12_VOXEL,
MECHANICAL_PISTON_EXTENDED = VoxelShaper.forDirectional(MECHANICAL_PISTON_EXTENDED_SHAPE_UP, UP),
SMALL_GEAR = VoxelShaper.forAxis(VoxelShapes.or(SMALL_GEAR_SHAPE, SIX_VOXEL_POLE.get(Direction.Axis.Y)),
Direction.Axis.Y),
LARGE_GEAR = VoxelShaper.forAxis(VoxelShapes.or(LARGE_GEAR_SHAPE, SIX_VOXEL_POLE.get(Direction.Axis.Y)),
Direction.Axis.Y),
LOGISTICAL_CONTROLLER = VoxelShaper.forDirectional(SQUARE_TABLET_SHAPE_SOUTH, SOUTH),
REDSTONE_BRIDGE = VoxelShaper.forHorizontal(VERTICAL_TABLET_SHAPE_SOUTH, SOUTH)
.withVerticalShapes(LOGISTICAL_CONTROLLER.get(UP)),
LOGISTICS_TABLE = VoxelShaper.forHorizontal(VoxelShapes.or(TABLE_POLE_SHAPE, LOGISTICS_TABLE_SLOPE_SOUTH),
SOUTH),
SCHEMATICS_TABLE = VoxelShaper
.forDirectional(VoxelShapes.or(TABLE_POLE_SHAPE, SCHEMATICS_TABLE_SLOPE_SOUTH), SOUTH)
public static final GaugeShaper GAUGE = GaugeShaper.make();
;
public static class GaugeShaper extends VoxelShaper {
private VoxelShaper axisFalse, axisTrue;
private static GaugeShaper make(){
GaugeShaper shaper = new GaugeShaper();
shaper.axisFalse = forDirectional(AllShapes.GAUGE_SHAPE_UP, Direction.UP);
shaper.axisTrue = forDirectional(rotatedCopy(AllShapes.GAUGE_SHAPE_UP, new Vec3d(0, 90, 0)), Direction.UP);
//shapes for X axis need to be swapped
Arrays.asList(Direction.EAST, Direction.WEST).forEach(direction -> {
VoxelShape mem = shaper.axisFalse.get(direction);
shaper.axisFalse.withShape(shaper.axisTrue.get(direction), direction);
shaper.axisTrue.withShape(mem, direction);
});
return shaper;
}
public VoxelShape get(Direction direction, boolean axisAlong) {
return (axisAlong ? axisTrue : axisFalse).get(direction);
}
private static Builder shape(VoxelShape shape) {
return new Builder(shape);
}
private static Builder shape(double x1, double y1, double z1, double x2, double y2, double z2) {
return shape(cuboid(x1, y1, z1, x2, y2, z2));
}
private static VoxelShape cuboid(double x1, double y1, double z1, double x2, double y2, double z2) {
return Block.makeCuboidShape(x1, y1, z1, x2, y2, z2);
}
private static class Builder {
VoxelShape shape;
public Builder(VoxelShape shape) {
this.shape = shape;
}
Builder add(VoxelShape shape) {
this.shape = VoxelShapes.or(this.shape, shape);
return this;
}
Builder add(double x1, double y1, double z1, double x2, double y2, double z2) {
return add(cuboid(x1, y1, z1, x2, y2, z2));
}
Builder erase(double x1, double y1, double z1, double x2, double y2, double z2) {
this.shape = VoxelShapes.combineAndSimplify(shape, cuboid(x1, y1, z1, x2, y2, z2),
IBooleanFunction.ONLY_FIRST);
return this;
}
VoxelShape build() {
return shape;
}
VoxelShaper build(BiFunction<VoxelShape, Direction, VoxelShaper> factory, Direction direction) {
return factory.apply(shape, direction);
}
VoxelShaper build(BiFunction<VoxelShape, Axis, VoxelShaper> factory, Axis axis) {
return factory.apply(shape, axis);
}
VoxelShaper forDirectional(Direction direction) {
return build(VoxelShaper::forDirectional, direction);
}
VoxelShaper forAxis() {
return build(VoxelShaper::forAxis, Axis.Y);
}
VoxelShaper forHorizontalAxis() {
return build(VoxelShaper::forHorizontalAxis, Axis.Z);
}
VoxelShaper forHorizontal(Direction direction) {
return build(VoxelShaper::forHorizontal, direction);
}
VoxelShaper forDirectional() {
return forDirectional(UP);
}
}
}

View file

@ -31,24 +31,15 @@ public class VoxelShaper {
return forDirectionsWithRotation(shape, facing, Direction.Plane.HORIZONTAL, new HorizontalRotationValues());
}
public static VoxelShaper forHorizontalAxis(VoxelShape shape, Direction facing){
return forDirectionsWithRotation(shape, facing, Arrays.asList(Direction.SOUTH, Direction.EAST), new HorizontalRotationValues());
}
public static VoxelShaper forRotatedPillar(VoxelShape zShape) {//todo dunno what this was intended for
VoxelShaper voxelShaper = new VoxelShaper();
for (Axis axis : Axis.values()) {
Direction facing = axisAsFace(axis);
voxelShaper.shapes.put(facing, rotatedCopy(zShape, new Vec3d(0, (int) -facing.getHorizontalAngle(),0)));
}
return voxelShaper;
public static VoxelShaper forHorizontalAxis(VoxelShape shape, Axis along) {
return forDirectionsWithRotation(shape, axisAsFace(along), Arrays.asList(Direction.SOUTH, Direction.EAST), new HorizontalRotationValues());
}
public static VoxelShaper forDirectional(VoxelShape shape, Direction facing){
return forDirectionsWithRotation(shape, facing, Arrays.asList(Direction.values()), new DefaultRotationValues());
}
public static VoxelShaper forDirectionalAxis(VoxelShape shape, Axis along){
public static VoxelShaper forAxis(VoxelShape shape, Axis along){
return forDirectionsWithRotation(shape, axisAsFace(along), Arrays.asList(Direction.SOUTH, Direction.EAST, Direction.UP), new DefaultRotationValues());
}

View file

@ -8,9 +8,11 @@ import static net.minecraft.state.properties.BlockStateProperties.AXIS;
import java.util.LinkedList;
import java.util.List;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.config.AllConfigs;
import com.simibubi.create.modules.contraptions.base.IRotate;
import com.simibubi.create.modules.contraptions.base.KineticTileEntity;
import com.simibubi.create.modules.contraptions.relays.advanced.SpeedControllerTileEntity;
import com.simibubi.create.modules.contraptions.relays.belt.BeltTileEntity;
import com.simibubi.create.modules.contraptions.relays.encased.EncasedBeltBlock;
import com.simibubi.create.modules.contraptions.relays.encased.SplitShaftTileEntity;
@ -50,9 +52,9 @@ public class RotationPropagator {
if (axis.getCoordinate(diff.getX(), diff.getY(), diff.getZ()) != 0)
alignedAxes = false;
boolean connectedByAxis =
alignedAxes && definitionFrom.hasShaftTowards(world, from.getPos(), stateFrom, direction)
&& definitionTo.hasShaftTowards(world, to.getPos(), stateTo, direction.getOpposite());
boolean connectedByAxis = alignedAxes
&& definitionFrom.hasShaftTowards(world, from.getPos(), stateFrom, direction)
&& definitionTo.hasShaftTowards(world, to.getPos(), stateTo, direction.getOpposite());
boolean connectedByGears = definitionFrom.hasCogsTowards(world, from.getPos(), stateFrom, direction)
&& definitionTo.hasCogsTowards(world, to.getPos(), stateTo, direction.getOpposite());
@ -89,6 +91,12 @@ public class RotationPropagator {
if (isLargeToSmallGear(stateTo, stateFrom, diff))
return -.5f;
// Rotation Speed Controller <-> Large Gear
if (isLargeGearToSpeedController(stateFrom, stateTo, diff))
return SpeedControllerTileEntity.getSpeedModifier(from, to, true);
if (isLargeGearToSpeedController(stateTo, stateFrom, diff))
return SpeedControllerTileEntity.getSpeedModifier(to, from, false);
// Gear <-> Gear
if (connectedByGears) {
if (diff.manhattanDistance(BlockPos.ZERO) != 1)
@ -136,7 +144,7 @@ public class RotationPropagator {
return 1;
}
private static boolean isLargeToSmallGear(BlockState from, BlockState to, final BlockPos diff) {
private static boolean isLargeToSmallGear(BlockState from, BlockState to, BlockPos diff) {
if (!LARGE_COGWHEEL.typeOf(from) || !COGWHEEL.typeOf(to))
return false;
Axis axisFrom = from.get(AXIS);
@ -153,6 +161,14 @@ public class RotationPropagator {
return true;
}
private static boolean isLargeGearToSpeedController(BlockState from, BlockState to, BlockPos diff) {
if (!LARGE_COGWHEEL.typeOf(from) || !AllBlocks.ROTATION_SPEED_CONTROLLER.typeOf(to))
return false;
if (!diff.equals(BlockPos.ZERO.up()) && !diff.equals(BlockPos.ZERO.down()))
return false;
return true;
}
/**
* Insert the added position to the kinetic network.
*
@ -205,8 +221,8 @@ public class RotationPropagator {
final float newSpeed = updateTE.speed * modFromTo;
float oppositeSpeed = neighbourTE.speed * modToFrom;
boolean incompatible =
Math.signum(newSpeed) != Math.signum(neighbourTE.speed) && (newSpeed != 0 && neighbourTE.speed != 0);
boolean incompatible = Math.signum(newSpeed) != Math.signum(neighbourTE.speed)
&& (newSpeed != 0 && neighbourTE.speed != 0);
boolean tooFast = Math.abs(newSpeed) > AllConfigs.SERVER.kinetics.maxRotationSpeed.get();
boolean speedChangedTooOften = updateTE.speedChangeCounter > MAX_FLICKER_SCORE;

View file

@ -8,11 +8,10 @@ import com.simibubi.create.config.AllConfigs;
import com.simibubi.create.foundation.behaviour.CenteredSideValueBoxTransform;
import com.simibubi.create.foundation.behaviour.base.TileEntityBehaviour;
import com.simibubi.create.foundation.behaviour.scrollvalue.ScrollValueBehaviour;
import com.simibubi.create.foundation.behaviour.scrollvalue.ScrollValueBehaviour.StepContext;
import com.simibubi.create.foundation.utility.Lang;
import com.simibubi.create.modules.contraptions.base.GeneratingKineticTileEntity;
import net.minecraft.entity.player.PlayerEntity;
public class MotorTileEntity extends GeneratingKineticTileEntity {
public static final int DEFAULT_SPEED = 16;
@ -39,7 +38,7 @@ public class MotorTileEntity extends GeneratingKineticTileEntity {
generatedSpeed.value = DEFAULT_SPEED;
generatedSpeed.withUnit(i -> Lang.translate("generic.unit.rpm"));
generatedSpeed.withCallback(i -> this.updateGeneratedRotation());
generatedSpeed.withStepFunction(this::step);
generatedSpeed.withStepFunction(MotorTileEntity::step);
behaviours.add(generatedSpeed);
}
@ -48,13 +47,14 @@ public class MotorTileEntity extends GeneratingKineticTileEntity {
return generatedSpeed.getValue();
}
private int step(int current, boolean forward) {
PlayerEntity closestPlayer = world.getClosestPlayer(pos.getX(), pos.getY(), pos.getZ());
if (closestPlayer != null && closestPlayer.isSneaking())
public static int step(StepContext context) {
if (context.shift)
return 1;
int magnitude = Math.abs(current) - (forward == current > 0 ? 0 : 1);
int current = context.currentValue;
int magnitude = Math.abs(current) - (context.forward == current > 0 ? 0 : 1);
int step = 1;
if (magnitude >= 4)
step *= 4;
if (magnitude >= 32)

View file

@ -0,0 +1,47 @@
package com.simibubi.create.modules.contraptions.relays.advanced;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.foundation.utility.AllShapes;
import com.simibubi.create.modules.contraptions.base.HorizontalAxisKineticBlock;
import com.simibubi.create.modules.contraptions.relays.elementary.CogWheelBlock;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.item.BlockItemUseContext;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Direction.Axis;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.shapes.ISelectionContext;
import net.minecraft.util.math.shapes.VoxelShape;
import net.minecraft.world.IBlockReader;
public class SpeedControllerBlock extends HorizontalAxisKineticBlock {
public SpeedControllerBlock() {
super(Properties.from(Blocks.ANDESITE));
}
@Override
public TileEntity createTileEntity(BlockState state, IBlockReader world) {
return new SpeedControllerTileEntity();
}
@Override
protected boolean hasStaticPart() {
return true;
}
@Override
public BlockState getStateForPlacement(BlockItemUseContext context) {
BlockState above = context.getWorld().getBlockState(context.getPos().up());
if (AllBlocks.LARGE_COGWHEEL.typeOf(above) && above.get(CogWheelBlock.AXIS).isHorizontal())
return getDefaultState().with(HORIZONTAL_AXIS, above.get(CogWheelBlock.AXIS) == Axis.X ? Axis.Z : Axis.X);
return super.getStateForPlacement(context);
}
@Override
public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) {
return AllShapes.SPEED_CONTROLLER.get(state.get(HORIZONTAL_AXIS));
}
}

View file

@ -0,0 +1,35 @@
package com.simibubi.create.modules.contraptions.relays.advanced;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.CreateClient;
import com.simibubi.create.foundation.behaviour.base.SmartTileEntityRenderer;
import com.simibubi.create.foundation.utility.SuperByteBuffer;
import com.simibubi.create.foundation.utility.TessellatorHelper;
import com.simibubi.create.modules.contraptions.base.KineticTileEntityRenderer;
import com.simibubi.create.modules.contraptions.relays.elementary.ShaftBlock;
import net.minecraft.block.BlockState;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
public class SpeedControllerRenderer extends SmartTileEntityRenderer<SpeedControllerTileEntity> {
@Override
public void renderWithGL(SpeedControllerTileEntity tileEntityIn, double x, double y, double z, float partialTicks,
int destroyStage) {
super.renderWithGL(tileEntityIn, x, y, z, partialTicks, destroyStage);
TessellatorHelper.prepareFastRender();
TessellatorHelper.begin(DefaultVertexFormats.BLOCK);
KineticTileEntityRenderer.renderRotatingBuffer(tileEntityIn, getWorld(), getRotatedModel(tileEntityIn), x, y, z,
Tessellator.getInstance().getBuffer());
TessellatorHelper.draw();
}
private SuperByteBuffer getRotatedModel(SpeedControllerTileEntity te) {
BlockState state = te.getBlockState();
return CreateClient.bufferCache.renderBlockIn(KineticTileEntityRenderer.KINETIC_TILE,
AllBlocks.SHAFT.getDefault().with(ShaftBlock.AXIS, state.get(SpeedControllerBlock.HORIZONTAL_AXIS)));
}
}

View file

@ -0,0 +1,111 @@
package com.simibubi.create.modules.contraptions.relays.advanced;
import java.util.List;
import com.simibubi.create.AllTileEntities;
import com.simibubi.create.config.AllConfigs;
import com.simibubi.create.foundation.behaviour.ValueBoxTransform;
import com.simibubi.create.foundation.behaviour.base.TileEntityBehaviour;
import com.simibubi.create.foundation.behaviour.scrollvalue.ScrollValueBehaviour;
import com.simibubi.create.foundation.utility.Lang;
import com.simibubi.create.foundation.utility.VecHelper;
import com.simibubi.create.modules.contraptions.RotationPropagator;
import com.simibubi.create.modules.contraptions.base.KineticTileEntity;
import com.simibubi.create.modules.contraptions.components.motor.MotorTileEntity;
import net.minecraft.block.BlockState;
import net.minecraft.util.Direction;
import net.minecraft.util.math.Vec3d;
public class SpeedControllerTileEntity extends KineticTileEntity {
public static final int DEFAULT_SPEED = 16;
protected ScrollValueBehaviour targetSpeed;
public SpeedControllerTileEntity() {
super(AllTileEntities.ROTATION_SPEED_CONTROLLER.type);
}
@Override
public void addBehaviours(List<TileEntityBehaviour> behaviours) {
super.addBehaviours(behaviours);
Integer max = AllConfigs.SERVER.kinetics.maxRotationSpeed.get();
targetSpeed = new ScrollValueBehaviour(Lang.translate("generic.speed"), this,
new ControllerValueBoxTransform());
targetSpeed.between(-max, max);
targetSpeed.value = DEFAULT_SPEED;
targetSpeed.moveText(new Vec3d(9, 0, 10));
targetSpeed.withUnit(i -> Lang.translate("generic.unit.rpm"));
targetSpeed.withCallback(i -> this.updateTargetRotation());
targetSpeed.withStepFunction(MotorTileEntity::step);
behaviours.add(targetSpeed);
}
private void updateTargetRotation() {
if (hasNetwork())
getNetwork().remove(this);
RotationPropagator.handleRemoved(world, pos, this);
removeSource();
attachKinetics();
}
@Override
public boolean hasFastRenderer() {
return false;
}
public static float getSpeedModifier(KineticTileEntity cogWheel, KineticTileEntity speedControllerIn,
boolean targetingController) {
if (!(speedControllerIn instanceof SpeedControllerTileEntity))
return 1;
SpeedControllerTileEntity speedController = (SpeedControllerTileEntity) speedControllerIn;
float targetSpeed = speedController.targetSpeed.getValue();
float speed = speedControllerIn.getSpeed();
if (targetSpeed == 0)
return 0;
if (targetingController && cogWheel.speed == 0)
return 1;
if (!speedController.hasSource()) {
if (targetingController)
return targetSpeed / cogWheel.speed;
return 1;
}
boolean wheelPowersController = speedController.getSource().equals(cogWheel.getPos());
if (wheelPowersController) {
if (targetingController)
return targetSpeed / cogWheel.speed;
return cogWheel.speed / targetSpeed;
}
if (targetingController)
return speed / targetSpeed;
return targetSpeed / speed;
}
private class ControllerValueBoxTransform extends ValueBoxTransform.Sided {
@Override
protected Vec3d getSouthLocation() {
return VecHelper.voxelSpace(8, 11.5f, 14);
}
@Override
protected boolean isSideActive(BlockState state, Direction direction) {
if (direction.getAxis().isVertical())
return false;
return state.get(SpeedControllerBlock.HORIZONTAL_AXIS) != direction.getAxis();
}
@Override
protected float getScale() {
return 0.275f;
}
}
}

View file

@ -83,7 +83,7 @@ public class BeltShapes {
VERTICAL_START = VerticalBeltShaper.make(compose(FLAT_FULL_PART, FLAT_END_PART));
//Flat Shapes
private static final VoxelShaper
FLAT_FULL = VoxelShaper.forHorizontalAxis(FLAT_FULL_PART, Direction.SOUTH),
FLAT_FULL = VoxelShaper.forHorizontalAxis(FLAT_FULL_PART, Axis.Z),
FLAT_END = VoxelShaper.forHorizontal(compose(FLAT_END_PART, FLAT_FULL_PART), Direction.SOUTH),
FLAT_START = VoxelShaper.forHorizontal(compose(FLAT_FULL_PART, FLAT_END_PART), Direction.SOUTH);
//Sloped Shapes

View file

@ -6,6 +6,7 @@ import com.simibubi.create.foundation.utility.VoxelShaper;
import net.minecraft.block.BlockState;
import net.minecraft.util.Direction;
import net.minecraft.util.Direction.Axis;
import net.minecraft.util.math.shapes.IBooleanFunction;
import net.minecraft.util.math.shapes.VoxelShape;
import net.minecraft.util.math.shapes.VoxelShapes;
@ -19,7 +20,7 @@ public class BeltTunnelShapes {
private static final VoxelShaper STRAIGHT = VoxelShaper.forHorizontalAxis(VoxelShapes.combineAndSimplify(block,
VoxelShapes.or(opening.get(Direction.SOUTH), opening.get(Direction.NORTH)), IBooleanFunction.NOT_SAME),
Direction.SOUTH),
Axis.Z),
TEE = VoxelShaper.forHorizontal(
VoxelShapes.combineAndSimplify(block, VoxelShapes.or(opening.get(Direction.NORTH),

View file

@ -4,6 +4,7 @@ import com.simibubi.create.AllBlocks;
import com.simibubi.create.foundation.block.IHaveCustomBlockItem;
import com.simibubi.create.foundation.utility.AllShapes;
import com.simibubi.create.modules.contraptions.base.IRotate;
import com.simibubi.create.modules.contraptions.relays.advanced.SpeedControllerBlock;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
@ -20,6 +21,7 @@ import net.minecraft.util.math.shapes.ISelectionContext;
import net.minecraft.util.math.shapes.VoxelShape;
import net.minecraft.world.IBlockReader;
import net.minecraft.world.IWorldReader;
import net.minecraft.world.World;
public class CogWheelBlock extends ShaftBlock implements IHaveCustomBlockItem {
@ -51,11 +53,18 @@ public class CogWheelBlock extends ShaftBlock implements IHaveCustomBlockItem {
@Override
public BlockState getStateForPlacement(BlockItemUseContext context) {
BlockPos placedOnPos = context.getPos().offset(context.getFace().getOpposite());
BlockState placedAgainst = context.getWorld().getBlockState(placedOnPos);
World world = context.getWorld();
BlockState placedAgainst = world.getBlockState(placedOnPos);
Block block = placedAgainst.getBlock();
if (!(block instanceof IRotate) || !(((IRotate) block).hasCogsTowards(context.getWorld(), placedOnPos,
placedAgainst, context.getFace()))) {
BlockState stateBelow = world.getBlockState(context.getPos().down());
if (AllBlocks.ROTATION_SPEED_CONTROLLER.typeOf(stateBelow) && isLarge) {
return this.getDefaultState().with(AXIS,
stateBelow.get(SpeedControllerBlock.HORIZONTAL_AXIS) == Axis.X ? Axis.Z : Axis.X);
}
if (!(block instanceof IRotate)
|| !(((IRotate) block).hasCogsTowards(world, placedOnPos, placedAgainst, context.getFace()))) {
Axis preferredAxis = getPreferredAxis(context);
if (preferredAxis != null)
return this.getDefaultState().with(AXIS, preferredAxis);

View file

@ -2,7 +2,6 @@ package com.simibubi.create.modules.contraptions.relays.gauge;
import java.util.Random;
import com.simibubi.create.foundation.utility.AllShapes;
import com.simibubi.create.foundation.utility.ColorHelper;
import com.simibubi.create.foundation.utility.Lang;
import com.simibubi.create.foundation.utility.VecHelper;
@ -30,6 +29,7 @@ import net.minecraft.world.World;
public class GaugeBlock extends DirectionalAxisKineticBlock {
public static final GaugeShaper GAUGE = GaugeShaper.make();
protected Type type;
public enum Type implements IStringSerializable {
@ -154,7 +154,7 @@ public class GaugeBlock extends DirectionalAxisKineticBlock {
@Override
public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) {
return AllShapes.GAUGE.get(state.get(FACING), state.get(AXIS_ALONG_FIRST_COORDINATE));
return GAUGE.get(state.get(FACING), state.get(AXIS_ALONG_FIRST_COORDINATE));
}
}

View file

@ -0,0 +1,32 @@
package com.simibubi.create.modules.contraptions.relays.gauge;
import java.util.Arrays;
import com.simibubi.create.foundation.utility.AllShapes;
import com.simibubi.create.foundation.utility.VoxelShaper;
import net.minecraft.util.Direction;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.math.shapes.VoxelShape;
public class GaugeShaper extends VoxelShaper {
private VoxelShaper axisFalse, axisTrue;
static GaugeShaper make(){
GaugeShaper shaper = new GaugeShaper();
shaper.axisFalse = forDirectional(AllShapes.GAUGE_SHAPE_UP, Direction.UP);
shaper.axisTrue = forDirectional(rotatedCopy(AllShapes.GAUGE_SHAPE_UP, new Vec3d(0, 90, 0)), Direction.UP);
//shapes for X axis need to be swapped
Arrays.asList(Direction.EAST, Direction.WEST).forEach(direction -> {
VoxelShape mem = shaper.axisFalse.get(direction);
shaper.axisFalse.withShape(shaper.axisTrue.get(direction), direction);
shaper.axisTrue.withShape(mem, direction);
});
return shaper;
}
public VoxelShape get(Direction direction, boolean axisAlong) {
return (axisAlong ? axisTrue : axisFalse).get(direction);
}
}

View file

@ -9,6 +9,7 @@ import com.simibubi.create.AllTileEntities;
import com.simibubi.create.foundation.behaviour.base.SmartTileEntity;
import com.simibubi.create.foundation.behaviour.base.TileEntityBehaviour;
import com.simibubi.create.foundation.behaviour.scrollvalue.ScrollValueBehaviour;
import com.simibubi.create.foundation.behaviour.scrollvalue.ScrollValueBehaviour.StepContext;
import com.simibubi.create.foundation.utility.Lang;
import net.minecraft.nbt.CompoundNBT;
@ -52,8 +53,9 @@ public class FlexpeaterTileEntity extends SmartTileEntity {
return super.write(compound);
}
private int step(int value, boolean positive) {
if (!positive)
private int step(StepContext context) {
int value = context.currentValue;
if (!context.forward)
value--;
if (value < 20)

View file

@ -45,7 +45,7 @@ public class SchematicTableBlock extends HorizontalBlock {
@Override
public VoxelShape getCollisionShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) {
return AllShapes.LOGISTICS_TABLE_BASE;
return AllShapes.TABLE_POLE_SHAPE;
}
@Override

View file

@ -0,0 +1,12 @@
{
"forge_marker": 1,
"defaults": {
"model": "create:block/rotation_speed_controller"
},
"variants": {
"axis": {
"z": { },
"x": { "y": 90 }
}
}
}

View file

@ -114,6 +114,7 @@
"block.create.stress_gauge": "Stress Gauge",
"block.create.cart_assembler": "Cart Assembler",
"block.create.analog_lever": "Analog Lever",
"block.create.rotation_speed_controller": "Rotation Speed Controller",
"block.create.sticky_mechanical_piston": "Sticky Mechanical Piston",
"block.create.mechanical_piston": "Mechanical Piston",
@ -362,8 +363,8 @@
"create.contraptions.movement_mode": "Movement Mode",
"create.contraptions.movement_mode.move_place": "Always Place when Stopped",
"create.contraptions.movement_mode.move_place_returned": "Only Place in Starting Position",
"create.contraptions.movement_mode.move_never_place": "Only Place when Anchor Destroyed",
"create.contraptions.movement_mode.move_place_returned": "Place only in Starting Position",
"create.contraptions.movement_mode.move_never_place": "Place only when Anchor Destroyed",
"create.contraptions.movement_mode.rotate_place": "Always Place when Stopped",
"create.contraptions.movement_mode.rotate_place_returned": "Only Place near Initial Angle",
"create.contraptions.movement_mode.rotate_never_place": "Only Place when Anchor Destroyed",

View file

@ -11,98 +11,88 @@
"particle": "create:block/brass_casing"
},
"elements": [
{
"from": [1, 2, 10],
"to": [5, 15, 15],
"faces": {
"north": {"uv": [12, 1, 16, 14], "texture": "#5"},
"east": {"uv": [4, 1, 9, 14], "texture": "#6"},
"south": {"uv": [1, 1, 5, 14], "texture": "#6"},
"west": {"uv": [10, 1, 15, 14], "texture": "#4"},
"up": {"uv": [1, 10, 5, 15], "texture": "#9"},
"down": {"uv": [0, 0, 14, 5], "texture": "#missing"}
}
},
{
"from": [1, 2, 1],
"to": [5, 15, 6],
"to": [6, 15, 5],
"faces": {
"north": {"uv": [5, 1, 1, 14], "texture": "#6"},
"east": {"uv": [9, 1, 4, 14], "texture": "#6"},
"south": {"uv": [16, 1, 12, 14], "texture": "#5"},
"west": {"uv": [15, 1, 10, 14], "texture": "#4"},
"up": {"uv": [1, 1, 5, 6], "texture": "#9"},
"down": {"uv": [0, 5, 14, 0], "texture": "#missing"}
"north": {"uv": [10, 1, 15, 14], "texture": "#4"},
"east": {"uv": [12, 1, 16, 14], "texture": "#5"},
"south": {"uv": [4, 1, 9, 14], "texture": "#6"},
"west": {"uv": [1, 1, 5, 14], "texture": "#6"},
"up": {"uv": [1, 10, 5, 15], "rotation": 90, "texture": "#9"}
}
},
{
"from": [11, 2, 10],
"from": [10, 2, 1],
"to": [15, 15, 5],
"faces": {
"north": {"uv": [15, 1, 10, 14], "texture": "#4"},
"east": {"uv": [5, 1, 1, 14], "texture": "#6"},
"south": {"uv": [9, 1, 4, 14], "texture": "#6"},
"west": {"uv": [16, 1, 12, 14], "texture": "#5"},
"up": {"uv": [1, 1, 5, 6], "rotation": 90, "texture": "#9"}
}
},
{
"from": [1, 2, 11],
"to": [6, 15, 15],
"faces": {
"north": {"uv": [4, 1, 9, 14], "texture": "#6"},
"east": {"uv": [0, 1, 4, 14], "texture": "#5"},
"south": {"uv": [1, 1, 6, 14], "texture": "#4"},
"west": {"uv": [11, 1, 15, 14], "texture": "#6"},
"up": {"uv": [11, 10, 15, 15], "rotation": 90, "texture": "#9"}
}
},
{
"from": [10, 2, 11],
"to": [15, 15, 15],
"faces": {
"north": {"uv": [0, 1, 4, 14], "texture": "#5"},
"east": {"uv": [1, 1, 6, 14], "texture": "#4"},
"south": {"uv": [11, 1, 15, 14], "texture": "#6"},
"west": {"uv": [4, 1, 9, 14], "texture": "#6"},
"up": {"uv": [11, 10, 15, 15], "texture": "#9"},
"down": {"uv": [0, 0, 14, 5], "texture": "#missing"}
"north": {"uv": [9, 1, 4, 14], "texture": "#6"},
"east": {"uv": [15, 1, 11, 14], "texture": "#6"},
"south": {"uv": [6, 1, 1, 14], "texture": "#4"},
"west": {"uv": [4, 1, 0, 14], "texture": "#5"},
"up": {"uv": [11, 1, 15, 6], "rotation": 90, "texture": "#9"}
}
},
{
"from": [11, 2, 1],
"to": [15, 15, 6],
"from": [1, 2, 5],
"to": [6, 8, 11],
"faces": {
"north": {"uv": [15, 1, 11, 14], "texture": "#6"},
"east": {"uv": [6, 1, 1, 14], "texture": "#4"},
"south": {"uv": [4, 1, 0, 14], "texture": "#5"},
"west": {"uv": [9, 1, 4, 14], "texture": "#6"},
"up": {"uv": [11, 1, 15, 6], "texture": "#9"},
"down": {"uv": [0, 5, 14, 0], "texture": "#missing"}
"north": {"uv": [10, 1, 15, 14], "texture": "#4"},
"west": {"uv": [5, 8, 11, 14], "texture": "#6"},
"up": {"uv": [5, 3, 11, 8], "rotation": 90, "texture": "#6"}
}
},
{
"from": [5, 2, 10],
"to": [11, 8, 15],
"from": [10, 2, 5],
"to": [15, 8, 11],
"faces": {
"east": {"uv": [0, 0, 5, 16], "texture": "#missing"},
"south": {"uv": [5, 8, 11, 14], "texture": "#6"},
"west": {"uv": [10, 1, 15, 14], "texture": "#4"},
"up": {"uv": [5, 3, 11, 8], "texture": "#6"},
"down": {"uv": [0, 0, 14, 5], "texture": "#missing"}
"north": {"uv": [15, 1, 10, 14], "texture": "#4"},
"east": {"uv": [11, 8, 5, 14], "texture": "#6"},
"up": {"uv": [5, 8, 11, 3], "rotation": 90, "texture": "#6"}
}
},
{
"from": [5, 2, 1],
"to": [11, 8, 6],
"from": [2, 9, 5],
"to": [6, 14, 11],
"faces": {
"north": {"uv": [11, 8, 5, 14], "texture": "#6"},
"east": {"uv": [5, 0, 0, 16], "texture": "#missing"},
"west": {"uv": [15, 1, 10, 14], "texture": "#4"},
"up": {"uv": [5, 8, 11, 3], "texture": "#6"},
"down": {"uv": [0, 5, 14, 0], "texture": "#missing"}
"north": {"uv": [10, 1, 15, 14], "texture": "#4"},
"east": {"uv": [6, 9, 12, 14], "texture": "#7"},
"west": {"uv": [6, 9, 12, 14], "texture": "#7"},
"up": {"uv": [6, 8, 12, 12], "rotation": 90, "texture": "#7"},
"down": {"uv": [6, 8, 12, 12], "rotation": 270, "texture": "#7"}
}
},
{
"from": [5, 9, 10],
"to": [11, 14, 14],
"from": [10, 9, 5],
"to": [14, 14, 11],
"faces": {
"north": {"uv": [6, 9, 12, 14], "texture": "#7"},
"east": {"uv": [0, 0, 5, 16], "texture": "#missing"},
"south": {"uv": [6, 9, 12, 14], "texture": "#7"},
"west": {"uv": [10, 1, 15, 14], "texture": "#4"},
"up": {"uv": [6, 8, 12, 12], "texture": "#7"},
"down": {"uv": [6, 8, 12, 12], "texture": "#7"}
}
},
{
"from": [5, 9, 2],
"to": [11, 14, 6],
"faces": {
"north": {"uv": [6, 10, 12, 15], "texture": "#7"},
"east": {"uv": [5, 0, 0, 16], "texture": "#missing"},
"south": {"uv": [6, 8, 12, 13], "texture": "#7"},
"west": {"uv": [15, 1, 10, 14], "texture": "#4"},
"up": {"uv": [6, 12, 12, 8], "texture": "#7"},
"down": {"uv": [6, 8, 12, 12], "texture": "#7"}
"north": {"uv": [15, 1, 10, 14], "texture": "#4"},
"east": {"uv": [6, 10, 12, 15], "texture": "#7"},
"west": {"uv": [6, 8, 12, 13], "texture": "#7"},
"up": {"uv": [6, 12, 12, 8], "rotation": 90, "texture": "#7"},
"down": {"uv": [6, 8, 12, 12], "rotation": 270, "texture": "#7"}
}
},
{
@ -113,20 +103,18 @@
"east": {"uv": [0, 14, 16, 16], "texture": "#5"},
"south": {"uv": [0, 14, 16, 16], "texture": "#5"},
"west": {"uv": [0, 14, 16, 16], "texture": "#5"},
"up": {"uv": [0, 0, 16, 16], "texture": "#4"},
"down": {"uv": [0, 0, 16, 16], "texture": "#6"}
"up": {"uv": [0, 0, 16, 16], "rotation": 90, "texture": "#4"},
"down": {"uv": [0, 0, 16, 16], "rotation": 270, "texture": "#6"}
}
},
{
"from": [1, 2, 6],
"to": [15, 11, 10],
"from": [6, 2, 1],
"to": [10, 11, 15],
"faces": {
"east": {"uv": [6, 5, 10, 14], "texture": "#4"},
"west": {"uv": [6, 5, 10, 14], "texture": "#4"},
"up": {"uv": [1, 6, 15, 10], "texture": "#8"},
"down": {"uv": [0, 0, 14, 6], "texture": "#missing"}
"north": {"uv": [6, 5, 10, 14], "texture": "#4"},
"south": {"uv": [6, 5, 10, 14], "texture": "#4"},
"up": {"uv": [1, 6, 15, 10], "rotation": 90, "texture": "#8"}
}
}
],
"display": {}
]
}

View file

@ -1,6 +1,6 @@
{
"credit": "Made with Blockbench",
"parent": "create:block/large_wheels",
"parent": "block/block",
"textures": {
"0": "create:block/axis",
"3": "create:block/axis_top",
@ -10,115 +10,104 @@
"7": "create:block/extractor",
"8": "create:block/encased_belt_middle",
"9": "create:block/brass_block",
"particle": "create:block/stripped_spruce_log"
"particle": "create:block/brass_casing"
},
"elements": [
{
"from": [1, 2, 10],
"to": [5, 15, 15],
"faces": {
"north": {"uv": [12, 1, 16, 14], "texture": "#5"},
"east": {"uv": [4, 1, 9, 14], "texture": "#6"},
"south": {"uv": [1, 1, 5, 14], "texture": "#6"},
"west": {"uv": [10, 1, 15, 14], "texture": "#4"},
"up": {"uv": [1, 10, 5, 15], "texture": "#9"},
"down": {"uv": [0, 0, 14, 5], "texture": "#missing"}
}
},
{
"from": [1, 2, 1],
"to": [5, 15, 6],
"to": [6, 15, 5],
"faces": {
"north": {"uv": [5, 1, 1, 14], "texture": "#6"},
"east": {"uv": [9, 1, 4, 14], "texture": "#6"},
"south": {"uv": [16, 1, 12, 14], "texture": "#5"},
"west": {"uv": [15, 1, 10, 14], "texture": "#4"},
"up": {"uv": [1, 1, 5, 6], "texture": "#9"},
"down": {"uv": [0, 5, 14, 0], "texture": "#missing"}
"north": {"uv": [10, 1, 15, 14], "texture": "#4"},
"east": {"uv": [12, 1, 16, 14], "texture": "#5"},
"south": {"uv": [4, 1, 9, 14], "texture": "#6"},
"west": {"uv": [1, 1, 5, 14], "texture": "#6"},
"up": {"uv": [1, 10, 5, 15], "rotation": 90, "texture": "#9"}
}
},
{
"from": [11, 2, 10],
"from": [10, 2, 1],
"to": [15, 15, 5],
"faces": {
"north": {"uv": [15, 1, 10, 14], "texture": "#4"},
"east": {"uv": [5, 1, 1, 14], "texture": "#6"},
"south": {"uv": [9, 1, 4, 14], "texture": "#6"},
"west": {"uv": [16, 1, 12, 14], "texture": "#5"},
"up": {"uv": [1, 1, 5, 6], "rotation": 90, "texture": "#9"}
}
},
{
"from": [1, 2, 11],
"to": [6, 15, 15],
"faces": {
"north": {"uv": [4, 1, 9, 14], "texture": "#6"},
"east": {"uv": [0, 1, 4, 14], "texture": "#5"},
"south": {"uv": [1, 1, 6, 14], "texture": "#4"},
"west": {"uv": [11, 1, 15, 14], "texture": "#6"},
"up": {"uv": [11, 10, 15, 15], "rotation": 90, "texture": "#9"}
}
},
{
"from": [10, 2, 11],
"to": [15, 15, 15],
"faces": {
"north": {"uv": [0, 1, 4, 14], "texture": "#5"},
"east": {"uv": [1, 1, 6, 14], "texture": "#4"},
"south": {"uv": [11, 1, 15, 14], "texture": "#6"},
"west": {"uv": [4, 1, 9, 14], "texture": "#6"},
"up": {"uv": [11, 10, 15, 15], "texture": "#9"},
"down": {"uv": [0, 0, 14, 5], "texture": "#missing"}
"north": {"uv": [9, 1, 4, 14], "texture": "#6"},
"east": {"uv": [15, 1, 11, 14], "texture": "#6"},
"south": {"uv": [6, 1, 1, 14], "texture": "#4"},
"west": {"uv": [4, 1, 0, 14], "texture": "#5"},
"up": {"uv": [11, 1, 15, 6], "rotation": 90, "texture": "#9"}
}
},
{
"from": [11, 2, 1],
"to": [15, 15, 6],
"from": [1, 2, 5],
"to": [6, 8, 11],
"faces": {
"north": {"uv": [15, 1, 11, 14], "texture": "#6"},
"east": {"uv": [6, 1, 1, 14], "texture": "#4"},
"south": {"uv": [4, 1, 0, 14], "texture": "#5"},
"west": {"uv": [9, 1, 4, 14], "texture": "#6"},
"up": {"uv": [11, 1, 15, 6], "texture": "#9"},
"down": {"uv": [0, 5, 14, 0], "texture": "#missing"}
"north": {"uv": [10, 1, 15, 14], "texture": "#4"},
"west": {"uv": [5, 8, 11, 14], "texture": "#6"},
"up": {"uv": [5, 3, 11, 8], "rotation": 90, "texture": "#6"}
}
},
{
"from": [5, 2, 10],
"to": [11, 8, 15],
"from": [10, 2, 5],
"to": [15, 8, 11],
"faces": {
"east": {"uv": [0, 0, 5, 16], "texture": "#missing"},
"south": {"uv": [5, 8, 11, 14], "texture": "#6"},
"west": {"uv": [10, 1, 15, 14], "texture": "#4"},
"up": {"uv": [5, 3, 11, 8], "texture": "#6"},
"down": {"uv": [0, 0, 14, 5], "texture": "#missing"}
"north": {"uv": [15, 1, 10, 14], "texture": "#4"},
"east": {"uv": [11, 8, 5, 14], "texture": "#6"},
"up": {"uv": [5, 8, 11, 3], "rotation": 90, "texture": "#6"}
}
},
{
"from": [5, 2, 1],
"to": [11, 8, 6],
"from": [2, 9, 5],
"to": [6, 14, 11],
"faces": {
"north": {"uv": [11, 8, 5, 14], "texture": "#6"},
"east": {"uv": [5, 0, 0, 16], "texture": "#missing"},
"west": {"uv": [15, 1, 10, 14], "texture": "#4"},
"up": {"uv": [5, 8, 11, 3], "texture": "#6"},
"down": {"uv": [0, 5, 14, 0], "texture": "#missing"}
"north": {"uv": [10, 1, 15, 14], "texture": "#4"},
"east": {"uv": [6, 9, 12, 14], "texture": "#7"},
"west": {"uv": [6, 9, 12, 14], "texture": "#7"},
"up": {"uv": [6, 8, 12, 12], "rotation": 90, "texture": "#7"},
"down": {"uv": [6, 8, 12, 12], "rotation": 270, "texture": "#7"}
}
},
{
"from": [5, 9, 10],
"to": [11, 14, 14],
"from": [10, 9, 5],
"to": [14, 14, 11],
"faces": {
"north": {"uv": [6, 9, 12, 14], "texture": "#7"},
"east": {"uv": [0, 0, 5, 16], "texture": "#missing"},
"south": {"uv": [6, 9, 12, 14], "texture": "#7"},
"west": {"uv": [10, 1, 15, 14], "texture": "#4"},
"up": {"uv": [6, 8, 12, 12], "texture": "#7"},
"down": {"uv": [6, 8, 12, 12], "texture": "#7"}
}
},
{
"from": [5, 9, 2],
"to": [11, 14, 6],
"faces": {
"north": {"uv": [6, 10, 12, 15], "texture": "#7"},
"east": {"uv": [5, 0, 0, 16], "texture": "#missing"},
"south": {"uv": [6, 8, 12, 13], "texture": "#7"},
"west": {"uv": [15, 1, 10, 14], "texture": "#4"},
"up": {"uv": [6, 12, 12, 8], "texture": "#7"},
"down": {"uv": [6, 8, 12, 12], "texture": "#7"}
"north": {"uv": [15, 1, 10, 14], "texture": "#4"},
"east": {"uv": [6, 10, 12, 15], "texture": "#7"},
"west": {"uv": [6, 8, 12, 13], "texture": "#7"},
"up": {"uv": [6, 12, 12, 8], "rotation": 90, "texture": "#7"},
"down": {"uv": [6, 8, 12, 12], "rotation": 270, "texture": "#7"}
}
},
{
"name": "Axis",
"from": [0, 6, 6],
"to": [16, 10, 10],
"shade": false,
"from": [6, 6, 0],
"to": [10, 10, 16],
"faces": {
"north": {"uv": [6, 0, 10, 16], "rotation": 90, "texture": "#0"},
"east": {"uv": [6, 6, 10, 10], "texture": "#3"},
"south": {"uv": [6, 0, 10, 16], "rotation": 270, "texture": "#0"},
"west": {"uv": [6, 6, 10, 10], "rotation": 180, "texture": "#3"},
"up": {"uv": [6, 0, 10, 16], "rotation": 270, "texture": "#0"},
"down": {"uv": [6, 0, 10, 16], "rotation": 270, "texture": "#0"}
"north": {"uv": [6, 6, 10, 10], "rotation": 180, "texture": "#3"},
"east": {"uv": [6, 0, 10, 16], "rotation": 90, "texture": "#0"},
"south": {"uv": [6, 6, 10, 10], "texture": "#3"},
"west": {"uv": [6, 0, 10, 16], "rotation": 270, "texture": "#0"},
"up": {"uv": [6, 0, 10, 16], "texture": "#0"},
"down": {"uv": [6, 0, 10, 16], "rotation": 180, "texture": "#0"}
}
},
{
@ -129,20 +118,18 @@
"east": {"uv": [0, 14, 16, 16], "texture": "#5"},
"south": {"uv": [0, 14, 16, 16], "texture": "#5"},
"west": {"uv": [0, 14, 16, 16], "texture": "#5"},
"up": {"uv": [0, 0, 16, 16], "texture": "#4"},
"down": {"uv": [0, 0, 16, 16], "texture": "#6"}
"up": {"uv": [0, 0, 16, 16], "rotation": 90, "texture": "#4"},
"down": {"uv": [0, 0, 16, 16], "rotation": 270, "texture": "#6"}
}
},
{
"from": [1, 2, 6],
"to": [15, 11, 10],
"from": [6, 2, 1],
"to": [10, 11, 15],
"faces": {
"east": {"uv": [6, 5, 10, 14], "texture": "#4"},
"west": {"uv": [6, 5, 10, 14], "texture": "#4"},
"up": {"uv": [1, 6, 15, 10], "texture": "#8"},
"down": {"uv": [0, 0, 14, 6], "texture": "#missing"}
"north": {"uv": [6, 5, 10, 14], "texture": "#4"},
"south": {"uv": [6, 5, 10, 14], "texture": "#4"},
"up": {"uv": [1, 6, 15, 10], "rotation": 90, "texture": "#8"}
}
}
],
"display": {}
]
}

View file

@ -0,0 +1,19 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "create:rotation_speed_controller"
}
],
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
]
}
]
}

View file

@ -0,0 +1,28 @@
{
"type": "crafting_shaped",
"pattern": [
" B ",
"SCS"
],
"key": {
"S": {
"item": "create:shaft"
},
"B": {
"item": "create:integrated_circuit"
},
"C": {
"item": "create:brass_casing"
}
},
"result": {
"item": "create:rotation_speed_controller",
"count": 1
},
"conditions": [
{
"type": "create:module",
"module": "contraptions"
}
]
}

View file

@ -0,0 +1,28 @@
{
"type": "crafting_shaped",
"pattern": [
" B ",
"SCS"
],
"key": {
"S": {
"item": "create:shaft"
},
"B": {
"item": "create:integrated_circuit"
},
"C": {
"item": "create:brass_casing"
}
},
"result": {
"item": "create:rotation_speed_controller",
"count": 1
},
"conditions": [
{
"type": "create:module",
"module": "contraptions"
}
]
}