Configurable Chasses
- 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
|
@ -12,10 +12,12 @@ import com.simibubi.create.modules.contraptions.receivers.DrillBlock;
|
|||
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;
|
||||
|
@ -59,38 +61,62 @@ import net.minecraftforge.registries.IForgeRegistry;
|
|||
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)),
|
||||
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()),
|
||||
|
||||
DRILL(new DrillBlock()), HARVESTER(new HarvesterBlock()), CONTACT(new ContactBlock()),
|
||||
// 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
|
||||
|
|
|
@ -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())),
|
||||
|
||||
ROSE_QUARTZ_PICKAXE(new Item(standardProperties())), ROSE_QUARTZ_SHOVEL(new Item(standardProperties())),
|
||||
ROSE_QUARTZ_AXE(new Item(standardProperties())), ROSE_QUARTZ_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())),
|
||||
|
||||
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())),
|
||||
|
||||
;
|
||||
|
||||
|
|
|
@ -6,6 +6,8 @@ import java.util.function.Supplier;
|
|||
|
||||
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;
|
||||
|
@ -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),
|
||||
|
||||
|
|
|
@ -12,6 +12,9 @@ import com.simibubi.create.modules.contraptions.receivers.DrillTileEntity;
|
|||
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;
|
||||
|
@ -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),
|
||||
|
@ -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),
|
||||
|
@ -123,6 +132,7 @@ public enum AllTileEntities {
|
|||
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());
|
||||
|
|
|
@ -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;
|
||||
|
@ -67,7 +68,6 @@ public class ClientEvents {
|
|||
CreateClient.schematicHandler.onKeyInput(key, pressed);
|
||||
}
|
||||
|
||||
|
||||
@SubscribeEvent
|
||||
public static void onMouseScrolled(MouseScrollEvent event) {
|
||||
if (Minecraft.getInstance().currentScreen != null)
|
||||
|
@ -76,7 +76,8 @@ public class ClientEvents {
|
|||
double delta = event.getScrollDelta();
|
||||
|
||||
boolean cancelled = CreateClient.schematicHandler.mouseScrolled(delta)
|
||||
|| CreateClient.schematicAndQuillHandler.mouseScrolled(delta);
|
||||
|| CreateClient.schematicAndQuillHandler.mouseScrolled(delta)
|
||||
|| IBlockWithScrollableValue.onScroll(delta);
|
||||
event.setCanceled(cancelled);
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,194 @@
|
|||
package com.simibubi.create.foundation.block;
|
||||
|
||||
import com.mojang.blaze3d.platform.GlStateManager;
|
||||
import com.simibubi.create.foundation.utility.TessellatorHelper;
|
||||
import com.simibubi.create.foundation.utility.VecHelper;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.WorldRenderer;
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
import net.minecraft.client.world.ClientWorld;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Direction.Axis;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.BlockRayTraceResult;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraft.world.IWorld;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.client.event.DrawBlockHighlightEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
|
||||
|
||||
@EventBusSubscriber(value = Dist.CLIENT)
|
||||
public interface IBlockWithScrollableValue {
|
||||
|
||||
public static final AxisAlignedBB VALUE_BB = new AxisAlignedBB(0, 0, 0, 2 / 16f, 6 / 16f, 6 / 16f);
|
||||
|
||||
public int getCurrentValue(BlockState state, IWorld world, BlockPos pos);
|
||||
|
||||
public void onScroll(BlockState state, IWorld world, BlockPos pos, double delta);
|
||||
|
||||
public String getValueName();
|
||||
|
||||
public Vec3d getValueBoxPosition(BlockState state, IWorld world, BlockPos pos);
|
||||
|
||||
public Direction getValueBoxDirection(BlockState state, IWorld world, BlockPos pos);
|
||||
|
||||
public default boolean isValueOnAllSides() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public static void onDrawBlockHighlight(DrawBlockHighlightEvent event) {
|
||||
if (event.getTarget() == null || !(event.getTarget() instanceof BlockRayTraceResult))
|
||||
return;
|
||||
|
||||
BlockRayTraceResult result = (BlockRayTraceResult) event.getTarget();
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
ClientWorld world = mc.world;
|
||||
BlockPos blockPos = result.getPos();
|
||||
BlockState state = world.getBlockState(blockPos);
|
||||
|
||||
if (!(state.getBlock() instanceof IBlockWithScrollableValue))
|
||||
return;
|
||||
if (!mc.player.isAllowEdit())
|
||||
return;
|
||||
|
||||
IBlockWithScrollableValue block = (IBlockWithScrollableValue) state.getBlock();
|
||||
Vec3d pos = new Vec3d(blockPos);
|
||||
|
||||
Vec3d valueBoxPosition = block.getValueBoxPosition(state, world, blockPos);
|
||||
AxisAlignedBB bb = VALUE_BB.offset(valueBoxPosition);
|
||||
bb = bb.grow(1 / 128f);
|
||||
Direction facing = block.isValueOnAllSides() ? result.getFace()
|
||||
: block.getValueBoxDirection(state, world, blockPos);
|
||||
|
||||
Vec3d cursor = result.getHitVec().subtract(VecHelper.getCenterOf(blockPos));
|
||||
cursor = VecHelper.rotate(cursor, facing.getHorizontalAngle() + 90, Axis.Y);
|
||||
cursor = VecHelper.rotate(cursor, facing == Direction.UP ? -90 : facing == Direction.DOWN ? 90 : 0, Axis.Z)
|
||||
.add(.5, .5, .5);
|
||||
boolean contains = bb.contains(cursor);
|
||||
|
||||
TessellatorHelper.prepareForDrawing();
|
||||
GlStateManager.enableBlend();
|
||||
GlStateManager.blendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA,
|
||||
GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE,
|
||||
GlStateManager.DestFactor.ZERO);
|
||||
GlStateManager.disableTexture();
|
||||
GlStateManager.depthMask(false);
|
||||
|
||||
Tessellator tessellator = Tessellator.getInstance();
|
||||
BufferBuilder bufferbuilder = tessellator.getBuffer();
|
||||
bufferbuilder.begin(3, DefaultVertexFormats.POSITION_COLOR);
|
||||
|
||||
GlStateManager.translated(pos.x, pos.y, pos.z);
|
||||
GlStateManager.translated(.5f, .5f, .5f);
|
||||
GlStateManager.rotated(-facing.getHorizontalAngle() - 90, 0, 1, 0);
|
||||
GlStateManager.rotated(facing == Direction.UP ? 90 : facing == Direction.DOWN ? -90 : 0, 0, 0, 1);
|
||||
GlStateManager.translated(-.5f, -.5f, -.5f);
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
|
||||
if (contains) {
|
||||
GlStateManager.lineWidth(2);
|
||||
WorldRenderer.drawBoundingBox(bufferbuilder, bb.minX, bb.minY, bb.minZ, bb.maxX, bb.maxY, bb.maxZ, .5f, 1,
|
||||
.75f, 1f);
|
||||
} else {
|
||||
GlStateManager.lineWidth(2);
|
||||
WorldRenderer.drawBoundingBox(bufferbuilder, bb.minX, bb.minY, bb.minZ, bb.maxX, bb.maxY, bb.maxZ, .25f,
|
||||
.5f, .35f, 1f);
|
||||
}
|
||||
|
||||
tessellator.draw();
|
||||
GlStateManager.popMatrix();
|
||||
|
||||
GlStateManager.enableTexture();
|
||||
GlStateManager.depthMask(true);
|
||||
|
||||
float textScale = 1 / 128f;
|
||||
|
||||
GlStateManager.rotated(90, 0, 1, 0);
|
||||
GlStateManager.translated(1 - valueBoxPosition.z - bb.getZSize(), valueBoxPosition.y + bb.getYSize(),
|
||||
valueBoxPosition.x);
|
||||
GlStateManager.translated(-1, 0, 3 / 32f);
|
||||
|
||||
if (contains) {
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.translated(bb.getZSize() + 1/32f, -1/16f, 0);
|
||||
GlStateManager.scaled(textScale, -textScale, textScale);
|
||||
|
||||
String text = block.getValueName();
|
||||
mc.fontRenderer.drawString(text, 0, 0, 0x88FFBB);
|
||||
GlStateManager.translated(0, 0, -1 / 4f);
|
||||
mc.fontRenderer.drawString(text, 1, 1, 0x224433);
|
||||
GlStateManager.translated(0, 0, 1 / 4f);
|
||||
|
||||
text = TextFormatting.ITALIC + "<Scroll>";
|
||||
mc.fontRenderer.drawString(text, 0, 10, 0xBBBBCC);
|
||||
GlStateManager.translated(0, 0, -1 / 4f);
|
||||
mc.fontRenderer.drawString(text, 1, 11, 0x111111);
|
||||
GlStateManager.translated(0, 0, 1 / 4f);
|
||||
|
||||
GlStateManager.popMatrix();
|
||||
}
|
||||
|
||||
String numberText = block.getCurrentValue(state, world, blockPos) + "";
|
||||
int stringWidth = mc.fontRenderer.getStringWidth(numberText);
|
||||
float numberScale = 4 / 128f * (6f / stringWidth);
|
||||
GlStateManager.translated(7/64f, -5/64f, 0);
|
||||
|
||||
GlStateManager.scaled(numberScale, -numberScale, numberScale);
|
||||
|
||||
mc.fontRenderer.drawString(numberText, 0, 0, 0xFFFFFF);
|
||||
GlStateManager.translated(0, 0, -1 / 4f);
|
||||
mc.fontRenderer.drawString(numberText, 1, 1, 0x224433);
|
||||
|
||||
GlStateManager.disableBlend();
|
||||
|
||||
GlStateManager.lineWidth(1);
|
||||
TessellatorHelper.cleanUpAfterDrawing();
|
||||
}
|
||||
|
||||
public static boolean onScroll(double delta) {
|
||||
RayTraceResult objectMouseOver = Minecraft.getInstance().objectMouseOver;
|
||||
if (!(objectMouseOver instanceof BlockRayTraceResult))
|
||||
return false;
|
||||
|
||||
BlockRayTraceResult result = (BlockRayTraceResult) objectMouseOver;
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
ClientWorld world = mc.world;
|
||||
BlockPos blockPos = result.getPos();
|
||||
BlockState state = world.getBlockState(blockPos);
|
||||
|
||||
if (!(state.getBlock() instanceof IBlockWithScrollableValue))
|
||||
return false;
|
||||
if (!mc.player.isAllowEdit())
|
||||
return false;
|
||||
|
||||
IBlockWithScrollableValue block = (IBlockWithScrollableValue) state.getBlock();
|
||||
Vec3d valueBoxPosition = block.getValueBoxPosition(state, world, blockPos);
|
||||
AxisAlignedBB bb = VALUE_BB.offset(valueBoxPosition);
|
||||
bb = bb.grow(1 / 128f);
|
||||
Direction facing = block.isValueOnAllSides() ? result.getFace()
|
||||
: block.getValueBoxDirection(state, world, blockPos);
|
||||
|
||||
Vec3d cursor = result.getHitVec().subtract(VecHelper.getCenterOf(blockPos));
|
||||
cursor = VecHelper.rotate(cursor, facing.getHorizontalAngle() + 90, Axis.Y);
|
||||
cursor = VecHelper.rotate(cursor, facing == Direction.UP ? -90 : facing == Direction.DOWN ? 90 : 0, Axis.Z)
|
||||
.add(.5, .5, .5);
|
||||
if (!bb.contains(cursor))
|
||||
return false;
|
||||
|
||||
block.onScroll(state, world, blockPos, delta);
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
package com.simibubi.create.modules.contraptions.generators;
|
||||
|
||||
import com.simibubi.create.foundation.packet.TileEntityConfigurationPacket;
|
||||
import com.simibubi.create.modules.contraptions.RotationPropagator;
|
||||
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
public class ConfigureMotorPacket extends TileEntityConfigurationPacket<MotorTileEntity> {
|
||||
|
||||
private int speed;
|
||||
|
||||
public ConfigureMotorPacket(BlockPos pos, int speed) {
|
||||
super(pos);
|
||||
this.speed = speed;
|
||||
}
|
||||
|
||||
public ConfigureMotorPacket(PacketBuffer buffer) {
|
||||
super(buffer);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeSettings(PacketBuffer buffer) {
|
||||
buffer.writeInt(speed);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void readSettings(PacketBuffer buffer) {
|
||||
speed = buffer.readInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void applySettings(MotorTileEntity te) {
|
||||
RotationPropagator.handleRemoved(te.getWorld(), te.getPos(), te);
|
||||
te.setSpeed(speed);
|
||||
te.sendData();
|
||||
RotationPropagator.handleAdded(te.getWorld(), te.getPos(), te);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,5 +1,7 @@
|
|||
package com.simibubi.create.modules.contraptions.generators;
|
||||
|
||||
import com.simibubi.create.foundation.block.IBlockWithScrollableValue;
|
||||
import com.simibubi.create.foundation.block.IWithTileEntity;
|
||||
import com.simibubi.create.foundation.utility.ItemDescription;
|
||||
import com.simibubi.create.modules.contraptions.base.HorizontalKineticBlock;
|
||||
|
||||
|
@ -9,16 +11,21 @@ import net.minecraft.tileentity.TileEntity;
|
|||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Direction.Axis;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
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;
|
||||
|
||||
public class MotorBlock extends HorizontalKineticBlock {
|
||||
public class MotorBlock extends HorizontalKineticBlock
|
||||
implements IWithTileEntity<MotorTileEntity>, IBlockWithScrollableValue {
|
||||
|
||||
protected static final VoxelShape MOTOR_X = makeCuboidShape(0, 3, 3, 16, 13, 13);
|
||||
protected static final VoxelShape MOTOR_Z = makeCuboidShape(3, 3, 0, 13, 13, 16);
|
||||
|
||||
private static final Vec3d valuePos = new Vec3d(15 / 16f, 5 / 16f, 5 / 16f);
|
||||
|
||||
public MotorBlock() {
|
||||
super(Properties.create(Material.IRON));
|
||||
}
|
||||
|
@ -54,8 +61,36 @@ public class MotorBlock extends HorizontalKineticBlock {
|
|||
|
||||
@Override
|
||||
public ItemDescription getDescription() {
|
||||
return new ItemDescription(color).withSummary("Provides Rotational Power.").withControl("When R-Clicked",
|
||||
"Opens the " + h("Configuration Screen", color)).createTabs();
|
||||
return new ItemDescription(color).withSummary("Provides Rotational Power.")
|
||||
.withControl("When R-Clicked", "Opens the " + h("Configuration Screen", color)).createTabs();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCurrentValue(BlockState state, IWorld world, BlockPos pos) {
|
||||
MotorTileEntity tileEntity = (MotorTileEntity) world.getTileEntity(pos);
|
||||
if (tileEntity == null)
|
||||
return 0;
|
||||
return tileEntity.getSpeedValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onScroll(BlockState state, IWorld world, BlockPos pos, double delta) {
|
||||
withTileEntityDo(world, pos, te -> te.setSpeedValueLazily((int) (te.getSpeedValue() * (delta > 0 ? 2 : .5f))));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getValueName() {
|
||||
return "Speed";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vec3d getValueBoxPosition(BlockState state, IWorld world, BlockPos pos) {
|
||||
return valuePos;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Direction getValueBoxDirection(BlockState state, IWorld world, BlockPos pos) {
|
||||
return state.get(HORIZONTAL_FACING).getOpposite();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,14 +1,22 @@
|
|||
package com.simibubi.create.modules.contraptions.generators;
|
||||
|
||||
import com.simibubi.create.AllPackets;
|
||||
import com.simibubi.create.AllTileEntities;
|
||||
import com.simibubi.create.modules.contraptions.base.KineticTileEntity;
|
||||
|
||||
public class MotorTileEntity extends KineticTileEntity {
|
||||
import net.minecraft.tileentity.ITickableTileEntity;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
|
||||
public class MotorTileEntity extends KineticTileEntity implements ITickableTileEntity {
|
||||
|
||||
public static final int MAX_SPEED = 4096;
|
||||
public static final int DEFAULT_SPEED = 64;
|
||||
public int newSpeed;
|
||||
public int lastModified;
|
||||
|
||||
public MotorTileEntity() {
|
||||
super(AllTileEntities.MOTOR.type);
|
||||
setSpeed(50);
|
||||
setForce(10);
|
||||
setSpeed(DEFAULT_SPEED);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -21,4 +29,35 @@ public class MotorTileEntity extends KineticTileEntity {
|
|||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSpeed(float speed) {
|
||||
super.setSpeed(speed);
|
||||
newSpeed = (int) speed;
|
||||
}
|
||||
|
||||
public int getSpeedValue() {
|
||||
if (world.isRemote)
|
||||
return newSpeed;
|
||||
return (int) speed;
|
||||
}
|
||||
|
||||
public void setSpeedValueLazily(int speed) {
|
||||
if (newSpeed == speed)
|
||||
return;
|
||||
newSpeed = MathHelper.clamp(speed, 1, MAX_SPEED);
|
||||
this.lastModified = 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tick() {
|
||||
if (!world.isRemote)
|
||||
return;
|
||||
if (lastModified == -1)
|
||||
return;
|
||||
if (lastModified++ > 10) {
|
||||
lastModified = -1;
|
||||
AllPackets.channel.sendToServer(new ConfigureMotorPacket(pos, newSpeed));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,101 @@
|
|||
package com.simibubi.create.modules.contraptions.receivers.constructs;
|
||||
|
||||
import com.simibubi.create.foundation.block.IBlockWithScrollableValue;
|
||||
import com.simibubi.create.foundation.block.IWithTileEntity;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.RotatedPillarBlock;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.state.BooleanProperty;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
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.IBlockReader;
|
||||
import net.minecraft.world.IWorld;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public abstract class AbstractChassisBlock extends RotatedPillarBlock
|
||||
implements IWithTileEntity<ChassisTileEntity>, IBlockWithScrollableValue {
|
||||
|
||||
private static final Vec3d valuePos = new Vec3d(15 / 16f, 9 / 16f, 9 / 16f);
|
||||
|
||||
public AbstractChassisBlock(Properties properties) {
|
||||
super(properties);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(BlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity(BlockState state, IBlockReader world) {
|
||||
return new ChassisTileEntity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn,
|
||||
BlockRayTraceResult hit) {
|
||||
if (!player.isAllowEdit())
|
||||
return false;
|
||||
|
||||
BooleanProperty affectedSide = getGlueableSide(state, hit.getFace());
|
||||
if (affectedSide == null)
|
||||
return false;
|
||||
|
||||
ItemStack heldItem = player.getHeldItem(handIn);
|
||||
boolean isSlimeBall = heldItem.isItemEqual(new ItemStack(Items.SLIME_BALL));
|
||||
if ((!heldItem.isEmpty() || !player.isSneaking()) && !isSlimeBall)
|
||||
return false;
|
||||
if (state.get(affectedSide) == isSlimeBall)
|
||||
return false;
|
||||
if (worldIn.isRemote)
|
||||
return true;
|
||||
|
||||
if (isSlimeBall && !player.isCreative())
|
||||
heldItem.shrink(1);
|
||||
worldIn.setBlockState(pos, state.with(affectedSide, isSlimeBall));
|
||||
return true;
|
||||
}
|
||||
|
||||
public abstract BooleanProperty getGlueableSide(BlockState state, Direction face);
|
||||
|
||||
@Override
|
||||
public int getCurrentValue(BlockState state, IWorld world, BlockPos pos) {
|
||||
ChassisTileEntity tileEntity = (ChassisTileEntity) world.getTileEntity(pos);
|
||||
if (tileEntity == null)
|
||||
return 0;
|
||||
return tileEntity.getRange();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getValueName() {
|
||||
return "Range";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vec3d getValueBoxPosition(BlockState state, IWorld world, BlockPos pos) {
|
||||
return valuePos;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Direction getValueBoxDirection(BlockState state, IWorld world, BlockPos pos) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValueOnAllSides() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onScroll(BlockState state, IWorld world, BlockPos pos, double value) {
|
||||
withTileEntityDo(world, pos, te -> te.setRangeLazily((int) (te.getRange() + value)));
|
||||
}
|
||||
|
||||
}
|
|
@ -1,37 +0,0 @@
|
|||
package com.simibubi.create.modules.contraptions.receivers.constructs;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.block.RotatedPillarBlock;
|
||||
import net.minecraft.item.BlockItemUseContext;
|
||||
import net.minecraft.util.BlockRenderLayer;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
public class ChassisBlock extends RotatedPillarBlock {
|
||||
|
||||
public Type type;
|
||||
|
||||
public enum Type {
|
||||
NORMAL, STICKY, RELOCATING;
|
||||
}
|
||||
|
||||
public ChassisBlock(Type type) {
|
||||
super(Properties.from(Blocks.STRIPPED_SPRUCE_WOOD));
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockRenderLayer getRenderLayer() {
|
||||
return BlockRenderLayer.CUTOUT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState getStateForPlacement(BlockItemUseContext context) {
|
||||
BlockPos placedOnPos = context.getPos().offset(context.getFace().getOpposite());
|
||||
BlockState blockState = context.getWorld().getBlockState(placedOnPos);
|
||||
if (blockState.getBlock() instanceof ChassisBlock)
|
||||
return getDefaultState().with(AXIS, blockState.get(AXIS));
|
||||
return super.getStateForPlacement(context);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,67 @@
|
|||
package com.simibubi.create.modules.contraptions.receivers.constructs;
|
||||
|
||||
import com.simibubi.create.AllPackets;
|
||||
import com.simibubi.create.AllTileEntities;
|
||||
import com.simibubi.create.foundation.block.SyncedTileEntity;
|
||||
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.tileentity.ITickableTileEntity;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
|
||||
public class ChassisTileEntity extends SyncedTileEntity implements ITickableTileEntity {
|
||||
|
||||
public static final int MAX_RANGE = 16;
|
||||
public static final int DEFAULT_RANGE = 8;
|
||||
private int range;
|
||||
|
||||
public int newRange;
|
||||
public int lastModified;
|
||||
|
||||
public ChassisTileEntity() {
|
||||
super(AllTileEntities.CHASSIS.type);
|
||||
newRange = range = DEFAULT_RANGE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompoundNBT write(CompoundNBT compound) {
|
||||
compound.putInt("Range", range);
|
||||
return super.write(compound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(CompoundNBT compound) {
|
||||
newRange = range = compound.getInt("Range");
|
||||
super.read(compound);
|
||||
}
|
||||
|
||||
public int getRange() {
|
||||
if (world.isRemote)
|
||||
return newRange;
|
||||
return range;
|
||||
}
|
||||
|
||||
public void setRange(int range) {
|
||||
this.range = range;
|
||||
sendData();
|
||||
}
|
||||
|
||||
public void setRangeLazily(int range) {
|
||||
this.newRange = MathHelper.clamp(range, 1, MAX_RANGE);
|
||||
if (newRange == this.range)
|
||||
return;
|
||||
this.lastModified = 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tick() {
|
||||
if (!world.isRemote)
|
||||
return;
|
||||
if (lastModified == -1)
|
||||
return;
|
||||
if (lastModified++ > 10) {
|
||||
lastModified = -1;
|
||||
AllPackets.channel.sendToServer(new ConfigureChassisPacket(pos, newRange));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
package com.simibubi.create.modules.contraptions.receivers.constructs;
|
||||
|
||||
import com.simibubi.create.foundation.packet.TileEntityConfigurationPacket;
|
||||
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
public class ConfigureChassisPacket extends TileEntityConfigurationPacket<ChassisTileEntity> {
|
||||
|
||||
private int range;
|
||||
|
||||
public ConfigureChassisPacket(BlockPos pos, int range) {
|
||||
super(pos);
|
||||
this.range = range;
|
||||
}
|
||||
|
||||
public ConfigureChassisPacket(PacketBuffer buffer) {
|
||||
super(buffer);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeSettings(PacketBuffer buffer) {
|
||||
buffer.writeInt(range);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void readSettings(PacketBuffer buffer) {
|
||||
range = buffer.readInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void applySettings(ChassisTileEntity te) {
|
||||
te.setRange(range);
|
||||
te.sendData();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
package com.simibubi.create.modules.contraptions.receivers.constructs;
|
||||
|
||||
import com.simibubi.create.foundation.utility.ItemDescription;
|
||||
import com.simibubi.create.foundation.utility.ItemDescription.Palette;
|
||||
import com.simibubi.create.modules.contraptions.base.DirectionalKineticBlock;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class MechanicalBearingBlock extends DirectionalKineticBlock {
|
||||
|
||||
public MechanicalBearingBlock() {
|
||||
super(Properties.from(Blocks.PISTON));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemDescription getDescription() {
|
||||
Palette color = Palette.Red;
|
||||
return new ItemDescription(color)
|
||||
.withSummary("Rotates attached structures around its axis. Can be used to generate rotational energy.")
|
||||
.createTabs();
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity(BlockState state, IBlockReader world) {
|
||||
return new MechanicalBearingTileEntity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasShaftTowards(World world, BlockPos pos, BlockState state, Direction face) {
|
||||
return face == state.get(FACING).getOpposite();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean hasStaticPart() {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
package com.simibubi.create.modules.contraptions.receivers.constructs;
|
||||
|
||||
import com.simibubi.create.AllTileEntities;
|
||||
import com.simibubi.create.modules.contraptions.base.KineticTileEntity;
|
||||
|
||||
public class MechanicalBearingTileEntity extends KineticTileEntity {
|
||||
|
||||
public MechanicalBearingTileEntity() {
|
||||
super(AllTileEntities.MECHANICAL_BEARING.type);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
package com.simibubi.create.modules.contraptions.receivers.constructs;
|
||||
|
||||
import com.simibubi.create.AllBlocks;
|
||||
import com.simibubi.create.modules.contraptions.base.KineticTileEntity;
|
||||
import com.simibubi.create.modules.contraptions.base.KineticTileEntityRenderer;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.state.properties.BlockStateProperties;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraftforge.client.model.animation.Animation;
|
||||
|
||||
public class MechanicalBearingTileEntityRenderer extends KineticTileEntityRenderer {
|
||||
|
||||
@Override
|
||||
public void renderTileEntityFast(KineticTileEntity te, double x, double y, double z, float partialTicks,
|
||||
int destroyStage, BufferBuilder buffer) {
|
||||
final Direction facing = te.getBlockState().get(BlockStateProperties.FACING);
|
||||
final BlockPos pos = te.getPos();
|
||||
float time = Animation.getWorldTime(Minecraft.getInstance().world, partialTicks);
|
||||
BlockState shaftState = AllBlocks.SHAFT_HALF.get().getDefaultState().with(BlockStateProperties.FACING,
|
||||
facing.getOpposite());
|
||||
BlockState capState = AllBlocks.MECHANICAL_BEARING_TOP.get().getDefaultState().with(BlockStateProperties.FACING,
|
||||
facing);
|
||||
|
||||
cacheIfMissing(shaftState, BlockModelSpinner::new);
|
||||
cacheIfMissing(capState, BlockModelSpinner::new);
|
||||
|
||||
float offset = getRotationOffsetForPosition(te, pos, facing.getAxis());
|
||||
float angle = (time * te.getSpeed()) % 360;
|
||||
|
||||
angle += offset;
|
||||
angle = angle / 180f * (float) Math.PI;
|
||||
|
||||
renderFromCache(buffer, shaftState, (float) x, (float) y, (float) z, pos, facing.getAxis(), angle);
|
||||
renderFromCache(buffer, capState, (float) x, (float) y, (float) z, pos, facing.getAxis(), angle);
|
||||
}
|
||||
|
||||
}
|
|
@ -120,7 +120,7 @@ public class MechanicalPistonBlock extends KineticBlock {
|
|||
BlockPos pistonHead = null;
|
||||
BlockPos pistonBase = pos;
|
||||
|
||||
for (int offset = 1; offset < Construct.MAX_EXTENSIONS; offset++) {
|
||||
for (int offset = 1; offset < TranslationConstruct.MAX_EXTENSIONS; offset++) {
|
||||
BlockPos currentPos = pos.offset(direction, offset);
|
||||
BlockState block = worldIn.getBlockState(currentPos);
|
||||
|
||||
|
@ -140,7 +140,7 @@ public class MechanicalPistonBlock extends KineticBlock {
|
|||
.forEach(p -> worldIn.destroyBlock(p, !player.isCreative()));
|
||||
}
|
||||
|
||||
for (int offset = 1; offset < Construct.MAX_EXTENSIONS; offset++) {
|
||||
for (int offset = 1; offset < TranslationConstruct.MAX_EXTENSIONS; offset++) {
|
||||
BlockPos currentPos = pos.offset(direction.getOpposite(), offset);
|
||||
BlockState block = worldIn.getBlockState(currentPos);
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ public class MechanicalPistonHeadBlock extends ProperDirectionalBlock implements
|
|||
BlockPos pistonHead = pos;
|
||||
BlockPos pistonBase = null;
|
||||
|
||||
for (int offset = 1; offset < Construct.MAX_EXTENSIONS; offset++) {
|
||||
for (int offset = 1; offset < TranslationConstruct.MAX_EXTENSIONS; offset++) {
|
||||
BlockPos currentPos = pos.offset(direction.getOpposite(), offset);
|
||||
BlockState block = worldIn.getBlockState(currentPos);
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@ import net.minecraft.block.Blocks;
|
|||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.state.properties.BlockStateProperties;
|
||||
import net.minecraft.tileentity.ITickableTileEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Direction.Axis;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
|
@ -24,7 +25,7 @@ import net.minecraft.world.gen.feature.template.Template.BlockInfo;
|
|||
|
||||
public class MechanicalPistonTileEntity extends KineticTileEntity implements ITickableTileEntity {
|
||||
|
||||
protected Construct movingConstruct;
|
||||
protected TranslationConstruct movingConstruct;
|
||||
protected float offset;
|
||||
protected boolean running;
|
||||
protected boolean assembleNextTick;
|
||||
|
@ -65,7 +66,7 @@ public class MechanicalPistonTileEntity extends KineticTileEntity implements ITi
|
|||
running = tag.getBoolean("Running");
|
||||
offset = tag.getFloat("Offset");
|
||||
if (running)
|
||||
movingConstruct = Construct.fromNBT(tag.getCompound("Construct"));
|
||||
movingConstruct = TranslationConstruct.fromNBT(tag.getCompound("Construct"));
|
||||
|
||||
super.read(tag);
|
||||
}
|
||||
|
@ -85,8 +86,9 @@ public class MechanicalPistonTileEntity extends KineticTileEntity implements ITi
|
|||
Direction direction = getBlockState().get(BlockStateProperties.FACING);
|
||||
|
||||
// Collect Construct
|
||||
movingConstruct = getMovementSpeed() < 0 ? Construct.getAttachedForPulling(getWorld(), getPos(), direction)
|
||||
: Construct.getAttachedForPushing(getWorld(), getPos(), direction);
|
||||
movingConstruct = getMovementSpeed() < 0
|
||||
? TranslationConstruct.getAttachedForPulling(getWorld(), getPos(), direction)
|
||||
: TranslationConstruct.getAttachedForPushing(getWorld(), getPos(), direction);
|
||||
if (movingConstruct == null)
|
||||
return;
|
||||
|
||||
|
@ -141,6 +143,10 @@ public class MechanicalPistonTileEntity extends KineticTileEntity implements ITi
|
|||
|
||||
world.destroyBlock(targetPos, world.getBlockState(targetPos).getCollisionShape(world, targetPos).isEmpty());
|
||||
getWorld().setBlockState(targetPos, state, 3);
|
||||
TileEntity tileEntity = world.getTileEntity(targetPos);
|
||||
if (tileEntity != null && block.nbt != null) {
|
||||
((ChassisTileEntity) tileEntity).setRange(block.nbt.getInt("Range"));
|
||||
}
|
||||
}
|
||||
|
||||
running = false;
|
||||
|
@ -206,10 +212,11 @@ public class MechanicalPistonTileEntity extends KineticTileEntity implements ITi
|
|||
BlockPos relativePos = BlockPos.ZERO.offset(movementDirection, getModulatedOffset(newOffset));
|
||||
|
||||
// Other moving Pistons
|
||||
int maxPossibleRange = Construct.MAX_EXTENSIONS + Construct.MAX_CHAINED_BLOCKS + Construct.MAX_CHAINED_CHASSIS;
|
||||
int maxPossibleRange = TranslationConstruct.MAX_EXTENSIONS + TranslationConstruct.MAX_CHAINED_BLOCKS
|
||||
+ TranslationConstruct.MAX_CHAINED_CHASSIS;
|
||||
Iterator<MechanicalPistonTileEntity> iterator = Create.constructHandler.getOtherMovingPistonsInWorld(this)
|
||||
.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
pistonLoop: while (iterator.hasNext()) {
|
||||
MechanicalPistonTileEntity otherPiston = iterator.next();
|
||||
|
||||
if (otherPiston == this)
|
||||
|
@ -225,24 +232,32 @@ public class MechanicalPistonTileEntity extends KineticTileEntity implements ITi
|
|||
BlockPos otherRelativePos = BlockPos.ZERO.offset(otherMovementDirection,
|
||||
getModulatedOffset(otherPiston.offset));
|
||||
|
||||
for (AxisAlignedBB thisBB : Arrays.asList(movingConstruct.collisionBoxFront,
|
||||
for (AxisAlignedBB tBB : Arrays.asList(movingConstruct.collisionBoxFront,
|
||||
movingConstruct.collisionBoxBack)) {
|
||||
for (AxisAlignedBB otherBB : Arrays.asList(otherPiston.movingConstruct.collisionBoxFront,
|
||||
for (AxisAlignedBB oBB : Arrays.asList(otherPiston.movingConstruct.collisionBoxFront,
|
||||
otherPiston.movingConstruct.collisionBoxBack)) {
|
||||
|
||||
if (thisBB == null || otherBB == null)
|
||||
if (tBB == null || oBB == null)
|
||||
continue;
|
||||
if (thisBB.offset(relativePos).intersects(otherBB.offset(otherRelativePos))) {
|
||||
|
||||
boolean frontalCollision = otherMovementDirection == movementDirection.getOpposite();
|
||||
BlockPos thisColliderOffset = relativePos.offset(movementDirection,
|
||||
frontalCollision ? (getMovementSpeed() > 0 ? 1 : -1) : 0);
|
||||
AxisAlignedBB thisBB = tBB.offset(thisColliderOffset);
|
||||
AxisAlignedBB otherBB = oBB.offset(otherRelativePos);
|
||||
|
||||
if (thisBB.intersects(otherBB)) {
|
||||
boolean actuallyColliding = false;
|
||||
for (BlockPos colliderPos : movingConstruct.getColliders(world, movementDirection)) {
|
||||
colliderPos = colliderPos.add(thisColliderOffset).subtract(otherRelativePos);
|
||||
if (!otherPiston.movingConstruct.blocks.containsKey(colliderPos))
|
||||
continue;
|
||||
actuallyColliding = true;
|
||||
}
|
||||
if (!actuallyColliding)
|
||||
continue pistonLoop;
|
||||
hadCollisionWithOtherPiston = true;
|
||||
return true;
|
||||
}
|
||||
if (otherMovementDirection == movementDirection.getOpposite()) {
|
||||
if (thisBB.offset(relativePos.offset(movementDirection, getMovementSpeed() > 0 ? 1 : -1))
|
||||
.intersects(otherBB.offset(otherRelativePos))) {
|
||||
hadCollisionWithOtherPiston = true;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ import net.minecraftforge.client.model.data.EmptyModelData;
|
|||
|
||||
public class MechanicalPistonTileEntityRenderer extends KineticTileEntityRenderer {
|
||||
|
||||
protected static Cache<Construct, ConstructVertexBuffer> cachedConstructs;
|
||||
protected static Cache<TranslationConstruct, ConstructVertexBuffer> cachedConstructs;
|
||||
|
||||
@Override
|
||||
public void renderTileEntityFast(KineticTileEntity te, double x, double y, double z, float partialTicks,
|
||||
|
@ -44,7 +44,7 @@ public class MechanicalPistonTileEntityRenderer extends KineticTileEntityRendere
|
|||
|
||||
}
|
||||
|
||||
protected void cacheConstructIfMissing(Construct c) {
|
||||
protected void cacheConstructIfMissing(TranslationConstruct c) {
|
||||
if (cachedConstructs == null)
|
||||
cachedConstructs = CacheBuilder.newBuilder().expireAfterAccess(1, TimeUnit.SECONDS).build();
|
||||
if (cachedConstructs.getIfPresent(c) != null)
|
||||
|
@ -67,7 +67,7 @@ public class MechanicalPistonTileEntityRenderer extends KineticTileEntityRendere
|
|||
cachedConstructs.put(c, new ConstructVertexBuffer(builder.getByteBuffer()));
|
||||
}
|
||||
|
||||
protected void renderConstructFromCache(Construct c, MechanicalPistonTileEntity te, double x, double y, double z,
|
||||
protected void renderConstructFromCache(TranslationConstruct c, MechanicalPistonTileEntity te, double x, double y, double z,
|
||||
float partialTicks, BufferBuilder buffer) {
|
||||
final Vec3d offset = te.getConstructOffset(partialTicks);
|
||||
buffer.putBulkData(cachedConstructs.getIfPresent(c).getTransformed(te,
|
||||
|
|
|
@ -48,7 +48,7 @@ public class MovingConstructHandler {
|
|||
float newOffset) {
|
||||
World world = te.getWorld();
|
||||
Vec3d movementVec = new Vec3d(te.getBlockState().get(BlockStateProperties.FACING).getDirectionVec());
|
||||
Construct construct = te.movingConstruct;
|
||||
TranslationConstruct construct = te.movingConstruct;
|
||||
|
||||
if (world.isRemote) {
|
||||
renderedBBs.clear();
|
||||
|
@ -142,6 +142,7 @@ public class MovingConstructHandler {
|
|||
entity.onGround = true;
|
||||
}
|
||||
entity.setMotion(allowedMovement.subtract(movement.subtract(motion)));
|
||||
entity.velocityChanged = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ public class PistonPoleBlock extends ProperDirectionalBlock implements ITooltip
|
|||
BlockPos pistonBase = null;
|
||||
|
||||
for (int modifier : new int[] { 1, -1 }) {
|
||||
for (int offset = modifier; modifier * offset < Construct.MAX_EXTENSIONS; offset += modifier) {
|
||||
for (int offset = modifier; modifier * offset < TranslationConstruct.MAX_EXTENSIONS; offset += modifier) {
|
||||
BlockPos currentPos = pos.offset(direction, offset);
|
||||
BlockState block = worldIn.getBlockState(currentPos);
|
||||
|
||||
|
|
|
@ -0,0 +1,75 @@
|
|||
package com.simibubi.create.modules.contraptions.receivers.constructs;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.state.BooleanProperty;
|
||||
import net.minecraft.state.StateContainer.Builder;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Direction.Axis;
|
||||
|
||||
public class RotationChassisBlock extends AbstractChassisBlock {
|
||||
|
||||
public static final BooleanProperty STICKY_NORTH = BooleanProperty.create("sticky_north");
|
||||
public static final BooleanProperty STICKY_SOUTH = BooleanProperty.create("sticky_south");
|
||||
public static final BooleanProperty STICKY_EAST = BooleanProperty.create("sticky_east");
|
||||
public static final BooleanProperty STICKY_WEST = BooleanProperty.create("sticky_west");
|
||||
|
||||
public RotationChassisBlock() {
|
||||
super(Properties.from(Blocks.PISTON));
|
||||
setDefaultState(getDefaultState().with(STICKY_EAST, false).with(STICKY_SOUTH, false).with(STICKY_NORTH, false)
|
||||
.with(STICKY_WEST, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void fillStateContainer(Builder<Block, BlockState> builder) {
|
||||
builder.add(STICKY_NORTH, STICKY_EAST, STICKY_SOUTH, STICKY_WEST);
|
||||
super.fillStateContainer(builder);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getValueName() {
|
||||
return "Radius";
|
||||
}
|
||||
|
||||
@Override
|
||||
public BooleanProperty getGlueableSide(BlockState state, Direction face) {
|
||||
Axis axis = state.get(AXIS);
|
||||
|
||||
if (axis == Axis.X) {
|
||||
if (face == Direction.NORTH)
|
||||
return STICKY_WEST;
|
||||
if (face == Direction.SOUTH)
|
||||
return STICKY_EAST;
|
||||
if (face == Direction.UP)
|
||||
return STICKY_NORTH;
|
||||
if (face == Direction.DOWN)
|
||||
return STICKY_SOUTH;
|
||||
}
|
||||
|
||||
if (axis == Axis.Y) {
|
||||
if (face == Direction.NORTH)
|
||||
return STICKY_NORTH;
|
||||
if (face == Direction.SOUTH)
|
||||
return STICKY_SOUTH;
|
||||
if (face == Direction.EAST)
|
||||
return STICKY_EAST;
|
||||
if (face == Direction.WEST)
|
||||
return STICKY_WEST;
|
||||
}
|
||||
|
||||
if (axis == Axis.Z) {
|
||||
if (face == Direction.UP)
|
||||
return STICKY_NORTH;
|
||||
if (face == Direction.DOWN)
|
||||
return STICKY_SOUTH;
|
||||
if (face == Direction.EAST)
|
||||
return STICKY_EAST;
|
||||
if (face == Direction.WEST)
|
||||
return STICKY_WEST;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
package com.simibubi.create.modules.contraptions.receivers.constructs;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.item.BlockItemUseContext;
|
||||
import net.minecraft.state.BooleanProperty;
|
||||
import net.minecraft.state.StateContainer.Builder;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Direction.AxisDirection;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
public class TranslationChassisBlock extends AbstractChassisBlock {
|
||||
|
||||
public static final BooleanProperty STICKY_TOP = BooleanProperty.create("sticky_top");
|
||||
public static final BooleanProperty STICKY_BOTTOM = BooleanProperty.create("sticky_bottom");
|
||||
|
||||
public TranslationChassisBlock() {
|
||||
super(Properties.from(Blocks.PISTON));
|
||||
setDefaultState(getDefaultState().with(STICKY_TOP, false).with(STICKY_BOTTOM, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void fillStateContainer(Builder<Block, BlockState> builder) {
|
||||
builder.add(STICKY_TOP, STICKY_BOTTOM);
|
||||
super.fillStateContainer(builder);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState getStateForPlacement(BlockItemUseContext context) {
|
||||
BlockPos placedOnPos = context.getPos().offset(context.getFace().getOpposite());
|
||||
BlockState blockState = context.getWorld().getBlockState(placedOnPos);
|
||||
if (blockState.getBlock() instanceof TranslationChassisBlock && !context.isPlacerSneaking())
|
||||
return getDefaultState().with(AXIS, blockState.get(AXIS));
|
||||
return super.getStateForPlacement(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BooleanProperty getGlueableSide(BlockState state, Direction face) {
|
||||
return face.getAxisDirection() == AxisDirection.POSITIVE ? STICKY_TOP : STICKY_BOTTOM;
|
||||
}
|
||||
|
||||
}
|
|
@ -32,7 +32,7 @@ import net.minecraft.util.math.BlockPos;
|
|||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.gen.feature.template.Template.BlockInfo;
|
||||
|
||||
public class Construct {
|
||||
public class TranslationConstruct {
|
||||
|
||||
public static final int MAX_EXTENSIONS = 20;
|
||||
public static final int MAX_CHAINED_CHASSIS = 12;
|
||||
|
@ -50,7 +50,7 @@ public class Construct {
|
|||
protected int extensionLength;
|
||||
protected int initialExtensionProgress;
|
||||
|
||||
public Construct() {
|
||||
public TranslationConstruct() {
|
||||
blocks = new HashMap<>();
|
||||
actors = new ArrayList<>();
|
||||
}
|
||||
|
@ -79,8 +79,8 @@ public class Construct {
|
|||
return cachedColliders;
|
||||
}
|
||||
|
||||
public static Construct getAttachedForPushing(World world, BlockPos pos, Direction direction) {
|
||||
Construct construct = new Construct();
|
||||
public static TranslationConstruct getAttachedForPushing(World world, BlockPos pos, Direction direction) {
|
||||
TranslationConstruct construct = new TranslationConstruct();
|
||||
|
||||
if (!construct.collectExtensions(world, pos, direction))
|
||||
return null;
|
||||
|
@ -91,8 +91,8 @@ public class Construct {
|
|||
return construct;
|
||||
}
|
||||
|
||||
public static Construct getAttachedForPulling(World world, BlockPos pos, Direction direction) {
|
||||
Construct construct = new Construct();
|
||||
public static TranslationConstruct getAttachedForPulling(World world, BlockPos pos, Direction direction) {
|
||||
TranslationConstruct construct = new TranslationConstruct();
|
||||
|
||||
if (!construct.collectExtensions(world, pos, direction))
|
||||
return null;
|
||||
|
@ -266,19 +266,30 @@ public class Construct {
|
|||
BlockState chassisState = world.getBlockState(currentChassisPos);
|
||||
|
||||
// Not attached to a chassis
|
||||
if (!(chassisState.getBlock() instanceof ChassisBlock))
|
||||
if (!(chassisState.getBlock() instanceof TranslationChassisBlock))
|
||||
continue;
|
||||
|
||||
int chassisRange = ((ChassisTileEntity) world.getTileEntity(currentChassisPos)).getRange();
|
||||
boolean chassisSticky = chassisState
|
||||
.get(((AbstractChassisBlock) chassisState.getBlock()).getGlueableSide(chassisState, direction));
|
||||
|
||||
// Ignore replaceable Blocks and Air-like
|
||||
if (state.getMaterial().isReplaceable() || state.isAir(world, currentPos))
|
||||
continue;
|
||||
if (state.getCollisionShape(world, currentPos).isEmpty())
|
||||
continue;
|
||||
|
||||
// Too many Blocks
|
||||
if (!currentChassisPos.withinDistance(currentPos, MAX_CHAINED_BLOCKS + 2))
|
||||
if (direction == movementDirection && !currentChassisPos.withinDistance(currentPos, chassisRange + 1))
|
||||
return null;
|
||||
if (direction != movementDirection && !currentChassisPos.withinDistance(currentPos, chassisRange + 1))
|
||||
continue;
|
||||
|
||||
// Skip if pushed column ended already (Except for Relocating Chassis)
|
||||
if (!AllBlocks.RELOCATION_CONSTRUCT.typeOf(chassisState) && !currentPos.equals(currentChassisPos)) {
|
||||
if (!chassisSticky && !currentPos.equals(currentChassisPos)) {
|
||||
boolean skip = false;
|
||||
|
||||
if (movementDirection != direction && !currentChassisPos.withinDistance(currentPos,
|
||||
AllBlocks.STICKY_CONSTRUCT.typeOf(chassisState) ? 2 : 1))
|
||||
if (movementDirection != direction && !currentChassisPos.withinDistance(currentPos, 1))
|
||||
continue;
|
||||
|
||||
for (BlockPos p = currentPos; !p.equals(currentChassisPos); p = p.offset(direction.getOpposite())) {
|
||||
|
@ -293,21 +304,18 @@ public class Construct {
|
|||
}
|
||||
|
||||
// Ignore sand and co.
|
||||
if (AllBlocks.RELOCATION_CONSTRUCT.typeOf(chassisState) && movementDirection != direction
|
||||
&& state.getBlock() instanceof FallingBlock)
|
||||
continue;
|
||||
|
||||
// Ignore replaceable Blocks and Air-like
|
||||
if (state.getMaterial().isReplaceable() || state.isAir(world, currentPos))
|
||||
continue;
|
||||
if (state.getCollisionShape(world, currentPos).isEmpty())
|
||||
if (chassisSticky && movementDirection != direction && state.getBlock() instanceof FallingBlock)
|
||||
continue;
|
||||
|
||||
// Structure is immobile
|
||||
if (!canPush(world, currentPos, movementDirection))
|
||||
return null;
|
||||
|
||||
blocks.add(new BlockInfo(currentPos.offset(direction, -offset), state, null));
|
||||
CompoundNBT nbt = new CompoundNBT();
|
||||
nbt.putInt("Range", chassisRange);
|
||||
|
||||
blocks.add(new BlockInfo(currentPos.offset(direction, -offset), state,
|
||||
AllBlocks.TRANSLATION_CHASSIS.typeOf(state) ? nbt : null));
|
||||
for (Direction facing : Direction.values()) {
|
||||
if (currentChassisPos.equals(currentPos) && facing == direction.getOpposite())
|
||||
continue;
|
||||
|
@ -322,7 +330,8 @@ public class Construct {
|
|||
}
|
||||
|
||||
private static boolean canPush(World world, BlockPos pos, Direction direction) {
|
||||
return PistonBlock.canPush(world.getBlockState(pos), world, pos, direction, true, direction);
|
||||
return PistonBlock.canPush(world.getBlockState(pos), world, pos, direction, true, direction)
|
||||
|| AllBlocks.TRANSLATION_CHASSIS.typeOf(world.getBlockState(pos));
|
||||
}
|
||||
|
||||
private static boolean canPull(World world, BlockPos pos, Direction direction) {
|
||||
|
@ -343,7 +352,7 @@ public class Construct {
|
|||
continue;
|
||||
|
||||
BlockState blockState = world.getBlockState(current);
|
||||
if (!(blockState.getBlock() instanceof ChassisBlock))
|
||||
if (!(blockState.getBlock() instanceof TranslationChassisBlock))
|
||||
continue;
|
||||
if (blockState.get(BlockStateProperties.AXIS) != direction.getAxis())
|
||||
continue;
|
||||
|
@ -375,6 +384,8 @@ public class Construct {
|
|||
CompoundNBT c = new CompoundNBT();
|
||||
c.put("Block", NBTUtil.writeBlockState(block.state));
|
||||
c.put("Pos", NBTUtil.writeBlockPos(block.pos));
|
||||
if (block.nbt != null)
|
||||
c.put("Data", block.nbt);
|
||||
blocks.add(c);
|
||||
}
|
||||
|
||||
|
@ -412,12 +423,13 @@ public class Construct {
|
|||
|
||||
}
|
||||
|
||||
public static Construct fromNBT(CompoundNBT nbt) {
|
||||
Construct construct = new Construct();
|
||||
public static TranslationConstruct fromNBT(CompoundNBT nbt) {
|
||||
TranslationConstruct construct = new TranslationConstruct();
|
||||
nbt.getList("Blocks", 10).forEach(c -> {
|
||||
CompoundNBT comp = (CompoundNBT) c;
|
||||
BlockInfo info = new BlockInfo(NBTUtil.readBlockPos(comp.getCompound("Pos")),
|
||||
NBTUtil.readBlockState(comp.getCompound("Block")), null);
|
||||
NBTUtil.readBlockState(comp.getCompound("Block")),
|
||||
comp.contains("Data") ? comp.getCompound("Data") : null);
|
||||
construct.blocks.put(info.pos, info);
|
||||
});
|
||||
construct.extensionLength = nbt.getInt("ExtensionLength");
|
|
@ -1,11 +0,0 @@
|
|||
{
|
||||
"forgemarker": 1,
|
||||
"defaults": {
|
||||
"model": "create:block/construct_normal"
|
||||
},
|
||||
"variants": {
|
||||
"axis=y": { "model": "create:block/construct_normal" },
|
||||
"axis=z": { "model": "create:block/construct_normal", "x": 90 },
|
||||
"axis=x": { "model": "create:block/construct_normal", "x": 90, "y": 90 }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"forge_marker": 1,
|
||||
"defaults": {
|
||||
"model": "create:block/mechanical_bearing_base"
|
||||
},
|
||||
"variants": {
|
||||
"facing" : {
|
||||
"up" : { },
|
||||
"down" : { "x": 180 },
|
||||
"north" : { "x": 90 },
|
||||
"east" : { "x": 90, "y": 90 },
|
||||
"south" : { "x": 90, "y": 180 },
|
||||
"west" : { "x": 90, "y": 270 }
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"forge_marker": 1,
|
||||
"defaults": {
|
||||
"model": "create:block/mechanical_bearing_top"
|
||||
},
|
||||
"variants": {
|
||||
"facing" : {
|
||||
"up" : { },
|
||||
"down" : { "x": 180 },
|
||||
"north" : { "x": 90 },
|
||||
"east" : { "x": 90, "y": 90 },
|
||||
"south" : { "x": 90, "y": 180 },
|
||||
"west" : { "x": 90, "y": 270 }
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
{
|
||||
"forgemarker": 1,
|
||||
"defaults": {
|
||||
"model": "create:block/construct_relocating"
|
||||
},
|
||||
"variants": {
|
||||
"axis=y": { "model": "create:block/construct_relocating" },
|
||||
"axis=z": { "model": "create:block/construct_relocating", "x": 90 },
|
||||
"axis=x": { "model": "create:block/construct_relocating", "x": 90, "y": 90 }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,98 @@
|
|||
{
|
||||
"multipart": [
|
||||
{ "when": { "axis": "x" },
|
||||
"apply": { "model": "create:block/rotation_chassis_base", "x": 90, "y": 90 }
|
||||
},
|
||||
{ "when": { "axis": "y" },
|
||||
"apply": { "model": "create:block/rotation_chassis_base" }
|
||||
},
|
||||
{ "when": { "axis": "z" },
|
||||
"apply": { "model": "create:block/rotation_chassis_base", "x": 90 }
|
||||
},
|
||||
|
||||
|
||||
{ "when": { "axis": "x", "sticky_south": "false" },
|
||||
"apply": { "model": "create:block/rotation_chassis_side_x", "x": 180, "y": 0 }
|
||||
},
|
||||
{ "when": { "axis": "y", "sticky_south": "false" },
|
||||
"apply": { "model": "create:block/rotation_chassis_side_y" }
|
||||
},
|
||||
{ "when": { "axis": "z", "sticky_south": "false" },
|
||||
"apply": { "model": "create:block/rotation_chassis_side_x", "x": 180, "y": 90 }
|
||||
},
|
||||
|
||||
{ "when": { "axis": "x", "sticky_south": "true" },
|
||||
"apply": { "model": "create:block/rotation_chassis_side_x_sticky", "x": 180, "y": 0 }
|
||||
},
|
||||
{ "when": { "axis": "y", "sticky_south": "true" },
|
||||
"apply": { "model": "create:block/rotation_chassis_side_y_sticky" }
|
||||
},
|
||||
{ "when": { "axis": "z", "sticky_south": "true" },
|
||||
"apply": { "model": "create:block/rotation_chassis_side_x_sticky", "x": 180, "y": 90 }
|
||||
},
|
||||
|
||||
|
||||
{ "when": { "axis": "x", "sticky_north": "false" },
|
||||
"apply": { "model": "create:block/rotation_chassis_side_x", "x": 0, "y": 0 }
|
||||
},
|
||||
{ "when": { "axis": "y", "sticky_north": "false" },
|
||||
"apply": { "model": "create:block/rotation_chassis_side_y", "x": 0, "y": 180 }
|
||||
},
|
||||
{ "when": { "axis": "z", "sticky_north": "false" },
|
||||
"apply": { "model": "create:block/rotation_chassis_side_x", "x": 0, "y": 90 }
|
||||
},
|
||||
|
||||
{ "when": { "axis": "x", "sticky_north": "true" },
|
||||
"apply": { "model": "create:block/rotation_chassis_side_x_sticky", "x": 0, "y": 0 }
|
||||
},
|
||||
{ "when": { "axis": "y", "sticky_north": "true" },
|
||||
"apply": { "model": "create:block/rotation_chassis_side_y_sticky", "x": 0, "y": 180 }
|
||||
},
|
||||
{ "when": { "axis": "z", "sticky_north": "true" },
|
||||
"apply": { "model": "create:block/rotation_chassis_side_x_sticky", "x": 0, "y": 90 }
|
||||
},
|
||||
|
||||
|
||||
{ "when": { "axis": "x", "sticky_east": "false" },
|
||||
"apply": { "model": "create:block/rotation_chassis_side_x", "x": 270, "y": 0 }
|
||||
},
|
||||
{ "when": { "axis": "y", "sticky_east": "false" },
|
||||
"apply": { "model": "create:block/rotation_chassis_side_y", "x": 0, "y": 270 }
|
||||
},
|
||||
{ "when": { "axis": "z", "sticky_east": "false" },
|
||||
"apply": { "model": "create:block/rotation_chassis_side_z", "x": 0, "y": 0 }
|
||||
},
|
||||
|
||||
{ "when": { "axis": "x", "sticky_east": "true" },
|
||||
"apply": { "model": "create:block/rotation_chassis_side_x_sticky", "x": 270, "y": 0 }
|
||||
},
|
||||
{ "when": { "axis": "y", "sticky_east": "true" },
|
||||
"apply": { "model": "create:block/rotation_chassis_side_y_sticky", "x": 0, "y": 270 }
|
||||
},
|
||||
{ "when": { "axis": "z", "sticky_east": "true" },
|
||||
"apply": { "model": "create:block/rotation_chassis_side_z_sticky", "x": 0, "y": 0 }
|
||||
},
|
||||
|
||||
|
||||
{ "when": { "axis": "x", "sticky_west": "false" },
|
||||
"apply": { "model": "create:block/rotation_chassis_side_x", "x": 90, "y": 0 }
|
||||
},
|
||||
{ "when": { "axis": "y", "sticky_west": "false" },
|
||||
"apply": { "model": "create:block/rotation_chassis_side_y", "x": 0, "y": 90 }
|
||||
},
|
||||
{ "when": { "axis": "z", "sticky_west": "false" },
|
||||
"apply": { "model": "create:block/rotation_chassis_side_z", "x": 0, "y": 180 }
|
||||
},
|
||||
|
||||
{ "when": { "axis": "x", "sticky_west": "true" },
|
||||
"apply": { "model": "create:block/rotation_chassis_side_x_sticky", "x": 90, "y": 0 }
|
||||
},
|
||||
{ "when": { "axis": "y", "sticky_west": "true" },
|
||||
"apply": { "model": "create:block/rotation_chassis_side_y_sticky", "x": 0, "y": 90 }
|
||||
},
|
||||
{ "when": { "axis": "z", "sticky_west": "true" },
|
||||
"apply": { "model": "create:block/rotation_chassis_side_z_sticky", "x": 0, "y": 180 }
|
||||
}
|
||||
|
||||
]
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
{
|
||||
"forgemarker": 1,
|
||||
"defaults": {
|
||||
"model": "create:block/construct_sticky"
|
||||
},
|
||||
"variants": {
|
||||
"axis=y": { "model": "create:block/construct_sticky" },
|
||||
"axis=z": { "model": "create:block/construct_sticky", "x": 90 },
|
||||
"axis=x": { "model": "create:block/construct_sticky", "x": 90, "y": 90 }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"forge_marker": 1,
|
||||
"variants": {
|
||||
"axis=x,sticky_top=false,sticky_bottom=false": { "model": "create:block/translation_chassis", "x": 90, "y": 90 },
|
||||
"axis=x,sticky_top=true,sticky_bottom=false": { "model": "create:block/translation_chassis_top_sticky", "x": 90, "y": 90 },
|
||||
"axis=x,sticky_top=false,sticky_bottom=true": { "model": "create:block/translation_chassis_bottom_sticky", "x": 90, "y": 90 },
|
||||
"axis=x,sticky_top=true,sticky_bottom=true": { "model": "create:block/translation_chassis_both_sticky", "x": 90, "y": 90 },
|
||||
"axis=y,sticky_top=false,sticky_bottom=false": { "model": "create:block/translation_chassis" },
|
||||
"axis=y,sticky_top=true,sticky_bottom=false": { "model": "create:block/translation_chassis_top_sticky" },
|
||||
"axis=y,sticky_top=false,sticky_bottom=true": { "model": "create:block/translation_chassis_bottom_sticky" },
|
||||
"axis=y,sticky_top=true,sticky_bottom=true": { "model": "create:block/translation_chassis_both_sticky" },
|
||||
"axis=z,sticky_top=false,sticky_bottom=false": { "model": "create:block/translation_chassis", "x": 90, "y": 180 },
|
||||
"axis=z,sticky_top=true,sticky_bottom=false": { "model": "create:block/translation_chassis_top_sticky", "x": 90, "y": 180 },
|
||||
"axis=z,sticky_top=false,sticky_bottom=true": { "model": "create:block/translation_chassis_bottom_sticky", "x": 90, "y": 180 },
|
||||
"axis=z,sticky_top=true,sticky_bottom=true": { "model": "create:block/translation_chassis_both_sticky", "x": 90, "y": 180 }
|
||||
}
|
||||
}
|
|
@ -21,6 +21,10 @@
|
|||
"item.create.blazing_axe": "Blazing Axe",
|
||||
"item.create.blazing_sword": "Blazing Longsword",
|
||||
|
||||
"item.create.shadow_steel_pickaxe": "Shadow Steel Pickaxe",
|
||||
"item.create.shadow_steel_mattock": "Shadow Steel Garden Mattock",
|
||||
"item.create.shadow_steel_sword": "Shadow Steel Sword",
|
||||
|
||||
"item.create.rose_quartz_pickaxe": "Gilded Quartz Pickaxe",
|
||||
"item.create.rose_quartz_shovel": "Gilded Quartz Shovel",
|
||||
"item.create.rose_quartz_axe": "Gilded Quartz Axe",
|
||||
|
@ -47,9 +51,9 @@
|
|||
"block.create.mechanical_piston": "Mechanical Piston",
|
||||
"block.create.mechanical_piston_head": "Mechanical Piston Head",
|
||||
"block.create.piston_pole": "Piston Extension Pole",
|
||||
"block.create.construct": "Movement Chassis",
|
||||
"block.create.sticky_construct": "Sticky Chassis",
|
||||
"block.create.relocation_construct": "Relocation Chassis",
|
||||
"block.create.mechanical_bearing": "Mechanical Bearing",
|
||||
"block.create.translation_chassis": "Translation Chassis",
|
||||
"block.create.rotation_chassis": "Rotation Chassis",
|
||||
|
||||
"block.create.contact": "Redstone Contact",
|
||||
"block.create.redstone_bridge": "Redstone Bridge",
|
||||
|
|
|
@ -1,60 +0,0 @@
|
|||
{
|
||||
"__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)",
|
||||
"parent": "block/cube",
|
||||
"textures": {
|
||||
"particle": "create:block/construct_side",
|
||||
"0": "create:block/construct_side",
|
||||
"1": "block/stripped_spruce_log_top",
|
||||
"2": "block/stripped_spruce_log"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"name": "Bottom",
|
||||
"from": [ 0.0, 0.0, 0.0 ],
|
||||
"to": [ 16.0, 3.0, 16.0 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 3.0 ] },
|
||||
"east": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 3.0 ] },
|
||||
"south": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 3.0 ] },
|
||||
"west": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 3.0 ] },
|
||||
"up": { "texture": "#1", "uv": [ 0.0, 0.0, 16.0, 16.0 ] },
|
||||
"down": { "texture": "#2", "uv": [ 0.0, 0.0, 16.0, 16.0 ] }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Top",
|
||||
"from": [ 0.0, 13.0, 0.0 ],
|
||||
"to": [ 16.0, 16.0, 16.0 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 3.0 ] },
|
||||
"east": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 3.0 ] },
|
||||
"south": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 3.0 ] },
|
||||
"west": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 3.0 ] },
|
||||
"up": { "texture": "#2", "uv": [ 0.0, 0.0, 16.0, 16.0 ] },
|
||||
"down": { "texture": "#1", "uv": [ 0.0, 0.0, 16.0, 16.0 ] }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Core",
|
||||
"from": [ 2.0, 3.0, 2.0 ],
|
||||
"to": [ 14.0, 13.0, 14.0 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#inner", "uv": [ 2.0, 0.0, 14.0, 10.0 ] },
|
||||
"east": { "texture": "#inner", "uv": [ 2.0, 0.0, 14.0, 10.0 ] },
|
||||
"south": { "texture": "#inner", "uv": [ 2.0, 0.0, 14.0, 10.0 ] },
|
||||
"west": { "texture": "#inner", "uv": [ 2.0, 0.0, 14.0, 10.0 ] }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Coat",
|
||||
"from": [ 0.0, 3.0, 0.0 ],
|
||||
"to": [ 16.0, 13.0, 16.0 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#0", "uv": [ 0.0, 3.0, 16.0, 13.0 ], "cullface": "north" },
|
||||
"east": { "texture": "#0", "uv": [ 0.0, 3.0, 16.0, 13.0 ], "cullface": "east" },
|
||||
"south": { "texture": "#0", "uv": [ 0.0, 3.0, 16.0, 13.0 ], "cullface": "south" },
|
||||
"west": { "texture": "#0", "uv": [ 0.0, 3.0, 16.0, 13.0 ], "cullface": "west" }
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -1,6 +0,0 @@
|
|||
{
|
||||
"parent": "create:block/construct",
|
||||
"textures": {
|
||||
"inner": "block/cobblestone"
|
||||
}
|
||||
}
|
|
@ -1,6 +0,0 @@
|
|||
{
|
||||
"parent": "create:block/construct",
|
||||
"textures": {
|
||||
"inner": "block/purpur_pillar"
|
||||
}
|
||||
}
|
|
@ -1,6 +0,0 @@
|
|||
{
|
||||
"parent": "create:block/construct",
|
||||
"textures": {
|
||||
"inner": "block/slime_block"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,67 @@
|
|||
{
|
||||
"__comment": "Model generated using MrCrayfish's Model Creator (https://mrcrayfish.com/tools?id=mc)",
|
||||
"textures": {
|
||||
"particle": "create:block/bearing_side",
|
||||
"gearbox": "create:block/gearbox",
|
||||
"bearing_side": "create:block/bearing_side"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"name": "Side",
|
||||
"from": [ 0, 0, 0 ],
|
||||
"to": [ 2, 12, 16 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#bearing_side", "uv": [ 13, 4, 16, 16 ] },
|
||||
"east": { "texture": "#bearing_side", "uv": [ 0, 4, 16, 16 ] },
|
||||
"south": { "texture": "#bearing_side", "uv": [ 0, 4, 2, 16 ] },
|
||||
"west": { "texture": "#bearing_side", "uv": [ 0, 4, 16, 16 ] },
|
||||
"up": { "texture": "#gearbox", "uv": [ 0, 0, 2, 16 ] },
|
||||
"down": { "texture": "#gearbox", "uv": [ 0, 0, 2, 16 ] }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Side",
|
||||
"from": [ 14, 0, 0 ],
|
||||
"to": [ 16, 12, 16 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#bearing_side", "uv": [ 0, 4, 2, 16 ] },
|
||||
"east": { "texture": "#bearing_side", "uv": [ 0, 4, 16, 16 ] },
|
||||
"south": { "texture": "#bearing_side", "uv": [ 14, 4, 16, 16 ] },
|
||||
"west": { "texture": "#bearing_side", "uv": [ 0, 4, 16, 16 ] },
|
||||
"up": { "texture": "#gearbox", "uv": [ 14, 0, 16, 16 ] },
|
||||
"down": { "texture": "#gearbox", "uv": [ 14, 0, 16, 16 ] }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Side",
|
||||
"from": [ 2, 0, 0 ],
|
||||
"to": [ 14, 12, 2 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#bearing_side", "uv": [ 2, 4, 14, 16 ] },
|
||||
"south": { "texture": "#bearing_side", "uv": [ 2, 4, 14, 16 ] },
|
||||
"up": { "texture": "#gearbox", "uv": [ 2, 0, 14, 2 ] },
|
||||
"down": { "texture": "#gearbox", "uv": [ 2, 14, 14, 16 ] }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Side",
|
||||
"from": [ 2, 0, 14 ],
|
||||
"to": [ 14, 12, 16 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#bearing_side", "uv": [ 2, 4, 14, 16 ] },
|
||||
"south": { "texture": "#bearing_side", "uv": [ 2, 4, 14, 16 ] },
|
||||
"up": { "texture": "#gearbox", "uv": [ 2, 14, 14, 16 ] },
|
||||
"down": { "texture": "#gearbox", "uv": [ 2, 0, 14, 2 ] }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Core",
|
||||
"from": [ 2, 1, 2 ],
|
||||
"to": [ 14, 12, 14 ],
|
||||
"faces": {
|
||||
"up": { "texture": "#gearbox", "uv": [ 2, 2, 14, 14 ] },
|
||||
"down": { "texture": "#gearbox", "uv": [ 2, 2, 14, 14 ] }
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
"__comment": "Model generated using MrCrayfish's Model Creator (https://mrcrayfish.com/tools?id=mc)",
|
||||
"textures": {
|
||||
"particle": "create:block/bearing_side",
|
||||
"bearing_top": "create:block/bearing_top",
|
||||
"bearing_side": "create:block/bearing_side"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"name": "Top",
|
||||
"from": [ 0, 12, 0 ],
|
||||
"to": [ 16, 16, 16 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#bearing_side", "uv": [ 0, 0, 16, 4 ] },
|
||||
"east": { "texture": "#bearing_side", "uv": [ 0, 0, 16, 4 ] },
|
||||
"south": { "texture": "#bearing_side", "uv": [ 0, 0, 16, 4 ] },
|
||||
"west": { "texture": "#bearing_side", "uv": [ 0, 0, 16, 4 ] },
|
||||
"up": { "texture": "#bearing_top", "uv": [ 0, 0, 16, 16 ] },
|
||||
"down": { "texture": "#bearing_top", "uv": [ 0, 0, 16, 16 ] }
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"__comment": "Model generated using MrCrayfish's Model Creator (https://mrcrayfish.com/tools?id=mc)",
|
||||
"textures": {
|
||||
"particle": "create:block/rotation_chassis_side",
|
||||
"rotation_chassis_top": "create:block/rotation_chassis_top"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"name": "Cube",
|
||||
"from": [ 0, 0, 0 ],
|
||||
"to": [ 16, 16, 16 ],
|
||||
"faces": {
|
||||
"up": { "texture": "#rotation_chassis_top", "uv": [ 0, 0, 16, 16 ] },
|
||||
"down": { "texture": "#rotation_chassis_top", "uv": [ 0, 0, 16, 16 ] }
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"__comment": "Model generated using MrCrayfish's Model Creator (https://mrcrayfish.com/tools?id=mc)",
|
||||
"textures": {
|
||||
"rotation_chassis_side": "create:block/rotation_chassis_side"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"name": "Cube",
|
||||
"from": [ 0, 0, 0 ],
|
||||
"to": [ 16, 16, 16 ],
|
||||
"faces": {
|
||||
"up": { "texture": "#rotation_chassis_side", "uv": [ 0, 0, 16, 16 ], "rotation": 90 }
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "create:block/rotation_chassis_side_x",
|
||||
"textures": {
|
||||
"rotation_chassis_side": "create:block/rotation_chassis_side_sticky"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"__comment": "Model generated using MrCrayfish's Model Creator (https://mrcrayfish.com/tools?id=mc)",
|
||||
"textures": {
|
||||
"rotation_chassis_side": "create:block/rotation_chassis_side"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"name": "Cube",
|
||||
"from": [ 0, 0, 0 ],
|
||||
"to": [ 16, 16, 16 ],
|
||||
"faces": {
|
||||
"south": { "texture": "#rotation_chassis_side", "uv": [ 0, 0, 16, 16 ] }
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "create:block/rotation_chassis_side_y",
|
||||
"textures": {
|
||||
"rotation_chassis_side": "create:block/rotation_chassis_side_sticky"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"__comment": "Model generated using MrCrayfish's Model Creator (https://mrcrayfish.com/tools?id=mc)",
|
||||
"textures": {
|
||||
"rotation_chassis_side": "create:block/rotation_chassis_side"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"name": "Cube",
|
||||
"from": [ 0, 0, 0 ],
|
||||
"to": [ 16, 16, 16 ],
|
||||
"faces": {
|
||||
"east": { "texture": "#rotation_chassis_side", "uv": [ 0, 0, 16, 16 ], "rotation": 270 }
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "create:block/rotation_chassis_side_z",
|
||||
"textures": {
|
||||
"rotation_chassis_side": "create:block/rotation_chassis_side_sticky"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"parent": "block/cube_bottom_top",
|
||||
"textures": {
|
||||
"bottom": "create:block/translation_chassis_top",
|
||||
"top": "create:block/translation_chassis_top",
|
||||
"side": "create:block/translation_chassis_side"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"parent": "create:block/translation_chassis",
|
||||
"textures": {
|
||||
"bottom": "create:block/translation_chassis_top_sticky",
|
||||
"top": "create:block/translation_chassis_top_sticky"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "create:block/translation_chassis",
|
||||
"textures": {
|
||||
"bottom": "create:block/translation_chassis_top_sticky"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "create:block/translation_chassis",
|
||||
"textures": {
|
||||
"top": "create:block/translation_chassis_top_sticky"
|
||||
}
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"parent": "create:block/construct_normal"
|
||||
}
|
|
@ -0,0 +1,82 @@
|
|||
{
|
||||
"__comment": "Model generated using MrCrayfish's Model Creator (https://mrcrayfish.com/tools?id=mc)",
|
||||
"parent": "block/block",
|
||||
"textures": {
|
||||
"particle": "create:block/bearing_side",
|
||||
"bearing_top": "create:block/bearing_top",
|
||||
"gearbox": "create:block/gearbox",
|
||||
"bearing_side": "create:block/bearing_side"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"name": "Side",
|
||||
"from": [ 0, 0, 0 ],
|
||||
"to": [ 2, 12, 16 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#bearing_side", "uv": [ 13, 4, 16, 16 ] },
|
||||
"east": { "texture": "#bearing_side", "uv": [ 0, 4, 16, 16 ] },
|
||||
"south": { "texture": "#bearing_side", "uv": [ 0, 4, 2, 16 ] },
|
||||
"west": { "texture": "#bearing_side", "uv": [ 0, 4, 16, 16 ] },
|
||||
"up": { "texture": "#gearbox", "uv": [ 0, 0, 2, 16 ] },
|
||||
"down": { "texture": "#gearbox", "uv": [ 0, 0, 2, 16 ] }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Side",
|
||||
"from": [ 14, 0, 0 ],
|
||||
"to": [ 16, 12, 16 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#bearing_side", "uv": [ 0, 4, 2, 16 ] },
|
||||
"east": { "texture": "#bearing_side", "uv": [ 0, 4, 16, 16 ] },
|
||||
"south": { "texture": "#bearing_side", "uv": [ 14, 4, 16, 16 ] },
|
||||
"west": { "texture": "#bearing_side", "uv": [ 0, 4, 16, 16 ] },
|
||||
"up": { "texture": "#gearbox", "uv": [ 14, 0, 16, 16 ] },
|
||||
"down": { "texture": "#gearbox", "uv": [ 14, 0, 16, 16 ] }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Side",
|
||||
"from": [ 2, 0, 0 ],
|
||||
"to": [ 14, 12, 2 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#bearing_side", "uv": [ 2, 4, 14, 16 ] },
|
||||
"south": { "texture": "#bearing_side", "uv": [ 2, 4, 14, 16 ] },
|
||||
"up": { "texture": "#gearbox", "uv": [ 2, 0, 14, 2 ] },
|
||||
"down": { "texture": "#gearbox", "uv": [ 2, 14, 14, 16 ] }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Side",
|
||||
"from": [ 2, 0, 14 ],
|
||||
"to": [ 14, 12, 16 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#bearing_side", "uv": [ 2, 4, 14, 16 ] },
|
||||
"south": { "texture": "#bearing_side", "uv": [ 2, 4, 14, 16 ] },
|
||||
"up": { "texture": "#gearbox", "uv": [ 2, 14, 14, 16 ] },
|
||||
"down": { "texture": "#gearbox", "uv": [ 2, 0, 14, 2 ] }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Core",
|
||||
"from": [ 2, 1, 2 ],
|
||||
"to": [ 14, 12, 14 ],
|
||||
"faces": {
|
||||
"up": { "texture": "#gearbox", "uv": [ 2, 2, 14, 14 ] },
|
||||
"down": { "texture": "#gearbox", "uv": [ 2, 2, 14, 14 ] }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Top",
|
||||
"from": [ 0, 12, 0 ],
|
||||
"to": [ 16, 16, 16 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#bearing_side", "uv": [ 0, 0, 16, 4 ] },
|
||||
"east": { "texture": "#bearing_side", "uv": [ 0, 0, 16, 4 ] },
|
||||
"south": { "texture": "#bearing_side", "uv": [ 0, 0, 16, 4 ] },
|
||||
"west": { "texture": "#bearing_side", "uv": [ 0, 0, 16, 4 ] },
|
||||
"up": { "texture": "#bearing_top", "uv": [ 0, 0, 16, 16 ] },
|
||||
"down": { "texture": "#bearing_top", "uv": [ 0, 0, 16, 16 ] }
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"parent": "create:block/construct_relocating"
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"parent": "block/cube_bottom_top",
|
||||
"textures": {
|
||||
"bottom": "create:block/rotation_chassis_top",
|
||||
"top": "create:block/rotation_chassis_top",
|
||||
"side": "create:block/rotation_chassis_side"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "item/generated",
|
||||
"textures": {
|
||||
"layer0": "create:item/shadow_steel_mattock"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "item/generated",
|
||||
"textures": {
|
||||
"layer0": "create:item/shadow_steel_pickaxe"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "item/generated",
|
||||
"textures": {
|
||||
"layer0": "create:item/shadow_steel_sword"
|
||||
}
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"parent": "create:block/construct_sticky"
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"parent": "create:block/translation_chassis"
|
||||
}
|
BIN
src/main/resources/assets/create/textures/block/bearing_side.png
Normal file
After Width: | Height: | Size: 487 B |
BIN
src/main/resources/assets/create/textures/block/bearing_top.png
Normal file
After Width: | Height: | Size: 449 B |
Before Width: | Height: | Size: 545 B |
After Width: | Height: | Size: 511 B |
After Width: | Height: | Size: 565 B |
After Width: | Height: | Size: 536 B |
After Width: | Height: | Size: 470 B |
After Width: | Height: | Size: 648 B |
After Width: | Height: | Size: 772 B |
After Width: | Height: | Size: 418 B |
After Width: | Height: | Size: 395 B |
After Width: | Height: | Size: 417 B |