Skip to content

Commit

Permalink
Configurable Chasses
Browse files Browse the repository at this point in the history
- Removed old chassis blocks
- Added new chasses with configurable range of effect
- Added the mechanical bearing and rotation chassis
- Motor speed can now be configured
  • Loading branch information
simibubi committed Sep 7, 2019
1 parent 5e628e1 commit fb35aa7
Show file tree
Hide file tree
Showing 71 changed files with 1,372 additions and 258 deletions.
70 changes: 48 additions & 22 deletions src/main/java/com/simibubi/create/AllBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@
import com.simibubi.create.modules.contraptions.receivers.EncasedFanBlock;
import com.simibubi.create.modules.contraptions.receivers.HarvesterBlock;
import com.simibubi.create.modules.contraptions.receivers.TurntableBlock;
import com.simibubi.create.modules.contraptions.receivers.constructs.ChassisBlock;
import com.simibubi.create.modules.contraptions.receivers.constructs.MechanicalBearingBlock;
import com.simibubi.create.modules.contraptions.receivers.constructs.MechanicalPistonBlock;
import com.simibubi.create.modules.contraptions.receivers.constructs.MechanicalPistonHeadBlock;
import com.simibubi.create.modules.contraptions.receivers.constructs.PistonPoleBlock;
import com.simibubi.create.modules.contraptions.receivers.constructs.RotationChassisBlock;
import com.simibubi.create.modules.contraptions.receivers.constructs.TranslationChassisBlock;
import com.simibubi.create.modules.contraptions.redstone.ContactBlock;
import com.simibubi.create.modules.contraptions.relays.ClutchBlock;
import com.simibubi.create.modules.contraptions.relays.CogWheelBlock;
Expand Down Expand Up @@ -59,38 +61,62 @@
public enum AllBlocks {

// Schematics
SCHEMATICANNON(new SchematicannonBlock()), SCHEMATICANNON_CONNECTOR(new RenderUtilityBlock()),
SCHEMATICANNON_PIPE(new RenderUtilityBlock()), CREATIVE_CRATE(new CreativeCrateBlock()),
SCHEMATICANNON(new SchematicannonBlock()),
SCHEMATICANNON_CONNECTOR(new RenderUtilityBlock()),
SCHEMATICANNON_PIPE(new RenderUtilityBlock()),
CREATIVE_CRATE(new CreativeCrateBlock()),
SCHEMATIC_TABLE(new SchematicTableBlock()),

// Kinetics
SHAFT(new ShaftBlock(Properties.from(Blocks.ANDESITE))), COGWHEEL(new CogWheelBlock(false)),
LARGE_COGWHEEL(new CogWheelBlock(true)), ENCASED_SHAFT(new EncasedShaftBlock()),
ENCASED_BELT(new EncasedBeltBlock()), CLUTCH(new ClutchBlock()), GEARSHIFT(new GearshiftBlock()),
GEARBOX(new GearboxBlock()), BELT(new BeltBlock()), BELT_PULLEY(new RenderUtilityAxisBlock()),
SHAFT(new ShaftBlock(Properties.from(Blocks.ANDESITE))),
COGWHEEL(new CogWheelBlock(false)),
LARGE_COGWHEEL(new CogWheelBlock(true)),
ENCASED_SHAFT(new EncasedShaftBlock()),
ENCASED_BELT(new EncasedBeltBlock()),
CLUTCH(new ClutchBlock()),
GEARSHIFT(new GearshiftBlock()),
GEARBOX(new GearboxBlock()),
BELT(new BeltBlock()),
BELT_PULLEY(new RenderUtilityAxisBlock()),
BELT_ANIMATION(new RenderUtilityBlock()),

MOTOR(new MotorBlock()), WATER_WHEEL(new WaterWheelBlock()),
MOTOR(new MotorBlock()),
WATER_WHEEL(new WaterWheelBlock()),

ENCASED_FAN(new EncasedFanBlock()), ENCASED_FAN_INNER(new RenderUtilityAxisBlock()),
TURNTABLE(new TurntableBlock()), SHAFT_HALF(new ShaftHalfBlock()), CRUSHING_WHEEL(new CrushingWheelBlock()),
ENCASED_FAN(new EncasedFanBlock()),
ENCASED_FAN_INNER(new RenderUtilityAxisBlock()),
TURNTABLE(new TurntableBlock()),
SHAFT_HALF(new ShaftHalfBlock()),
CRUSHING_WHEEL(new CrushingWheelBlock()),
CRUSHING_WHEEL_CONTROLLER(new CrushingWheelControllerBlock()),

MECHANICAL_PISTON(new MechanicalPistonBlock(false)), STICKY_MECHANICAL_PISTON(new MechanicalPistonBlock(true)),
MECHANICAL_PISTON_HEAD(new MechanicalPistonHeadBlock()), PISTON_POLE(new PistonPoleBlock()),
CONSTRUCT(new ChassisBlock(ChassisBlock.Type.NORMAL)), STICKY_CONSTRUCT(new ChassisBlock(ChassisBlock.Type.STICKY)),
RELOCATION_CONSTRUCT(new ChassisBlock(ChassisBlock.Type.RELOCATING)),

DRILL(new DrillBlock()), HARVESTER(new HarvesterBlock()), CONTACT(new ContactBlock()),
MECHANICAL_PISTON(new MechanicalPistonBlock(false)),
STICKY_MECHANICAL_PISTON(new MechanicalPistonBlock(true)),
MECHANICAL_PISTON_HEAD(new MechanicalPistonHeadBlock()),
PISTON_POLE(new PistonPoleBlock()),
MECHANICAL_BEARING(new MechanicalBearingBlock()),
MECHANICAL_BEARING_TOP(new ShaftHalfBlock()),
TRANSLATION_CHASSIS(new TranslationChassisBlock()),
ROTATION_CHASSIS(new RotationChassisBlock()),

// Get rid o' these
DRILL(new DrillBlock()),
HARVESTER(new HarvesterBlock()),

// Logistics
PULSE_REPEATER(new PulseRepeaterBlock()), REDSTONE_BRIDGE(new RedstoneBridgeBlock()),
STOCKSWITCH(new StockswitchBlock()), FLEXCRATE(new FlexcrateBlock()), EXTRACTOR(new ExtractorBlock()),
LINKED_EXTRACTOR(new LinkedExtractorBlock()), BELT_FUNNEL(new BeltFunnelBlock()),
CONTACT(new ContactBlock()),
REDSTONE_BRIDGE(new RedstoneBridgeBlock()),
STOCKSWITCH(new StockswitchBlock()),
FLEXCRATE(new FlexcrateBlock()),
EXTRACTOR(new ExtractorBlock()),
LINKED_EXTRACTOR(new LinkedExtractorBlock()),
BELT_FUNNEL(new BeltFunnelBlock()),
ENTITY_DETECTOR(new EntityDetectorBlock()),
PULSE_REPEATER(new PulseRepeaterBlock()),

// Symmetry
SYMMETRY_PLANE(new PlaneSymmetryBlock()), SYMMETRY_CROSSPLANE(new CrossPlaneSymmetryBlock()),
SYMMETRY_PLANE(new PlaneSymmetryBlock()),
SYMMETRY_CROSSPLANE(new CrossPlaneSymmetryBlock()),
SYMMETRY_TRIPLEPLANE(new TriplePlaneSymmetryBlock()),

// Gardens
Expand All @@ -105,13 +131,13 @@ public enum AllBlocks {
GRANITE_BRICKS(new Block(Properties.from(Blocks.GRANITE))),

GABBRO(new Block(Properties.from(Blocks.ANDESITE)), ComesWith.STAIRS, ComesWith.SLAB, ComesWith.WALL),
POLISHED_GABBRO(new Block(Properties.from(GABBRO.block))),
POLISHED_GABBRO(new Block(Properties.from(GABBRO.block))),
GABBRO_BRICKS(new Block(Properties.from(GABBRO.block)), ComesWith.STAIRS, ComesWith.WALL),
PAVED_GABBRO_BRICKS(new Block(Properties.from(GABBRO.block)), ComesWith.SLAB),
INDENTED_GABBRO(new Block(Properties.from(GABBRO.block)), ComesWith.SLAB),
SLIGHTLY_MOSSY_GABBRO_BRICKS(new Block(Properties.from(GABBRO.block))),
MOSSY_GABBRO_BRICKS(new Block(Properties.from(GABBRO.block))),

LIMESTONE(new Block(Properties.from(Blocks.GRANITE)), ComesWith.STAIRS, ComesWith.SLAB, ComesWith.WALL),
LIMESTONE_BRICKS(new Block(Properties.from(LIMESTONE.block)), ComesWith.STAIRS, ComesWith.SLAB, ComesWith.WALL),
POLISHED_LIMESTONE(new Block(Properties.from(LIMESTONE.block)), ComesWith.SLAB),
Expand Down
27 changes: 19 additions & 8 deletions src/main/java/com/simibubi/create/AllItems.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,24 +39,35 @@ public enum AllItems {
PLACEMENT_HANDGUN(
new BuilderGunItem(new Properties().setTEISR(() -> () -> renderUsing(AllItemRenderers.BUILDER_GUN)))),

ANDESITE_ALLOY_CUBE(new Item(standardProperties())), BLAZE_BRASS_CUBE(new Item(standardProperties())),
ANDESITE_ALLOY_CUBE(new Item(standardProperties())),
BLAZE_BRASS_CUBE(new Item(standardProperties())),
CHORUS_CHROME_CUBE(new Item(standardProperties().rarity(Rarity.UNCOMMON))),
CHROMATIC_COMPOUND_CUBE(new ChromaticCompoundCubeItem(standardProperties().rarity(Rarity.UNCOMMON))),
SHADOW_STEEL_CUBE(new Item(standardProperties().rarity(Rarity.UNCOMMON))),
ROSE_QUARTZ(new Item(standardProperties())), REFINED_ROSE_QUARTZ(new Item(standardProperties())),
ROSE_QUARTZ(new Item(standardProperties())),
REFINED_ROSE_QUARTZ(new Item(standardProperties())),
CHROMATIC_COMPOUND_CUBE(new ChromaticCompoundCubeItem(standardProperties().rarity(Rarity.UNCOMMON))),
REFINED_RADIANCE_CUBE(new Item(standardProperties())),

BLAZING_PICKAXE(new Item(standardProperties())), BLAZING_SHOVEL(new Item(standardProperties())),
BLAZING_AXE(new Item(standardProperties())), BLAZING_SWORD(new Item(standardProperties())),
BLAZING_PICKAXE(new Item(standardProperties())),
BLAZING_SHOVEL(new Item(standardProperties())),
BLAZING_AXE(new Item(standardProperties())),
BLAZING_SWORD(new Item(standardProperties())),

SHADOW_STEEL_PICKAXE(new Item(standardProperties())),
SHADOW_STEEL_MATTOCK(new Item(standardProperties())),
SHADOW_STEEL_SWORD(new Item(standardProperties())),

ROSE_QUARTZ_PICKAXE(new Item(standardProperties())), ROSE_QUARTZ_SHOVEL(new Item(standardProperties())),
ROSE_QUARTZ_AXE(new Item(standardProperties())), ROSE_QUARTZ_SWORD(new Item(standardProperties())),
ROSE_QUARTZ_PICKAXE(new Item(standardProperties())),
ROSE_QUARTZ_SHOVEL(new Item(standardProperties())),
ROSE_QUARTZ_AXE(new Item(standardProperties())),
ROSE_QUARTZ_SWORD(new Item(standardProperties())),

TREE_FERTILIZER(new TreeFertilizerItem(standardProperties())),

EMPTY_BLUEPRINT(new Item(standardProperties().maxStackSize(1))),
BLUEPRINT_AND_QUILL(new SchematicAndQuillItem(standardProperties().maxStackSize(1))),
BLUEPRINT(new SchematicItem(standardProperties())), BELT_CONNECTOR(new BeltItem(standardProperties())),
BLUEPRINT(new SchematicItem(standardProperties())),
BELT_CONNECTOR(new BeltItem(standardProperties())),

;

Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/simibubi/create/AllPackets.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

import com.simibubi.create.foundation.packet.NbtPacket;
import com.simibubi.create.foundation.packet.SimplePacketBase;
import com.simibubi.create.modules.contraptions.generators.ConfigureMotorPacket;
import com.simibubi.create.modules.contraptions.receivers.constructs.ConfigureChassisPacket;
import com.simibubi.create.modules.curiosities.placementHandgun.BuilderGunBeamPacket;
import com.simibubi.create.modules.logistics.packet.ConfigureFlexcratePacket;
import com.simibubi.create.modules.logistics.packet.ConfigureStockswitchPacket;
Expand All @@ -27,6 +29,8 @@ public enum AllPackets {
CONFIGURE_SCHEMATICANNON(ConfigureSchematicannonPacket.class, ConfigureSchematicannonPacket::new),
CONFIGURE_FLEXCRATE(ConfigureFlexcratePacket.class, ConfigureFlexcratePacket::new),
CONFIGURE_STOCKSWITCH(ConfigureStockswitchPacket.class, ConfigureStockswitchPacket::new),
CONFIGURE_CHASSIS(ConfigureChassisPacket.class, ConfigureChassisPacket::new),
CONFIGURE_MOTOR(ConfigureMotorPacket.class, ConfigureMotorPacket::new),
PLACE_SCHEMATIC(SchematicPlacePacket.class, SchematicPlacePacket::new),
UPLOAD_SCHEMATIC(SchematicUploadPacket.class, SchematicUploadPacket::new),

Expand Down
18 changes: 14 additions & 4 deletions src/main/java/com/simibubi/create/AllTileEntities.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
import com.simibubi.create.modules.contraptions.receivers.EncasedFanTileEntity;
import com.simibubi.create.modules.contraptions.receivers.EncasedFanTileEntityRenderer;
import com.simibubi.create.modules.contraptions.receivers.TurntableTileEntity;
import com.simibubi.create.modules.contraptions.receivers.constructs.ChassisTileEntity;
import com.simibubi.create.modules.contraptions.receivers.constructs.MechanicalBearingTileEntity;
import com.simibubi.create.modules.contraptions.receivers.constructs.MechanicalBearingTileEntityRenderer;
import com.simibubi.create.modules.contraptions.receivers.constructs.MechanicalPistonTileEntity;
import com.simibubi.create.modules.contraptions.receivers.constructs.MechanicalPistonTileEntityRenderer;
import com.simibubi.create.modules.contraptions.relays.ClutchTileEntity;
Expand Down Expand Up @@ -62,12 +65,17 @@ public enum AllTileEntities {

// Kinetics
SHAFT(ShaftTileEntity::new, AllBlocks.SHAFT, AllBlocks.COGWHEEL, AllBlocks.LARGE_COGWHEEL, AllBlocks.ENCASED_SHAFT),
MOTOR(MotorTileEntity::new, AllBlocks.MOTOR), GEARBOX(GearboxTileEntity::new, AllBlocks.GEARBOX),
MOTOR(MotorTileEntity::new, AllBlocks.MOTOR),
GEARBOX(GearboxTileEntity::new, AllBlocks.GEARBOX),
TURNTABLE(TurntableTileEntity::new, AllBlocks.TURNTABLE),
ENCASED_SHAFT(EncasedShaftTileEntity::new, AllBlocks.ENCASED_SHAFT, AllBlocks.ENCASED_BELT),
ENCASED_FAN(EncasedFanTileEntity::new, AllBlocks.ENCASED_FAN), CLUTCH(ClutchTileEntity::new, AllBlocks.CLUTCH),
GEARSHIFT(GearshiftTileEntity::new, AllBlocks.GEARSHIFT), BELT(BeltTileEntity::new, AllBlocks.BELT),
ENCASED_FAN(EncasedFanTileEntity::new, AllBlocks.ENCASED_FAN),
CLUTCH(ClutchTileEntity::new, AllBlocks.CLUTCH),
GEARSHIFT(GearshiftTileEntity::new, AllBlocks.GEARSHIFT),
BELT(BeltTileEntity::new, AllBlocks.BELT),
MECHANICAL_PISTON(MechanicalPistonTileEntity::new, AllBlocks.MECHANICAL_PISTON, AllBlocks.STICKY_MECHANICAL_PISTON),
MECHANICAL_BEARING(MechanicalBearingTileEntity::new, AllBlocks.MECHANICAL_BEARING),
CHASSIS(ChassisTileEntity::new, AllBlocks.ROTATION_CHASSIS, AllBlocks.TRANSLATION_CHASSIS),
DRILL(DrillTileEntity::new, AllBlocks.DRILL),
CRUSHING_WHEEL(CrushingWheelTileEntity::new, AllBlocks.CRUSHING_WHEEL),
CRUSHING_WHEEL_CONTROLLER(CrushingWheelControllerTileEntity::new, AllBlocks.CRUSHING_WHEEL_CONTROLLER),
Expand All @@ -76,7 +84,8 @@ public enum AllTileEntities {
// Logistics
REDSTONE_BRIDGE(RedstoneBridgeTileEntity::new, AllBlocks.REDSTONE_BRIDGE),
STOCKSWITCH(StockswitchTileEntity::new, AllBlocks.STOCKSWITCH),
FLEXCRATE(FlexcrateTileEntity::new, AllBlocks.FLEXCRATE), EXTRACTOR(ExtractorTileEntity::new, AllBlocks.EXTRACTOR),
FLEXCRATE(FlexcrateTileEntity::new, AllBlocks.FLEXCRATE),
EXTRACTOR(ExtractorTileEntity::new, AllBlocks.EXTRACTOR),
LINKED_EXTRACTOR(LinkedExtractorTileEntity::new, AllBlocks.LINKED_EXTRACTOR),
BELT_FUNNEL(BeltFunnelTileEntity::new, AllBlocks.BELT_FUNNEL),
ENTITY_DETECTOR(EntityDetectorTileEntity::new, AllBlocks.ENTITY_DETECTOR),
Expand Down Expand Up @@ -123,6 +132,7 @@ public static void registerRenderers() {
bind(ClutchTileEntity.class, new SplitShaftTileEntityRenderer());
bind(BeltTileEntity.class, new BeltTileEntityRenderer());
bind(MechanicalPistonTileEntity.class, new MechanicalPistonTileEntityRenderer());
bind(MechanicalBearingTileEntity.class, new MechanicalBearingTileEntityRenderer());
bind(DrillTileEntity.class, new KineticTileEntityRenderer());
bind(CrushingWheelTileEntity.class, new KineticTileEntityRenderer());
bind(WaterWheelTileEntity.class, new KineticTileEntityRenderer());
Expand Down
9 changes: 5 additions & 4 deletions src/main/java/com/simibubi/create/ClientEvents.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.simibubi.create;

import com.simibubi.create.foundation.block.IBlockWithScrollableValue;
import com.simibubi.create.foundation.gui.ScreenOpener;
import com.simibubi.create.modules.contraptions.receivers.TurntableHandler;
import com.simibubi.create.modules.contraptions.relays.belt.BeltItemHandler;
Expand Down Expand Up @@ -67,16 +68,16 @@ public static void onKeyInput(KeyInputEvent event) {
CreateClient.schematicHandler.onKeyInput(key, pressed);
}


@SubscribeEvent
public static void onMouseScrolled(MouseScrollEvent event) {
if (Minecraft.getInstance().currentScreen != null)
return;

double delta = event.getScrollDelta();

boolean cancelled = CreateClient.schematicHandler.mouseScrolled(delta)
|| CreateClient.schematicAndQuillHandler.mouseScrolled(delta);
|| CreateClient.schematicAndQuillHandler.mouseScrolled(delta)
|| IBlockWithScrollableValue.onScroll(delta);
event.setCanceled(cancelled);
}

Expand All @@ -96,7 +97,7 @@ public static void onMouseInput(MouseInputEvent event) {
public static void onRenderTick(RenderTickEvent event) {
if (!isGameActive())
return;

TurntableHandler.gameRenderTick();
}

Expand Down
Loading

0 comments on commit fb35aa7

Please sign in to comment.