diff --git a/src/main/java/com/simibubi/create/AllBlocks.java b/src/main/java/com/simibubi/create/AllBlocks.java index d363e89e4..06bd7e32a 100644 --- a/src/main/java/com/simibubi/create/AllBlocks.java +++ b/src/main/java/com/simibubi/create/AllBlocks.java @@ -1,5 +1,6 @@ package com.simibubi.create; +import com.simibubi.create.foundation.block.IBlockWithColorHandler; import com.simibubi.create.foundation.block.IWithoutBlockItem; import com.simibubi.create.foundation.block.ProperStairsBlock; import com.simibubi.create.foundation.block.RenderUtilityAxisBlock; @@ -12,6 +13,7 @@ import com.simibubi.create.modules.contraptions.receivers.CrushingWheelControlle 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.MechanicalPressBlock; import com.simibubi.create.modules.contraptions.receivers.TurntableBlock; import com.simibubi.create.modules.contraptions.receivers.constructs.MechanicalBearingBlock; import com.simibubi.create.modules.contraptions.receivers.constructs.MechanicalPistonBlock; @@ -29,15 +31,17 @@ import com.simibubi.create.modules.contraptions.relays.GearshiftBlock; import com.simibubi.create.modules.contraptions.relays.ShaftBlock; import com.simibubi.create.modules.contraptions.relays.ShaftHalfBlock; import com.simibubi.create.modules.contraptions.relays.belt.BeltBlock; +import com.simibubi.create.modules.contraptions.relays.belt.BeltSupportBlock; import com.simibubi.create.modules.gardens.CocoaLogBlock; import com.simibubi.create.modules.logistics.block.BeltFunnelBlock; import com.simibubi.create.modules.logistics.block.EntityDetectorBlock; import com.simibubi.create.modules.logistics.block.ExtractorBlock; import com.simibubi.create.modules.logistics.block.FlexcrateBlock; import com.simibubi.create.modules.logistics.block.LinkedExtractorBlock; -import com.simibubi.create.modules.logistics.block.PulseRepeaterBlock; import com.simibubi.create.modules.logistics.block.RedstoneBridgeBlock; import com.simibubi.create.modules.logistics.block.StockswitchBlock; +import com.simibubi.create.modules.logistics.block.diodes.FlexpeaterBlock; +import com.simibubi.create.modules.logistics.block.diodes.PulseRepeaterBlock; import com.simibubi.create.modules.schematics.block.CreativeCrateBlock; import com.simibubi.create.modules.schematics.block.SchematicTableBlock; import com.simibubi.create.modules.schematics.block.SchematicannonBlock; @@ -54,8 +58,12 @@ import net.minecraft.block.FenceGateBlock; import net.minecraft.block.RotatedPillarBlock; import net.minecraft.block.SlabBlock; import net.minecraft.block.WallBlock; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.color.BlockColors; import net.minecraft.item.BlockItem; import net.minecraft.item.Item; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.registries.IForgeRegistry; public enum AllBlocks { @@ -77,6 +85,7 @@ public enum AllBlocks { GEARSHIFT(new GearshiftBlock()), GEARBOX(new GearboxBlock()), BELT(new BeltBlock()), + BELT_SUPPORT(new BeltSupportBlock()), BELT_PULLEY(new RenderUtilityAxisBlock()), BELT_ANIMATION(new RenderUtilityBlock()), MOTOR(new MotorBlock()), @@ -87,6 +96,8 @@ public enum AllBlocks { SHAFT_HALF(new ShaftHalfBlock()), CRUSHING_WHEEL(new CrushingWheelBlock()), CRUSHING_WHEEL_CONTROLLER(new CrushingWheelControllerBlock()), + MECHANICAL_PRESS(new MechanicalPressBlock()), + MECHANICAL_PRESS_HEAD(new MechanicalPressBlock.Head()), MECHANICAL_PISTON(new MechanicalPistonBlock(false)), STICKY_MECHANICAL_PISTON(new MechanicalPistonBlock(true)), MECHANICAL_PISTON_HEAD(new MechanicalPistonHeadBlock()), @@ -108,6 +119,8 @@ public enum AllBlocks { BELT_FUNNEL(new BeltFunnelBlock()), ENTITY_DETECTOR(new EntityDetectorBlock()), PULSE_REPEATER(new PulseRepeaterBlock()), + FLEXPEATER(new FlexpeaterBlock()), + FLEXPEATER_INDICATOR(new RenderUtilityBlock()), __CURIOSITIES__(), SYMMETRY_PLANE(new PlaneSymmetryBlock()), @@ -240,4 +253,14 @@ public enum AllBlocks { block.getRegistryName().getPath() + "_" + feature.name().toLowerCase()); } + @OnlyIn(Dist.CLIENT) + public static void registerColorHandlers() { + BlockColors blockColors = Minecraft.getInstance().getBlockColors(); + for (AllBlocks block : values()) { + if (block.block instanceof IBlockWithColorHandler) { + blockColors.register(((IBlockWithColorHandler) block.block).getColorHandler(), block.block); + } + } + } + } diff --git a/src/main/java/com/simibubi/create/AllItems.java b/src/main/java/com/simibubi/create/AllItems.java index a25b26aef..6df8f4638 100644 --- a/src/main/java/com/simibubi/create/AllItems.java +++ b/src/main/java/com/simibubi/create/AllItems.java @@ -41,14 +41,15 @@ public enum AllItems { new BuilderGunItem(new Properties().setTEISR(() -> () -> renderUsing(AllItemRenderers.BUILDER_GUN)))), __MATERIALS__(), - ANDESITE_ALLOY_CUBE(new Item(standardItemProperties())), - BLAZE_BRASS_CUBE(new Item(standardItemProperties())), - CHORUS_CHROME_CUBE(new Item(standardItemProperties().rarity(Rarity.UNCOMMON))), - SHADOW_STEEL_CUBE(new Item(standardItemProperties().rarity(Rarity.UNCOMMON))), - ROSE_QUARTZ(new Item(standardItemProperties())), - REFINED_ROSE_QUARTZ(new Item(standardItemProperties())), + IRON_SHEET(ingredient()), + ANDESITE_ALLOY_CUBE(ingredient()), + BLAZE_BRASS_CUBE(ingredient()), + CHORUS_CHROME_CUBE(ingredient(Rarity.UNCOMMON)), + SHADOW_STEEL_CUBE(ingredient(Rarity.UNCOMMON)), + ROSE_QUARTZ(ingredient()), + REFINED_ROSE_QUARTZ(ingredient()), CHROMATIC_COMPOUND_CUBE(new ChromaticCompoundCubeItem(standardItemProperties().rarity(Rarity.UNCOMMON))), - REFINED_RADIANCE_CUBE(new Item(standardItemProperties().rarity(Rarity.RARE))), + REFINED_RADIANCE_CUBE(ingredient(Rarity.RARE)), // BLAZING_PICKAXE(new BlazingToolItem(1, -2.8F, standardProperties(), PICKAXE)), // BLAZING_SHOVEL(new BlazingToolItem(1.5F, -3.0F, standardProperties(), SHOVEL)), @@ -71,9 +72,12 @@ public enum AllItems { EMPTY_BLUEPRINT(new Item(standardItemProperties().maxStackSize(1))), BLUEPRINT_AND_QUILL(new SchematicAndQuillItem(standardItemProperties().maxStackSize(1))), BLUEPRINT(new SchematicItem(standardItemProperties())), - + __CONTRAPTIONS__(), BELT_CONNECTOR(new BeltItem(standardItemProperties())), + FLOUR(ingredient()), + DOUGH(ingredient()), + PROPELLER(ingredient()), ; @@ -105,6 +109,14 @@ public enum AllItems { return new Properties().group(Create.creativeTab); } + private static Item ingredient() { + return ingredient(Rarity.COMMON); + } + + private static Item ingredient(Rarity rarity) { + return new Item(standardItemProperties().rarity(rarity)); + } + public static void registerItems(IForgeRegistry iForgeRegistry) { for (AllItems item : values()) { if (item.get() == null) diff --git a/src/main/java/com/simibubi/create/AllPackets.java b/src/main/java/com/simibubi/create/AllPackets.java index 9b10e1727..d6f1dccfa 100644 --- a/src/main/java/com/simibubi/create/AllPackets.java +++ b/src/main/java/com/simibubi/create/AllPackets.java @@ -9,6 +9,7 @@ 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.block.diodes.ConfigureFlexpeaterPacket; import com.simibubi.create.modules.logistics.packet.ConfigureFlexcratePacket; import com.simibubi.create.modules.logistics.packet.ConfigureStockswitchPacket; import com.simibubi.create.modules.schematics.packet.ConfigureSchematicannonPacket; @@ -31,6 +32,7 @@ public enum AllPackets { CONFIGURE_STOCKSWITCH(ConfigureStockswitchPacket.class, ConfigureStockswitchPacket::new), CONFIGURE_CHASSIS(ConfigureChassisPacket.class, ConfigureChassisPacket::new), CONFIGURE_MOTOR(ConfigureMotorPacket.class, ConfigureMotorPacket::new), + CONFIGURE_FLEXPEATER(ConfigureFlexpeaterPacket.class, ConfigureFlexpeaterPacket::new), PLACE_SCHEMATIC(SchematicPlacePacket.class, SchematicPlacePacket::new), UPLOAD_SCHEMATIC(SchematicUploadPacket.class, SchematicUploadPacket::new), diff --git a/src/main/java/com/simibubi/create/AllRecipes.java b/src/main/java/com/simibubi/create/AllRecipes.java index c5545e4e2..16cb3af25 100644 --- a/src/main/java/com/simibubi/create/AllRecipes.java +++ b/src/main/java/com/simibubi/create/AllRecipes.java @@ -4,6 +4,7 @@ import java.util.function.Supplier; import com.simibubi.create.modules.contraptions.base.ProcessingRecipeSerializer; import com.simibubi.create.modules.contraptions.receivers.CrushingRecipe; +import com.simibubi.create.modules.contraptions.receivers.PressingRecipe; import com.simibubi.create.modules.contraptions.receivers.SplashingRecipe; import com.simibubi.create.modules.curiosities.placementHandgun.BuilderGunUpgradeRecipe; @@ -26,12 +27,17 @@ public enum AllRecipes { SPLASHING(() -> { return new ProcessingRecipeSerializer<>(SplashingRecipe::new); }, Types.SPLASHING), + + PRESSING(() -> { + return new ProcessingRecipeSerializer<>(PressingRecipe::new); + }, Types.PRESSING), ; public static class Types { public static IRecipeType CRUSHING = register("crushing"); public static IRecipeType SPLASHING = register("splashing"); + public static IRecipeType PRESSING = register("pressing"); static > IRecipeType register(final String key) { return Registry.register(Registry.RECIPE_TYPE, new ResourceLocation(key), new IRecipeType() { diff --git a/src/main/java/com/simibubi/create/AllTileEntities.java b/src/main/java/com/simibubi/create/AllTileEntities.java index 84f1828b3..ebe559444 100644 --- a/src/main/java/com/simibubi/create/AllTileEntities.java +++ b/src/main/java/com/simibubi/create/AllTileEntities.java @@ -11,6 +11,8 @@ import com.simibubi.create.modules.contraptions.receivers.CrushingWheelTileEntit 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.MechanicalPressTileEntity; +import com.simibubi.create.modules.contraptions.receivers.MechanicalPressTileEntityRenderer; 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; @@ -38,6 +40,8 @@ import com.simibubi.create.modules.logistics.block.LinkedExtractorTileEntityRend import com.simibubi.create.modules.logistics.block.LinkedTileEntityRenderer; import com.simibubi.create.modules.logistics.block.RedstoneBridgeTileEntity; import com.simibubi.create.modules.logistics.block.StockswitchTileEntity; +import com.simibubi.create.modules.logistics.block.diodes.FlexpeaterTileEntity; +import com.simibubi.create.modules.logistics.block.diodes.FlexpeaterTileEntityRenderer; import com.simibubi.create.modules.schematics.block.SchematicTableTileEntity; import com.simibubi.create.modules.schematics.block.SchematicannonRenderer; import com.simibubi.create.modules.schematics.block.SchematicannonTileEntity; @@ -79,6 +83,7 @@ public enum AllTileEntities { CRUSHING_WHEEL(CrushingWheelTileEntity::new, AllBlocks.CRUSHING_WHEEL), CRUSHING_WHEEL_CONTROLLER(CrushingWheelControllerTileEntity::new, AllBlocks.CRUSHING_WHEEL_CONTROLLER), WATER_WHEEL(WaterWheelTileEntity::new, AllBlocks.WATER_WHEEL), + MECHANICAL_PRESS(MechanicalPressTileEntity::new, AllBlocks.MECHANICAL_PRESS), // Logistics REDSTONE_BRIDGE(RedstoneBridgeTileEntity::new, AllBlocks.REDSTONE_BRIDGE), @@ -88,6 +93,7 @@ public enum AllTileEntities { LINKED_EXTRACTOR(LinkedExtractorTileEntity::new, AllBlocks.LINKED_EXTRACTOR), BELT_FUNNEL(BeltFunnelTileEntity::new, AllBlocks.BELT_FUNNEL), ENTITY_DETECTOR(EntityDetectorTileEntity::new, AllBlocks.ENTITY_DETECTOR), + FLEXPEATER(FlexpeaterTileEntity::new, AllBlocks.FLEXPEATER), ; @@ -136,6 +142,8 @@ public enum AllTileEntities { bind(LinkedExtractorTileEntity.class, new LinkedExtractorTileEntityRenderer()); bind(ExtractorTileEntity.class, new ExtractorTileEntityRenderer()); bind(EntityDetectorTileEntity.class, new EntityDetectorTileEntityRenderer()); + bind(MechanicalPressTileEntity.class, new MechanicalPressTileEntityRenderer()); + bind(FlexpeaterTileEntity.class, new FlexpeaterTileEntityRenderer()); } @OnlyIn(Dist.CLIENT) diff --git a/src/main/java/com/simibubi/create/CreateClient.java b/src/main/java/com/simibubi/create/CreateClient.java index db1de6bb6..5397e445b 100644 --- a/src/main/java/com/simibubi/create/CreateClient.java +++ b/src/main/java/com/simibubi/create/CreateClient.java @@ -35,6 +35,7 @@ public class CreateClient { AllContainers.registerScreenFactories(); AllTileEntities.registerRenderers(); AllItems.registerColorHandlers(); + AllBlocks.registerColorHandlers(); } @SubscribeEvent diff --git a/src/main/java/com/simibubi/create/foundation/block/IBlockWithColorHandler.java b/src/main/java/com/simibubi/create/foundation/block/IBlockWithColorHandler.java new file mode 100644 index 000000000..bf44b1bf5 --- /dev/null +++ b/src/main/java/com/simibubi/create/foundation/block/IBlockWithColorHandler.java @@ -0,0 +1,9 @@ +package com.simibubi.create.foundation.block; + +import net.minecraft.client.renderer.color.IBlockColor; + +public interface IBlockWithColorHandler { + + public IBlockColor getColorHandler(); + +} diff --git a/src/main/java/com/simibubi/create/foundation/block/IBlockWithScrollableValue.java b/src/main/java/com/simibubi/create/foundation/block/IBlockWithScrollableValue.java index e5c4bcb43..f3fb4c8f9 100644 --- a/src/main/java/com/simibubi/create/foundation/block/IBlockWithScrollableValue.java +++ b/src/main/java/com/simibubi/create/foundation/block/IBlockWithScrollableValue.java @@ -35,7 +35,7 @@ public interface IBlockWithScrollableValue { public void onScroll(BlockState state, IWorld world, BlockPos pos, double delta); - public String getValueName(); + public String getValueName(BlockState state, IWorld world, BlockPos pos); public Vec3d getValueBoxPosition(BlockState state, IWorld world, BlockPos pos); @@ -125,7 +125,7 @@ public interface IBlockWithScrollableValue { GlStateManager.translated(bb.getZSize() + 1/32f, -1/16f, 0); GlStateManager.scaled(textScale, -textScale, textScale); - String text = block.getValueName(); + String text = block.getValueName(state, world, blockPos); mc.fontRenderer.drawString(text, 0, 0, 0x88FFBB); GlStateManager.translated(0, 0, -1 / 4f); mc.fontRenderer.drawString(text, 1, 1, 0x224433); diff --git a/src/main/java/com/simibubi/create/modules/contraptions/base/HorizontalKineticBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/base/HorizontalKineticBlock.java index ec7a69621..2fbc3a639 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/base/HorizontalKineticBlock.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/base/HorizontalKineticBlock.java @@ -13,11 +13,11 @@ import net.minecraft.util.Rotation; public abstract class HorizontalKineticBlock extends KineticBlock { public static final IProperty HORIZONTAL_FACING = BlockStateProperties.HORIZONTAL_FACING; - + public HorizontalKineticBlock(Properties properties) { super(properties); } - + @Override protected void fillStateContainer(Builder builder) { builder.add(HORIZONTAL_FACING); @@ -29,6 +29,26 @@ public abstract class HorizontalKineticBlock extends KineticBlock { return this.getDefaultState().with(HORIZONTAL_FACING, context.getPlacementHorizontalFacing().getOpposite()); } + public Direction getPreferredHorizontalFacing(BlockItemUseContext context) { + Direction prefferedSide = null; + for (Direction side : Direction.values()) { + if (side.getAxis().isVertical()) + continue; + BlockState blockState = context.getWorld().getBlockState(context.getPos().offset(side)); + if (blockState.getBlock() instanceof IRotate) { + if (((IRotate) blockState.getBlock()).hasShaftTowards(context.getWorld(), context.getPos().offset(side), + blockState, side.getOpposite())) + if (prefferedSide != null && prefferedSide.getAxis() != side.getAxis()) { + prefferedSide = null; + break; + } else { + prefferedSide = side; + } + } + } + return prefferedSide; + } + @Override public BlockState rotate(BlockState state, Rotation rot) { return state.with(HORIZONTAL_FACING, rot.rotate(state.get(HORIZONTAL_FACING))); diff --git a/src/main/java/com/simibubi/create/modules/contraptions/generators/MotorBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/generators/MotorBlock.java index 268545e23..b8a37aaef 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/generators/MotorBlock.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/generators/MotorBlock.java @@ -80,7 +80,7 @@ public class MotorBlock extends HorizontalKineticBlock } @Override - public String getValueName() { + public String getValueName(BlockState state, IWorld world, BlockPos pos) { return "Speed"; } diff --git a/src/main/java/com/simibubi/create/modules/contraptions/receivers/MechanicalPressBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/receivers/MechanicalPressBlock.java new file mode 100644 index 000000000..420ee4865 --- /dev/null +++ b/src/main/java/com/simibubi/create/modules/contraptions/receivers/MechanicalPressBlock.java @@ -0,0 +1,171 @@ +package com.simibubi.create.modules.contraptions.receivers; + +import java.util.Arrays; +import java.util.List; +import java.util.Optional; + +import com.simibubi.create.AllBlocks; +import com.simibubi.create.foundation.block.IRenderUtilityBlock; +import com.simibubi.create.foundation.block.IWithTileEntity; +import com.simibubi.create.foundation.utility.ItemDescription; +import com.simibubi.create.foundation.utility.ItemDescription.Palette; +import com.simibubi.create.foundation.utility.VecHelper; +import com.simibubi.create.modules.contraptions.base.HorizontalKineticBlock; +import com.simibubi.create.modules.contraptions.relays.belt.AllBeltAttachments.BeltAttachmentState; +import com.simibubi.create.modules.contraptions.relays.belt.AllBeltAttachments.IBeltAttachment; +import com.simibubi.create.modules.contraptions.relays.belt.BeltBlock; +import com.simibubi.create.modules.contraptions.relays.belt.BeltBlock.Slope; +import com.simibubi.create.modules.contraptions.relays.belt.BeltTileEntity; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.block.Blocks; +import net.minecraft.block.HorizontalBlock; +import net.minecraft.entity.Entity; +import net.minecraft.item.BlockItemUseContext; +import net.minecraft.state.StateContainer.Builder; +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.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 MechanicalPressBlock extends HorizontalKineticBlock + implements IWithTileEntity, IBeltAttachment { + + public static VoxelShape SHAPE = makeCuboidShape(0, 2, 0, 16, 16, 16); + + public MechanicalPressBlock() { + super(Properties.from(Blocks.PISTON)); + } + + @Override + public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) { + return SHAPE; + } + + @Override + public ItemDescription getDescription() { + Palette color = Palette.Red; + return new ItemDescription(color).withSummary("Applies pressure to items below it.").createTabs(); + } + + @Override + public void neighborChanged(BlockState state, World worldIn, BlockPos pos, Block blockIn, BlockPos fromPos, + boolean isMoving) { + if (worldIn.isRemote) + return; + MechanicalPressTileEntity te = (MechanicalPressTileEntity) worldIn.getTileEntity(pos); + if (te == null) + return; + + if (worldIn.isBlockPowered(pos)) { + if (!te.finished && !te.running) + te.start(false); + } else { + te.finished = false; + } + + } + + @Override + public TileEntity createTileEntity(BlockState state, IBlockReader world) { + return new MechanicalPressTileEntity(); + } + + @Override + public BlockState getStateForPlacement(BlockItemUseContext context) { + Direction prefferedSide = getPreferredHorizontalFacing(context); + if (prefferedSide != null) + return getDefaultState().with(HORIZONTAL_FACING, prefferedSide); + return super.getStateForPlacement(context); + } + + @Override + public Axis getRotationAxis(BlockState state) { + return state.get(HORIZONTAL_FACING).getAxis(); + } + + @Override + public boolean hasShaftTowards(World world, BlockPos pos, BlockState state, Direction face) { + return face.getAxis() == state.get(HORIZONTAL_FACING).getAxis(); + } + + @Override + protected boolean hasStaticPart() { + return true; + } + + public static class Head extends HorizontalBlock implements IRenderUtilityBlock { + + public Head() { + super(Properties.from(Blocks.AIR)); + } + + @Override + protected void fillStateContainer(Builder builder) { + builder.add(HORIZONTAL_FACING); + super.fillStateContainer(builder); + } + } + + @Override + public List getPotentialAttachmentLocations(BeltTileEntity te) { + return Arrays.asList(te.getPos().up(2)); + } + + @Override + public Optional getValidBeltPositionFor(IWorld world, BlockPos pos, BlockState state) { + BlockState blockState = world.getBlockState(pos.down(2)); + if (!AllBlocks.BELT.typeOf(blockState) || blockState.get(BeltBlock.SLOPE) != Slope.HORIZONTAL) + return Optional.empty(); + return Optional.of(pos.down(2)); + } + + @Override + public boolean handleEntity(BeltTileEntity te, Entity entity, BeltAttachmentState state) { + MechanicalPressTileEntity pressTe = (MechanicalPressTileEntity) te.getWorld() + .getTileEntity(state.attachmentPos); + + // Not powered + if (pressTe == null || pressTe.getSpeed() == 0) + return false; + + // Running + if (pressTe.running) { + double distanceTo = entity.getPositionVec().distanceTo(VecHelper.getCenterOf(te.getPos())); + if (distanceTo < .32f) + return true; + if (distanceTo < .4f) { + entity.setPosition(te.getPos().getX() + .5f, entity.posY, te.getPos().getZ() + .5f); + return true; + } + return false; + } + + // Start process + if (state.processingEntity != entity) { + state.processingEntity = entity; + state.processingDuration = 1; + pressTe.start(true); + return false; + } + + // Already processed + if (state.processingDuration == -1) + return false; + + // Just Finished + if (pressTe.finished) { + state.processingDuration = -1; + return false; + } + + return false; + } + +} diff --git a/src/main/java/com/simibubi/create/modules/contraptions/receivers/MechanicalPressTileEntity.java b/src/main/java/com/simibubi/create/modules/contraptions/receivers/MechanicalPressTileEntity.java new file mode 100644 index 000000000..0d368ff76 --- /dev/null +++ b/src/main/java/com/simibubi/create/modules/contraptions/receivers/MechanicalPressTileEntity.java @@ -0,0 +1,110 @@ +package com.simibubi.create.modules.contraptions.receivers; + +import java.util.Optional; + +import com.simibubi.create.AllRecipes; +import com.simibubi.create.AllTileEntities; +import com.simibubi.create.modules.contraptions.base.KineticTileEntity; +import com.simibubi.create.modules.logistics.InWorldProcessing; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.ItemEntity; +import net.minecraft.nbt.CompoundNBT; +import net.minecraft.tileentity.ITickableTileEntity; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.MathHelper; +import net.minecraftforge.items.ItemStackHandler; +import net.minecraftforge.items.wrapper.RecipeWrapper; + +public class MechanicalPressTileEntity extends KineticTileEntity implements ITickableTileEntity { + + public static class PressingInv extends RecipeWrapper { + public PressingInv() { + super(new ItemStackHandler(1)); + } + } + + private static PressingInv pressingInv = new PressingInv(); + public int runningTicks; + public boolean running; + public boolean beltMode; + public boolean finished; + + public MechanicalPressTileEntity() { + super(AllTileEntities.MECHANICAL_PRESS.type); + } + + @Override + public void read(CompoundNBT compound) { + running = compound.getBoolean("Running"); + beltMode = compound.getBoolean("OnBelt"); + finished = compound.getBoolean("Finished"); + runningTicks = compound.getInt("Ticks"); + super.read(compound); + } + + @Override + public CompoundNBT write(CompoundNBT compound) { + compound.putBoolean("Running", running); + compound.putBoolean("OnBelt", beltMode); + compound.putBoolean("Finished", finished); + compound.putInt("Ticks", runningTicks); + return super.write(compound); + } + + @Override + public AxisAlignedBB getRenderBoundingBox() { + return new AxisAlignedBB(pos).expand(0, -1.5, 0); + } + + public float getRenderedHeadOffset(float partialTicks) { + if (running) { + if (runningTicks < 50) { + return MathHelper.clamp((runningTicks - 1 + partialTicks) / 20f, 0, beltMode ? 1 + 3 / 16f : 1); + } + if (runningTicks >= 50) { + return MathHelper.clamp(((100 - runningTicks) + 1 - partialTicks) / 20f, 0, beltMode ? 1 + 3 / 16f : 1); + } + } + return 0; + } + + public void start(boolean onBelt) { + beltMode = onBelt; + running = true; + runningTicks = 0; + sendData(); + } + + @Override + public void tick() { + if (!running) + return; + + if (!world.isRemote && runningTicks > 100) { + + AxisAlignedBB bb = new AxisAlignedBB(pos.down(beltMode ? 2 : 1)); + for (Entity entity : world.getEntitiesWithinAABBExcludingEntity(null, bb)) { + if (!(entity instanceof ItemEntity)) + continue; + + ItemEntity itemEntity = (ItemEntity) entity; + pressingInv.setInventorySlotContents(0, itemEntity.getItem()); + Optional recipe = world.getRecipeManager().getRecipe(AllRecipes.Types.PRESSING, + pressingInv, world); + if (recipe.isPresent()) + InWorldProcessing.applyRecipeOn(itemEntity, recipe.get()); + } + + finished = true; + if (!beltMode) + finished = world.isBlockPowered(pos); + running = false; + sendData(); + return; + } + + runningTicks++; + } + +} diff --git a/src/main/java/com/simibubi/create/modules/contraptions/receivers/MechanicalPressTileEntityRenderer.java b/src/main/java/com/simibubi/create/modules/contraptions/receivers/MechanicalPressTileEntityRenderer.java new file mode 100644 index 000000000..2104fd28d --- /dev/null +++ b/src/main/java/com/simibubi/create/modules/contraptions/receivers/MechanicalPressTileEntityRenderer.java @@ -0,0 +1,63 @@ +package com.simibubi.create.modules.contraptions.receivers; + +import java.nio.ByteBuffer; + +import com.simibubi.create.AllBlocks; +import com.simibubi.create.foundation.utility.BufferManipulator; +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.renderer.BufferBuilder; +import net.minecraft.state.properties.BlockStateProperties; +import net.minecraft.util.math.BlockPos; + +public class MechanicalPressTileEntityRenderer extends KineticTileEntityRenderer { + + protected class HeadTranslator extends BufferManipulator { + + public HeadTranslator(ByteBuffer original) { + super(original); + } + + public ByteBuffer getTransformed(float xIn, float yIn, float zIn, float pushDistance, int packedLightCoords) { + original.rewind(); + mutable.rewind(); + + for (int vertex = 0; vertex < vertexCount(original); vertex++) { + putPos(mutable, vertex, getX(original, vertex) + xIn, getY(original, vertex) + yIn - pushDistance, + getZ(original, vertex) + zIn); + putLight(mutable, vertex, packedLightCoords); + } + + return mutable; + } + } + + @Override + public void renderTileEntityFast(KineticTileEntity te, double x, double y, double z, float partialTicks, + int destroyStage, BufferBuilder buffer) { + super.renderTileEntityFast(te, x, y, z, partialTicks, destroyStage, buffer); + + final BlockState state = getRenderedHeadBlockState(te); + cacheIfMissing(state, HeadTranslator::new); + + final BlockPos pos = te.getPos(); + + int packedLightmapCoords = state.getPackedLightmapCoords(getWorld(), pos); + buffer.putBulkData(((HeadTranslator) cachedBuffers.get(state)).getTransformed((float) x, (float) y, (float) z, + ((MechanicalPressTileEntity) te).getRenderedHeadOffset(partialTicks), packedLightmapCoords)); + } + + @Override + protected BlockState getRenderedBlockState(KineticTileEntity te) { + return AllBlocks.SHAFT.get().getDefaultState().with(BlockStateProperties.AXIS, + te.getBlockState().get(BlockStateProperties.HORIZONTAL_FACING).getAxis()); + } + + protected BlockState getRenderedHeadBlockState(KineticTileEntity te) { + return AllBlocks.MECHANICAL_PRESS_HEAD.get().getDefaultState().with(BlockStateProperties.HORIZONTAL_FACING, + te.getBlockState().get(BlockStateProperties.HORIZONTAL_FACING)); + } + +} diff --git a/src/main/java/com/simibubi/create/modules/contraptions/receivers/PressingRecipe.java b/src/main/java/com/simibubi/create/modules/contraptions/receivers/PressingRecipe.java new file mode 100644 index 000000000..0b973f18a --- /dev/null +++ b/src/main/java/com/simibubi/create/modules/contraptions/receivers/PressingRecipe.java @@ -0,0 +1,28 @@ +package com.simibubi.create.modules.contraptions.receivers; + +import java.util.List; + +import com.simibubi.create.AllRecipes; +import com.simibubi.create.modules.contraptions.base.ProcessingRecipe; +import com.simibubi.create.modules.contraptions.base.StochasticOutput; +import com.simibubi.create.modules.contraptions.receivers.MechanicalPressTileEntity.PressingInv; + +import net.minecraft.item.crafting.Ingredient; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; + +public class PressingRecipe extends ProcessingRecipe { + + public PressingRecipe(ResourceLocation id, String group, List ingredients, + List results, int processingDuration) { + super(AllRecipes.PRESSING, id, group, ingredients, results, processingDuration); + } + + @Override + public boolean matches(PressingInv inv, World worldIn) { + if (inv.isEmpty()) + return false; + return ingredients.get(0).test(inv.getStackInSlot(0)); + } + +} diff --git a/src/main/java/com/simibubi/create/modules/contraptions/receivers/constructs/AbstractChassisBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/receivers/constructs/AbstractChassisBlock.java index 9d445cd0b..35af0d582 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/receivers/constructs/AbstractChassisBlock.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/receivers/constructs/AbstractChassisBlock.java @@ -74,7 +74,7 @@ public abstract class AbstractChassisBlock extends RotatedPillarBlock } @Override - public String getValueName() { + public String getValueName(BlockState state, IWorld world, BlockPos pos) { return "Range"; } diff --git a/src/main/java/com/simibubi/create/modules/contraptions/receivers/constructs/RotationChassisBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/receivers/constructs/RotationChassisBlock.java index 83754074a..52be5d370 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/receivers/constructs/RotationChassisBlock.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/receivers/constructs/RotationChassisBlock.java @@ -7,6 +7,8 @@ import net.minecraft.state.BooleanProperty; import net.minecraft.state.StateContainer.Builder; import net.minecraft.util.Direction; import net.minecraft.util.Direction.Axis; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IWorld; public class RotationChassisBlock extends AbstractChassisBlock { @@ -28,7 +30,7 @@ public class RotationChassisBlock extends AbstractChassisBlock { } @Override - public String getValueName() { + public String getValueName(BlockState state, IWorld world, BlockPos pos) { return "Radius"; } diff --git a/src/main/java/com/simibubi/create/modules/contraptions/relays/belt/AllBeltAttachments.java b/src/main/java/com/simibubi/create/modules/contraptions/relays/belt/AllBeltAttachments.java index 3ff066bfe..cb9336693 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/relays/belt/AllBeltAttachments.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/relays/belt/AllBeltAttachments.java @@ -21,6 +21,7 @@ public enum AllBeltAttachments { BELT_FUNNEL(AllBlocks.BELT_FUNNEL), BELT_OBSERVER(AllBlocks.ENTITY_DETECTOR), + MECHANICAL_PRESS(AllBlocks.MECHANICAL_PRESS), ; diff --git a/src/main/java/com/simibubi/create/modules/contraptions/relays/belt/BeltBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/relays/belt/BeltBlock.java index bb36fcaba..4d8dc0e47 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/relays/belt/BeltBlock.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/relays/belt/BeltBlock.java @@ -16,6 +16,7 @@ import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.entity.Entity; import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.item.DyeColor; import net.minecraft.item.ItemStack; import net.minecraft.state.EnumProperty; import net.minecraft.state.IProperty; @@ -23,10 +24,12 @@ import net.minecraft.state.StateContainer.Builder; import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.Direction; +import net.minecraft.util.Hand; import net.minecraft.util.Direction.Axis; import net.minecraft.util.Direction.AxisDirection; import net.minecraft.util.IStringSerializable; import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.RayTraceResult; import net.minecraft.util.math.Vec3i; import net.minecraft.util.math.shapes.IBooleanFunction; @@ -36,6 +39,7 @@ import net.minecraft.util.math.shapes.VoxelShapes; import net.minecraft.world.IBlockReader; import net.minecraft.world.IWorldReader; import net.minecraft.world.World; +import net.minecraftforge.common.Tags; public class BeltBlock extends HorizontalKineticBlock implements IWithoutBlockItem, IWithTileEntity { @@ -153,6 +157,22 @@ public class BeltBlock extends HorizontalKineticBlock implements IWithoutBlockIt }); } + @Override + public boolean onBlockActivated(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn, + BlockRayTraceResult hit) { + if (player.isSneaking() || !player.isAllowEdit()) + return false; + ItemStack heldItem = player.getHeldItem(handIn); + if (!Tags.Items.DYES.contains(heldItem.getItem())) + return false; + if (worldIn.isRemote) + return true; + withTileEntityDo(worldIn, pos, te -> te.applyColor(DyeColor.getColor(heldItem))); + if (!player.isCreative()) + heldItem.shrink(1); + return true; + } + @Override protected void fillStateContainer(Builder builder) { builder.add(SLOPE, PART); diff --git a/src/main/java/com/simibubi/create/modules/contraptions/relays/belt/BeltSupportBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/relays/belt/BeltSupportBlock.java new file mode 100644 index 000000000..447fdd373 --- /dev/null +++ b/src/main/java/com/simibubi/create/modules/contraptions/relays/belt/BeltSupportBlock.java @@ -0,0 +1,35 @@ +package com.simibubi.create.modules.contraptions.relays.belt; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.block.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.shapes.ISelectionContext; +import net.minecraft.util.math.shapes.VoxelShape; +import net.minecraft.util.math.shapes.VoxelShapes; +import net.minecraft.world.IBlockReader; + +public class BeltSupportBlock extends Block { + + public static final VoxelShape SHAPE = makeCuboidShape(0, 0, 0, 16, 27, 16); + + public BeltSupportBlock() { + super(Properties.from(Blocks.ANDESITE)); + } + + @Override + public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) { + return SHAPE; + } + + @Override + public VoxelShape getRenderShape(BlockState state, IBlockReader worldIn, BlockPos pos) { + return VoxelShapes.fullCube(); + } + + @Override + public VoxelShape getRaytraceShape(BlockState state, IBlockReader worldIn, BlockPos pos) { + return getRenderShape(state, worldIn, pos); + } + +} diff --git a/src/main/java/com/simibubi/create/modules/contraptions/relays/belt/BeltTileEntity.java b/src/main/java/com/simibubi/create/modules/contraptions/relays/belt/BeltTileEntity.java index 1eea21399..3d72955aa 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/relays/belt/BeltTileEntity.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/relays/belt/BeltTileEntity.java @@ -7,6 +7,7 @@ import java.util.Map; import com.simibubi.create.AllBlocks; import com.simibubi.create.AllTileEntities; +import com.simibubi.create.foundation.utility.ColorHelper; import com.simibubi.create.modules.contraptions.base.KineticTileEntity; import com.simibubi.create.modules.contraptions.relays.belt.AllBeltAttachments.BeltAttachmentState; import com.simibubi.create.modules.contraptions.relays.belt.AllBeltAttachments.Tracker; @@ -19,6 +20,7 @@ import net.minecraft.entity.LivingEntity; import net.minecraft.entity.MoverType; import net.minecraft.entity.item.ItemEntity; import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.item.DyeColor; import net.minecraft.nbt.CompoundNBT; import net.minecraft.nbt.NBTUtil; import net.minecraft.state.properties.BlockStateProperties; @@ -38,6 +40,7 @@ public class BeltTileEntity extends KineticTileEntity implements ITickableTileEn public Map passengers; public AllBeltAttachments.Tracker attachmentTracker; private CompoundNBT trackerUpdateTag; + public int color; protected static class TransportedEntityInfo { int ticksSinceLastCollision; @@ -64,6 +67,7 @@ public class BeltTileEntity extends KineticTileEntity implements ITickableTileEn super(AllTileEntities.BELT.type); controller = BlockPos.ZERO; attachmentTracker = new Tracker(); + color = -1; } protected boolean isLastBelt() { @@ -86,6 +90,7 @@ public class BeltTileEntity extends KineticTileEntity implements ITickableTileEn @Override public CompoundNBT write(CompoundNBT compound) { compound.put("Controller", NBTUtil.writeBlockPos(controller)); + compound.putInt("Color", color); attachmentTracker.write(compound); return super.write(compound); } @@ -94,9 +99,25 @@ public class BeltTileEntity extends KineticTileEntity implements ITickableTileEn public void read(CompoundNBT compound) { controller = NBTUtil.readBlockPos(compound.getCompound("Controller")); trackerUpdateTag = compound; + color = compound.getInt("Color"); super.read(compound); } + public void applyColor(DyeColor colorIn) { + int colorValue = colorIn.getMapColor().colorValue; + for (BlockPos blockPos : BeltBlock.getBeltChain(world, getController())) { + BeltTileEntity tileEntity = (BeltTileEntity) world.getTileEntity(blockPos); + if (tileEntity != null) { + if (tileEntity.color == -1) { + tileEntity.color = colorValue; + } else { + tileEntity.color = ColorHelper.mixColors(tileEntity.color, colorValue, .5f); + } + tileEntity.sendData(); + } + } + } + public void setController(BlockPos controller) { this.controller = controller; } diff --git a/src/main/java/com/simibubi/create/modules/contraptions/relays/belt/BeltTileEntityRenderer.java b/src/main/java/com/simibubi/create/modules/contraptions/relays/belt/BeltTileEntityRenderer.java index a2e0aa4fd..5680096b9 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/relays/belt/BeltTileEntityRenderer.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/relays/belt/BeltTileEntityRenderer.java @@ -37,7 +37,7 @@ public class BeltTileEntityRenderer extends KineticTileEntityRenderer { beltTextures = textureMap.getSprite(new ResourceLocation(Create.ID, "block/belt_animated")); } - public ByteBuffer getTransformed(BeltTileEntity te, float x, float y, float z) { + public ByteBuffer getTransformed(BeltTileEntity te, float x, float y, float z, int color) { original.rewind(); mutable.rewind(); @@ -63,6 +63,11 @@ public class BeltTileEntityRenderer extends KineticTileEntityRenderer { float texOffX = textureOffsetX; float texOffY = textureOffsetY; + boolean defaultColor = color == -1; + int b = defaultColor ? 128 : color & 0xFF; + int g = defaultColor ? 128 : (color >> 8) & 0xFF; + int r = defaultColor ? 128 : (color >> 16) & 0xFF; + for (int vertex = 0; vertex < vertexCount(original); vertex++) { putPos(mutable, vertex, getX(original, vertex) + x, getY(original, vertex) + y, getZ(original, vertex) + z); @@ -71,6 +76,14 @@ public class BeltTileEntityRenderer extends KineticTileEntityRenderer { int bufferPosition = getBufferPosition(vertex); mutable.putFloat(bufferPosition + 16, original.getFloat(bufferPosition + 16) + texOffX); mutable.putFloat(bufferPosition + 20, original.getFloat(bufferPosition + 20) + texOffY); + + byte lumByte = getR(original, vertex); + float lum = (lumByte < 0 ? 255 + lumByte : lumByte) / 256f; + + int r2 = (int) (r * lum); + int g2 = (int) (g * lum); + int b2 = (int) (b * lum); + putColor(mutable, vertex, (byte) r2, (byte) g2, (byte) b2, (byte) 255); } return mutable; @@ -96,6 +109,7 @@ public class BeltTileEntityRenderer extends KineticTileEntityRenderer { } public void renderBeltFromCache(BeltTileEntity te, float x, float y, float z, BufferBuilder buffer) { - buffer.putBulkData(((BeltModelAnimator) cachedBuffers.get(te.getBlockState())).getTransformed(te, x, y, z)); + buffer.putBulkData( + ((BeltModelAnimator) cachedBuffers.get(te.getBlockState())).getTransformed(te, x, y, z, te.color)); } } diff --git a/src/main/java/com/simibubi/create/modules/logistics/block/diodes/ConfigureFlexpeaterPacket.java b/src/main/java/com/simibubi/create/modules/logistics/block/diodes/ConfigureFlexpeaterPacket.java new file mode 100644 index 000000000..6112a7af8 --- /dev/null +++ b/src/main/java/com/simibubi/create/modules/logistics/block/diodes/ConfigureFlexpeaterPacket.java @@ -0,0 +1,37 @@ +package com.simibubi.create.modules.logistics.block.diodes; + +import com.simibubi.create.foundation.packet.TileEntityConfigurationPacket; + +import net.minecraft.network.PacketBuffer; +import net.minecraft.util.math.BlockPos; + +public class ConfigureFlexpeaterPacket extends TileEntityConfigurationPacket { + + private int maxState; + + public ConfigureFlexpeaterPacket(BlockPos pos, int newMaxState) { + super(pos); + this.maxState = newMaxState; + } + + public ConfigureFlexpeaterPacket(PacketBuffer buffer) { + super(buffer); + } + + @Override + protected void writeSettings(PacketBuffer buffer) { + buffer.writeInt(maxState); + } + + @Override + protected void readSettings(PacketBuffer buffer) { + maxState = buffer.readInt(); + } + + @Override + protected void applySettings(FlexpeaterTileEntity te) { + te.maxState = maxState; + te.sendData(); + } + +} diff --git a/src/main/java/com/simibubi/create/modules/logistics/block/diodes/FlexpeaterBlock.java b/src/main/java/com/simibubi/create/modules/logistics/block/diodes/FlexpeaterBlock.java new file mode 100644 index 000000000..86e6f780a --- /dev/null +++ b/src/main/java/com/simibubi/create/modules/logistics/block/diodes/FlexpeaterBlock.java @@ -0,0 +1,99 @@ +package com.simibubi.create.modules.logistics.block.diodes; + +import com.simibubi.create.foundation.block.IBlockWithScrollableValue; +import com.simibubi.create.foundation.block.IWithTileEntity; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.block.Blocks; +import net.minecraft.block.RedstoneDiodeBlock; +import net.minecraft.state.BooleanProperty; +import net.minecraft.state.StateContainer.Builder; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.Direction; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Vec3d; +import net.minecraft.world.IBlockReader; +import net.minecraft.world.IWorld; + +public class FlexpeaterBlock extends RedstoneDiodeBlock + implements IWithTileEntity, IBlockWithScrollableValue { + + public static BooleanProperty POWERING = BooleanProperty.create("powering"); + private static Vec3d VALUE_POS = new Vec3d(2 / 16f, 5 / 16f, 5 / 16f); + + public FlexpeaterBlock() { + super(Properties.from(Blocks.REPEATER)); + setDefaultState(getDefaultState().with(POWERED, false).with(POWERING, false)); + } + + @Override + protected void fillStateContainer(Builder builder) { + builder.add(POWERED, POWERING, HORIZONTAL_FACING); + super.fillStateContainer(builder); + } + + @Override + public boolean hasTileEntity(BlockState state) { + return true; + } + + @Override + public TileEntity createTileEntity(BlockState state, IBlockReader world) { + return new FlexpeaterTileEntity(); + } + + @Override + protected int getActiveSignal(IBlockReader worldIn, BlockPos pos, BlockState state) { + return state.get(POWERING) ? 15 : 0; + } + + @Override + public int getWeakPower(BlockState blockState, IBlockReader blockAccess, BlockPos pos, Direction side) { + return blockState.get(HORIZONTAL_FACING) == side ? this.getActiveSignal(blockAccess, pos, blockState) : 0; + } + + @Override + protected int getDelay(BlockState p_196346_1_) { + return 0; + } + + @Override + public boolean canConnectRedstone(BlockState state, IBlockReader world, BlockPos pos, Direction side) { + if (side == null) + return false; + return side.getAxis() == state.get(HORIZONTAL_FACING).getAxis(); + } + + @Override + public int getCurrentValue(BlockState state, IWorld world, BlockPos pos) { + FlexpeaterTileEntity te = (FlexpeaterTileEntity) world.getTileEntity(pos); + if (te == null) + return 0; + return te.getDisplayValue(); + } + + @Override + public void onScroll(BlockState state, IWorld world, BlockPos pos, double delta) { + withTileEntityDo(world, pos, te -> te.increment((int) Math.signum(delta))); + } + + @Override + public String getValueName(BlockState state, IWorld world, BlockPos pos) { + FlexpeaterTileEntity te = (FlexpeaterTileEntity) world.getTileEntity(pos); + if (te == null) + return ""; + return "Delay (" + te.getUnit() + ")"; + } + + @Override + public Vec3d getValueBoxPosition(BlockState state, IWorld world, BlockPos pos) { + return VALUE_POS; + } + + @Override + public Direction getValueBoxDirection(BlockState state, IWorld world, BlockPos pos) { + return Direction.UP; + } + +} diff --git a/src/main/java/com/simibubi/create/modules/logistics/block/diodes/FlexpeaterTileEntity.java b/src/main/java/com/simibubi/create/modules/logistics/block/diodes/FlexpeaterTileEntity.java new file mode 100644 index 000000000..1b569d69d --- /dev/null +++ b/src/main/java/com/simibubi/create/modules/logistics/block/diodes/FlexpeaterTileEntity.java @@ -0,0 +1,132 @@ +package com.simibubi.create.modules.logistics.block.diodes; + +import static com.simibubi.create.modules.logistics.block.diodes.FlexpeaterBlock.POWERING; +import static net.minecraft.block.RedstoneDiodeBlock.POWERED; + +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 FlexpeaterTileEntity extends SyncedTileEntity implements ITickableTileEntity { + + public int state; + public int maxState; + public int newMaxState; + public int lastModified; + public boolean charging; + + public FlexpeaterTileEntity() { + super(AllTileEntities.FLEXPEATER.type); + lastModified = -1; + maxState = 1; + } + + @Override + public void read(CompoundNBT compound) { + state = compound.getInt("State"); + charging = compound.getBoolean("Charging"); + newMaxState = maxState = compound.getInt("MaxState"); + lastModified = -1; + super.read(compound); + } + + @Override + public CompoundNBT write(CompoundNBT compound) { + compound.putInt("State", state); + compound.putInt("MaxState", maxState); + compound.putBoolean("Charging", charging); + return super.write(compound); + } + + public void increment(int amount) { + + if (amount > 0) { + if (newMaxState < 20) { + newMaxState += amount; + } else if (newMaxState < 20 * 60) { + newMaxState += amount * 20; + } else { + newMaxState += amount * 20 * 60; + } + lastModified = 0; + } + + if (amount < 0) { + if (newMaxState <= 20) { + newMaxState += amount; + } else if (newMaxState <= 20 * 60) { + newMaxState += amount * 20; + } else { + newMaxState += amount * 20 * 60; + } + lastModified = 0; + } + + newMaxState = MathHelper.clamp(newMaxState, 1, 60 * 20 * 30); + } + + @Override + public boolean hasFastRenderer() { + return true; + } + + public int getDisplayValue() { + if (newMaxState < 20) + return newMaxState; + if (newMaxState < 20 * 60) + return newMaxState / 20; + return newMaxState / 20 / 60; + } + + public String getUnit() { + if (newMaxState < 20) + return "Ticks"; + if (newMaxState < 20 * 60) + return "Seconds"; + return "Minutes"; + } + + @Override + public void tick() { + updateConfigurableValue(); + boolean powered = getBlockState().get(POWERED); + boolean powering = getBlockState().get(POWERING); + boolean atMax = state == maxState; + boolean atMin = state == 0; + + if (!charging && powered) + charging = true; + + if (charging && atMax) { + if (!powering && !world.isRemote) + world.setBlockState(pos, getBlockState().with(POWERING, true)); + if (!powered) + charging = false; + return; + } + + if (!charging && atMin) { + if (powering && !world.isRemote) + world.setBlockState(pos, getBlockState().with(POWERING, false)); + return; + } + + state += charging ? 1 : -1; + } + + public void updateConfigurableValue() { + if (!world.isRemote) + return; + if (lastModified == -1) + return; + if (lastModified++ > 10) { + lastModified = -1; + AllPackets.channel.sendToServer(new ConfigureFlexpeaterPacket(pos, newMaxState)); + } + } + +} diff --git a/src/main/java/com/simibubi/create/modules/logistics/block/diodes/FlexpeaterTileEntityRenderer.java b/src/main/java/com/simibubi/create/modules/logistics/block/diodes/FlexpeaterTileEntityRenderer.java new file mode 100644 index 000000000..0436fc336 --- /dev/null +++ b/src/main/java/com/simibubi/create/modules/logistics/block/diodes/FlexpeaterTileEntityRenderer.java @@ -0,0 +1,83 @@ +package com.simibubi.create.modules.logistics.block.diodes; + +import java.nio.ByteBuffer; +import java.util.Random; + +import org.lwjgl.opengl.GL11; + +import com.simibubi.create.AllBlocks; +import com.simibubi.create.foundation.utility.BufferManipulator; +import com.simibubi.create.foundation.utility.ColorHelper; + +import net.minecraft.block.BlockState; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.BlockModelRenderer; +import net.minecraft.client.renderer.BlockRendererDispatcher; +import net.minecraft.client.renderer.BufferBuilder; +import net.minecraft.client.renderer.model.IBakedModel; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.util.math.BlockPos; +import net.minecraftforge.client.model.animation.TileEntityRendererFast; +import net.minecraftforge.client.model.data.EmptyModelData; + +public class FlexpeaterTileEntityRenderer extends TileEntityRendererFast { + + protected class FlexpeaterIndicatorRenderer extends BufferManipulator { + + public FlexpeaterIndicatorRenderer(ByteBuffer original) { + super(original); + } + + public ByteBuffer getTransformed(float xIn, float yIn, float zIn, float colorModifier, int packedLightCoords) { + original.rewind(); + mutable.rewind(); + + int color = ColorHelper.mixColors(0x2C0300, 0xCD0000, colorModifier); + + byte r = (byte) (color >> 16); + byte g = (byte) ((color >> 8) & 0xFF); + byte b = (byte) (color & 0xFF); + byte a = (byte) 255; + + for (int vertex = 0; vertex < vertexCount(original); vertex++) { + putColor(mutable, vertex, r, g, b, a); + putPos(mutable, vertex, getX(original, vertex) + xIn, getY(original, vertex) + yIn, + getZ(original, vertex) + zIn); + putLight(mutable, vertex, packedLightCoords); + } + + return mutable; + } + } + + private FlexpeaterIndicatorRenderer cachedIndicator; + + @Override + public void renderTileEntityFast(FlexpeaterTileEntity te, double x, double y, double z, float partialTicks, + int destroyStage, BufferBuilder buffer) { + BlockPos pos = te.getPos(); + + if (cachedIndicator == null) { + BlockState renderedState = AllBlocks.FLEXPEATER_INDICATOR.get().getDefaultState(); + BlockRendererDispatcher dispatcher = Minecraft.getInstance().getBlockRendererDispatcher(); + BlockModelRenderer blockRenderer = dispatcher.getBlockModelRenderer(); + IBakedModel originalModel = dispatcher.getModelForState(renderedState); + BufferBuilder builder = new BufferBuilder(0); + Random random = new Random(); + + builder.setTranslation(0, 1, 0); + builder.begin(GL11.GL_QUADS, DefaultVertexFormats.BLOCK); + blockRenderer.renderModelFlat(getWorld(), originalModel, renderedState, BlockPos.ZERO.down(), builder, true, + random, 42, EmptyModelData.INSTANCE); + builder.finishDrawing(); + + cachedIndicator = new FlexpeaterIndicatorRenderer(builder.getByteBuffer()); + } + + BlockState blockState = te.getBlockState(); + int packedLightmapCoords = blockState.getPackedLightmapCoords(getWorld(), pos); + buffer.putBulkData(cachedIndicator.getTransformed((float) x, (float) y, (float) z, + te.state / (float) te.maxState, packedLightmapCoords)); + } + +} diff --git a/src/main/java/com/simibubi/create/modules/logistics/block/PulseRepeaterBlock.java b/src/main/java/com/simibubi/create/modules/logistics/block/diodes/PulseRepeaterBlock.java similarity index 84% rename from src/main/java/com/simibubi/create/modules/logistics/block/PulseRepeaterBlock.java rename to src/main/java/com/simibubi/create/modules/logistics/block/diodes/PulseRepeaterBlock.java index 83ee29b17..a7b9e6f0a 100644 --- a/src/main/java/com/simibubi/create/modules/logistics/block/PulseRepeaterBlock.java +++ b/src/main/java/com/simibubi/create/modules/logistics/block/diodes/PulseRepeaterBlock.java @@ -1,4 +1,4 @@ -package com.simibubi.create.modules.logistics.block; +package com.simibubi.create.modules.logistics.block.diodes; import java.util.Random; @@ -8,6 +8,7 @@ import net.minecraft.block.Blocks; import net.minecraft.block.RedstoneDiodeBlock; import net.minecraft.state.BooleanProperty; import net.minecraft.state.StateContainer.Builder; +import net.minecraft.util.Direction; import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockReader; import net.minecraft.world.TickPriority; @@ -26,7 +27,14 @@ public class PulseRepeaterBlock extends RedstoneDiodeBlock { protected int getDelay(BlockState state) { return 1; } - + + @Override + public boolean canConnectRedstone(BlockState state, IBlockReader world, BlockPos pos, Direction side) { + if (side == null) + return false; + return side.getAxis() == state.get(HORIZONTAL_FACING).getAxis(); + } + @Override public void tick(BlockState state, World worldIn, BlockPos pos, Random random) { boolean powered = state.get(POWERED); diff --git a/src/main/resources/assets/create/blockstates/belt_support.json b/src/main/resources/assets/create/blockstates/belt_support.json new file mode 100644 index 000000000..7d6ec4d90 --- /dev/null +++ b/src/main/resources/assets/create/blockstates/belt_support.json @@ -0,0 +1,5 @@ +{ + "variants": { + "": { "model": "create:block/belt_support" } + } +} diff --git a/src/main/resources/assets/create/blockstates/flexpeater.json b/src/main/resources/assets/create/blockstates/flexpeater.json new file mode 100644 index 000000000..0de56e0eb --- /dev/null +++ b/src/main/resources/assets/create/blockstates/flexpeater.json @@ -0,0 +1,24 @@ +{ + "forge_marker": 1, + "variants": { + "powered=false,powering=false,facing=north": { "model": "create:block/flexpeater", "y": 180 }, + "powered=false,powering=false,facing=east": { "model": "create:block/flexpeater", "y": 270 }, + "powered=false,powering=false,facing=south": { "model": "create:block/flexpeater", "y": 0 }, + "powered=false,powering=false,facing=west": { "model": "create:block/flexpeater", "y": 90 }, + + "powered=true,powering=false,facing=north": { "model": "create:block/flexpeater_powered", "y": 180 }, + "powered=true,powering=false,facing=east": { "model": "create:block/flexpeater_powered", "y": 270 }, + "powered=true,powering=false,facing=south": { "model": "create:block/flexpeater_powered", "y": 0 }, + "powered=true,powering=false,facing=west": { "model": "create:block/flexpeater_powered", "y": 90 }, + + "powered=false,powering=true,facing=north": { "model": "create:block/flexpeater_powering", "y": 180 }, + "powered=false,powering=true,facing=east": { "model": "create:block/flexpeater_powering", "y": 270 }, + "powered=false,powering=true,facing=south": { "model": "create:block/flexpeater_powering", "y": 0 }, + "powered=false,powering=true,facing=west": { "model": "create:block/flexpeater_powering", "y": 90 }, + + "powered=true,powering=true,facing=north": { "model": "create:block/flexpeater_powered_powering", "y": 180 }, + "powered=true,powering=true,facing=east": { "model": "create:block/flexpeater_powered_powering", "y": 270 }, + "powered=true,powering=true,facing=south": { "model": "create:block/flexpeater_powered_powering", "y": 0 }, + "powered=true,powering=true,facing=west": { "model": "create:block/flexpeater_powered_powering", "y": 90 } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/create/blockstates/flexpeater_indicator.json b/src/main/resources/assets/create/blockstates/flexpeater_indicator.json new file mode 100644 index 000000000..d20d877af --- /dev/null +++ b/src/main/resources/assets/create/blockstates/flexpeater_indicator.json @@ -0,0 +1,5 @@ +{ + "variants": { + "": { "model": "create:block/flexpeater_indicator" } + } +} diff --git a/src/main/resources/assets/create/blockstates/mechanical_press.json b/src/main/resources/assets/create/blockstates/mechanical_press.json new file mode 100644 index 000000000..784e56ef5 --- /dev/null +++ b/src/main/resources/assets/create/blockstates/mechanical_press.json @@ -0,0 +1,14 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "create:block/mechanical_press_base" + }, + "variants": { + "facing": { + "north": { "y": 0 }, + "east": { "y": 90 }, + "west": { "y": 90 }, + "south": { "y": 0 } + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/create/blockstates/mechanical_press_head.json b/src/main/resources/assets/create/blockstates/mechanical_press_head.json new file mode 100644 index 000000000..a37d82df9 --- /dev/null +++ b/src/main/resources/assets/create/blockstates/mechanical_press_head.json @@ -0,0 +1,14 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "create:block/mechanical_press_head" + }, + "variants": { + "facing": { + "north": { "y": 0 }, + "east": { "y": 90 }, + "west": { "y": 90 }, + "south": { "y": 0 } + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/create/lang/en_us.json b/src/main/resources/assets/create/lang/en_us.json index 2ab47fdc7..5f5a97482 100644 --- a/src/main/resources/assets/create/lang/en_us.json +++ b/src/main/resources/assets/create/lang/en_us.json @@ -15,6 +15,10 @@ "item.create.rose_quartz": "Rose Quartz", "item.create.refined_rose_quartz": "Refined Rose Quartz", "item.create.refined_radiance_cube": "Refined Radiance", + "item.create.iron_sheet": "Iron Sheets", + "item.create.propeller": "Propeller", + "item.create.flour": "Wheat Flour", + "item.create.dough": "Dough", "item.create.blazing_pickaxe": "Blazing Pickaxe", "item.create.blazing_shovel": "Blazing Shovel", @@ -46,6 +50,8 @@ "block.create.drill": "Mechanical Drill", "block.create.harvester": "Mechanical Harvester", "block.create.water_wheel": "Water Wheel", + "block.create.belt_support": "Belt Support", + "block.create.mechanical_press": "Mechanical Press", "block.create.sticky_mechanical_piston": "Sticky Mechanical Piston", "block.create.mechanical_piston": "Mechanical Piston", @@ -63,6 +69,7 @@ "block.create.belt_funnel": "Belt Funnel", "block.create.linked_extractor": "Linked Extractor", "block.create.pulse_repeater": "Pulse Repeater", + "block.create.flexpeater": "FlexPeater", "block.create.entity_detector": "Belt Observer", "block.create.andesite_bricks": "Andesite Bricks", diff --git a/src/main/resources/assets/create/models/block/belt_support.json b/src/main/resources/assets/create/models/block/belt_support.json new file mode 100644 index 000000000..5b9d7e2a5 --- /dev/null +++ b/src/main/resources/assets/create/models/block/belt_support.json @@ -0,0 +1,36 @@ +{ + "__comment": "Model generated using MrCrayfish's Model Creator (https://mrcrayfish.com/tools?id=mc)", + "parent": "block/block", + "textures": { + "brass_casing_side": "create:block/brass_casing_side", + "brass_casing": "create:block/brass_casing", + "belt_support_side": "create:block/brass_casing_side", + "particle": "create:block/brass_casing_side" + }, + "elements": [ + { + "name": "Cube", + "from": [ 0, 0, 0 ], + "to": [ 16, 16, 16 ], + "faces": { + "north": { "texture": "#brass_casing_side", "uv": [ 0, 0, 16, 16 ] }, + "east": { "texture": "#brass_casing_side", "uv": [ 0, 0, 16, 16 ] }, + "south": { "texture": "#brass_casing_side", "uv": [ 0, 0, 16, 16 ] }, + "west": { "texture": "#brass_casing_side", "uv": [ 0, 0, 16, 16 ] }, + "down": { "texture": "#brass_casing", "uv": [ 0, 0, 16, 16 ] } + } + }, + { + "name": "Cube", + "from": [ -0.03125, 16, -0.03125 ], + "to": [ 16.03125, 27, 16.03125 ], + "faces": { + "north": { "texture": "#brass_casing_side", "uv": [ 0, 0, 16, 11 ] }, + "east": { "texture": "#belt_support_side", "uv": [ 0, 0, 16, 11 ] }, + "south": { "texture": "#brass_casing_side", "uv": [ 0, 0, 16, 11 ] }, + "west": { "texture": "#belt_support_side", "uv": [ 0, 0, 16, 11 ] }, + "up": { "texture": "#brass_casing", "uv": [ 0, 0, 16, 16 ] } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/flexpeater.json b/src/main/resources/assets/create/models/block/flexpeater.json new file mode 100644 index 000000000..ed5ceebcd --- /dev/null +++ b/src/main/resources/assets/create/models/block/flexpeater.json @@ -0,0 +1,63 @@ +{ + "__comment": "Model generated using MrCrayfish's Model Creator (https://mrcrayfish.com/tools?id=mc)", + "parent": "block/block", + "textures": { + "flexpeater_off": "create:block/flexpeater_off", + "torch": "minecraft:block/redstone_torch_off", + "smooth_stone": "minecraft:block/smooth_stone", + "particle": "create:block/flexpeater_off" + }, + "elements": [ + { + "name": "Top", + "from": [ 5, 2.1, 5 ], + "to": [ 11, 3.1, 11 ], + "faces": { + "north": { "texture": "#flexpeater_off", "uv": [ 5, 5, 11, 6 ], "rotation": 180 }, + "east": { "texture": "#flexpeater_off", "uv": [ 10, 5, 11, 11 ], "rotation": 90 }, + "south": { "texture": "#flexpeater_off", "uv": [ 5, 10, 11, 11 ] }, + "west": { "texture": "#flexpeater_off", "uv": [ 5, 11, 6, 5 ], "rotation": 90 }, + "up": { "texture": "#flexpeater_off", "uv": [ 5, 5, 11, 11 ] } + } + }, + { + "name": "circuit", + "from": [ 0, 0, 0 ], + "to": [ 16, 2, 16 ], + "faces": { + "north": { "texture": "#smooth_stone", "uv": [ 0, 0, 16, 2 ] }, + "east": { "texture": "#smooth_stone", "uv": [ 0, 0, 16, 2 ] }, + "south": { "texture": "#smooth_stone", "uv": [ 0, 0, 16, 2 ] }, + "west": { "texture": "#smooth_stone", "uv": [ 0, 0, 16, 2 ] }, + "up": { "texture": "#flexpeater_off", "uv": [ 0, 0, 16, 16 ] }, + "down": { "texture": "#smooth_stone", "uv": [ 0, 0, 16, 16 ] } + } + }, + { + "name": "Front Torch", + "from": [ 6, 2, 2 ], + "to": [ 10, 8, 4 ], + "faces": { + "north": { "texture": "#torch", "uv": [ 6, 5, 10, 11 ] }, + "south": { "texture": "#torch", "uv": [ 6, 5, 10, 11 ] } + } + }, + { + "name": "Front Torch", + "from": [ 7, 2, 1 ], + "to": [ 9, 8, 5 ], + "faces": { + "east": { "texture": "#torch", "uv": [ 6, 5, 10, 11 ] }, + "west": { "texture": "#torch", "uv": [ 6, 5, 10, 11 ] } + } + }, + { + "name": "Front Torch Top", + "from": [ 7, 6, 2 ], + "to": [ 9, 7, 4 ], + "faces": { + "up": { "texture": "#torch", "uv": [ 7, 6, 9, 8 ] } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/flexpeater_indicator.json b/src/main/resources/assets/create/models/block/flexpeater_indicator.json new file mode 100644 index 000000000..5ed46c25e --- /dev/null +++ b/src/main/resources/assets/create/models/block/flexpeater_indicator.json @@ -0,0 +1,19 @@ +{ + "textures": { + "flexpeater_off": "create:block/flexpeater_off" + }, + "elements": [ + { + "name": "Light", + "from": [ 3.96875, 1.96875, 3.96875 ], + "to": [ 12.03125, 3, 12.03125 ], + "faces": { + "north": { "texture": "#flexpeater_off", "uv": [ 4, 4, 12, 5 ], "rotation": 180 }, + "east": { "texture": "#flexpeater_off", "uv": [ 11, 4, 12, 12 ], "rotation": 90 }, + "south": { "texture": "#flexpeater_off", "uv": [ 4, 11, 12, 12 ] }, + "west": { "texture": "#flexpeater_off", "uv": [ 4, 12, 5, 4 ], "rotation": 90 }, + "up": { "texture": "#flexpeater_off", "uv": [ 4, 4, 12, 12 ] } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/flexpeater_powered.json b/src/main/resources/assets/create/models/block/flexpeater_powered.json new file mode 100644 index 000000000..c596d6b53 --- /dev/null +++ b/src/main/resources/assets/create/models/block/flexpeater_powered.json @@ -0,0 +1,7 @@ +{ + "parent": "create:block/flexpeater", + "textures": { + "flexpeater_off": "create:block/flexpeater_on", + "particle": "create:block/flexpeater_on" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/flexpeater_powered_powering.json b/src/main/resources/assets/create/models/block/flexpeater_powered_powering.json new file mode 100644 index 000000000..f9b173278 --- /dev/null +++ b/src/main/resources/assets/create/models/block/flexpeater_powered_powering.json @@ -0,0 +1,6 @@ +{ + "parent": "create:block/flexpeater_powered", + "textures": { + "torch": "minecraft:block/redstone_torch" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/flexpeater_powering.json b/src/main/resources/assets/create/models/block/flexpeater_powering.json new file mode 100644 index 000000000..6e25e1146 --- /dev/null +++ b/src/main/resources/assets/create/models/block/flexpeater_powering.json @@ -0,0 +1,6 @@ +{ + "parent": "create:block/flexpeater", + "textures": { + "torch": "minecraft:block/redstone_torch" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/mechanical_press_base.json b/src/main/resources/assets/create/models/block/mechanical_press_base.json new file mode 100644 index 000000000..52e0a616d --- /dev/null +++ b/src/main/resources/assets/create/models/block/mechanical_press_base.json @@ -0,0 +1,59 @@ +{ + "__comment": "Model generated using MrCrayfish's Model Creator (https://mrcrayfish.com/tools?id=mc)", + "textures": { + "gearbox_top": "create:block/gearbox_top", + "gearbox": "create:block/gearbox", + "mechanical_press_top": "create:block/mechanical_press_top", + "mechanical_press_bottom": "create:block/mechanical_press_bottom", + "particle": "create:block/gearbox" + }, + "elements": [ + { + "name": "Top", + "from": [ 0, 14, 0 ], + "to": [ 16, 16, 16 ], + "faces": { + "north": { "texture": "#gearbox", "uv": [ 0, 0, 16, 2 ] }, + "east": { "texture": "#gearbox", "uv": [ 0, 0, 16, 2 ] }, + "south": { "texture": "#gearbox", "uv": [ 0, 0, 16, 2 ] }, + "west": { "texture": "#gearbox", "uv": [ 0, 0, 16, 2 ] }, + "up": { "texture": "#mechanical_press_top", "uv": [ 0, 0, 16, 16 ] }, + "down": { "texture": "#gearbox", "uv": [ 0, 0, 16, 16 ] } + } + }, + { + "name": "Core", + "from": [ 2, 4, 1 ], + "to": [ 14, 14, 15 ], + "faces": { + "north": { "texture": "#gearbox", "uv": [ 2, 2, 14, 12 ] }, + "south": { "texture": "#gearbox", "uv": [ 2, 2, 14, 12 ] }, + "down": { "texture": "#mechanical_press_bottom", "uv": [ 2, 1, 14, 15 ] } + } + }, + { + "name": "Side", + "from": [ 0, 2, 0 ], + "to": [ 2, 14, 16 ], + "faces": { + "north": { "texture": "#gearbox_top", "uv": [ 14, 2, 16, 14 ] }, + "east": { "texture": "#gearbox_top", "uv": [ 0, 4, 16, 16 ] }, + "south": { "texture": "#gearbox_top", "uv": [ 0, 2, 2, 14 ] }, + "west": { "texture": "#gearbox_top", "uv": [ 0, 4, 16, 16 ] }, + "down": { "texture": "#gearbox_top", "uv": [ 0, 0, 2, 16 ] } + } + }, + { + "name": "Side", + "from": [ 14, 2, 0 ], + "to": [ 16, 14, 16 ], + "faces": { + "north": { "texture": "#gearbox_top", "uv": [ 0, 2, 2, 14 ] }, + "east": { "texture": "#gearbox_top", "uv": [ 0, 4, 16, 16 ] }, + "south": { "texture": "#gearbox_top", "uv": [ 14, 2, 16, 14 ] }, + "west": { "texture": "#gearbox_top", "uv": [ 0, 4, 16, 16 ] }, + "down": { "texture": "#gearbox_top", "uv": [ 14, 0, 16, 16 ] } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/mechanical_press_head.json b/src/main/resources/assets/create/models/block/mechanical_press_head.json new file mode 100644 index 000000000..2f38fe009 --- /dev/null +++ b/src/main/resources/assets/create/models/block/mechanical_press_head.json @@ -0,0 +1,87 @@ +{ + "__comment": "Model generated using MrCrayfish's Model Creator (https://mrcrayfish.com/tools?id=mc)", + "textures": { + "mechanical_press_head": "create:block/mechanical_press_head", + "mechanical_press_pole": "create:block/mechanical_press_pole" + }, + "elements": [ + { + "name": "Pole1Core", + "from": [ 6, 4, 6 ], + "to": [ 10, 14, 10 ], + "faces": { + "east": { "texture": "#mechanical_press_pole", "uv": [ 6, 6, 10, 16 ] }, + "west": { "texture": "#mechanical_press_pole", "uv": [ 6, 6, 10, 16 ] } + } + }, + { + "name": "Pole2Core", + "from": [ 6, 14, 6 ], + "to": [ 10, 27, 10 ], + "faces": { + "east": { "texture": "#mechanical_press_pole", "uv": [ 6, 0, 10, 13 ] }, + "west": { "texture": "#mechanical_press_pole", "uv": [ 6, 0, 10, 13 ] }, + "up": { "texture": "#mechanical_press_pole", "uv": [ 11, 1, 15, 5 ], "rotation": 180 } + } + }, + { + "name": "Pole1Side", + "from": [ 5, 4, 5 ], + "to": [ 11, 14, 6 ], + "faces": { + "north": { "texture": "#mechanical_press_pole", "uv": [ 0, 6, 6, 16 ] }, + "east": { "texture": "#mechanical_press_pole", "uv": [ 0, 6, 1, 16 ] }, + "south": { "texture": "#mechanical_press_pole", "uv": [ 0, 6, 6, 16 ] }, + "west": { "texture": "#mechanical_press_pole", "uv": [ 5, 6, 6, 16 ] } + } + }, + { + "name": "Pole1Side", + "from": [ 5, 4, 10 ], + "to": [ 11, 14, 11 ], + "faces": { + "north": { "texture": "#mechanical_press_pole", "uv": [ 0, 6, 6, 16 ] }, + "east": { "texture": "#mechanical_press_pole", "uv": [ 0, 6, 1, 16 ] }, + "south": { "texture": "#mechanical_press_pole", "uv": [ 0, 6, 6, 16 ] }, + "west": { "texture": "#mechanical_press_pole", "uv": [ 5, 6, 6, 16 ] } + } + }, + { + "name": "Pole2Side", + "from": [ 5, 14, 10 ], + "to": [ 11, 27, 11 ], + "faces": { + "north": { "texture": "#mechanical_press_pole", "uv": [ 0, 0, 6, 13 ] }, + "east": { "texture": "#mechanical_press_pole", "uv": [ 0, 0, 1, 13 ] }, + "south": { "texture": "#mechanical_press_pole", "uv": [ 0, 0, 6, 13 ] }, + "west": { "texture": "#mechanical_press_pole", "uv": [ 5, 0, 6, 13 ] }, + "up": { "texture": "#mechanical_press_pole", "uv": [ 10, 0, 16, 1 ], "rotation": 180 } + } + }, + { + "name": "Pole2Side", + "from": [ 5, 14, 5 ], + "to": [ 11, 27, 6 ], + "faces": { + "north": { "texture": "#mechanical_press_pole", "uv": [ 0, 0, 6, 13 ] }, + "east": { "texture": "#mechanical_press_pole", "uv": [ 0, 0, 1, 13 ] }, + "south": { "texture": "#mechanical_press_pole", "uv": [ 0, 0, 6, 13 ] }, + "west": { "texture": "#mechanical_press_pole", "uv": [ 5, 0, 6, 13 ] }, + "up": { "texture": "#mechanical_press_pole", "uv": [ 10, 5, 16, 6 ], "rotation": 180 } + } + }, + { + "name": "Head", + "from": [ 3, 0, 3 ], + "to": [ 13, 4, 13 ], + "faces": { + "north": { "texture": "#mechanical_press_head", "uv": [ 1, 0, 11, 4 ] }, + "east": { "texture": "#mechanical_press_head", "uv": [ 1, 0, 11, 4 ] }, + "south": { "texture": "#mechanical_press_head", "uv": [ 1, 0, 11, 4 ] }, + "west": { "texture": "#mechanical_press_head", "uv": [ 1, 0, 11, 4 ] }, + "up": { "texture": "#mechanical_press_head", "uv": [ 1, 5, 11, 15 ], "rotation": 180 }, + "down": { "texture": "#mechanical_press_head", "uv": [ 1, 5, 11, 15 ], "rotation": 180 } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/item/belt_support.json b/src/main/resources/assets/create/models/item/belt_support.json new file mode 100644 index 000000000..82774f10e --- /dev/null +++ b/src/main/resources/assets/create/models/item/belt_support.json @@ -0,0 +1,15 @@ +{ + "parent": "create:block/belt_support", + "display": { + "gui": { + "rotation": [ 30, 225, 0 ], + "translation": [ 0, -2.25, 0], + "scale":[ 0.45, 0.45, 0.45 ] + }, + "fixed": { + "rotation": [ 0, 0, 0 ], + "translation": [ 0, -2.75, 0], + "scale":[ 0.5, 0.5, 0.5 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/item/dough.json b/src/main/resources/assets/create/models/item/dough.json new file mode 100644 index 000000000..ad9f7a08c --- /dev/null +++ b/src/main/resources/assets/create/models/item/dough.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "create:item/dough" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/item/flexpeater.json b/src/main/resources/assets/create/models/item/flexpeater.json new file mode 100644 index 000000000..2aa1fe598 --- /dev/null +++ b/src/main/resources/assets/create/models/item/flexpeater.json @@ -0,0 +1,13 @@ +{ + "parent": "create:block/flexpeater", + "textures": { + "flexpeater_off": "create:block/flexpeater_item" + }, + "display": { + "fixed": { + "rotation": [ 270, 0, 0 ], + "translation": [ 0, 0, -3], + "scale":[ 0.5, 0.5, 0.5 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/item/flour.json b/src/main/resources/assets/create/models/item/flour.json new file mode 100644 index 000000000..eb88f7f82 --- /dev/null +++ b/src/main/resources/assets/create/models/item/flour.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "create:item/flour" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/item/iron_sheet.json b/src/main/resources/assets/create/models/item/iron_sheet.json new file mode 100644 index 000000000..4b66bd185 --- /dev/null +++ b/src/main/resources/assets/create/models/item/iron_sheet.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "create:item/iron_sheet" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/item/mechanical_press.json b/src/main/resources/assets/create/models/item/mechanical_press.json new file mode 100644 index 000000000..0a69efb81 --- /dev/null +++ b/src/main/resources/assets/create/models/item/mechanical_press.json @@ -0,0 +1,151 @@ +{ + "__comment": "Model generated using MrCrayfish's Model Creator (https://mrcrayfish.com/tools?id=mc)", + "parent": "block/block", + "textures": { + "mechanical_press_head": "create:block/mechanical_press_head", + "gearbox_top": "create:block/gearbox_top", + "mechanical_press_pole": "create:block/mechanical_press_pole", + "gearbox": "create:block/gearbox", + "mechanical_press_top": "create:block/mechanical_press_top", + "mechanical_press_bottom": "create:block/mechanical_press_bottom" + }, + "display": { + "gui": { + "rotation": [ 30, 225, 0 ], + "translation": [ 0, -2, 0], + "scale":[ 0.55, 0.55, 0.55 ] + }, + "fixed": { + "rotation": [ 0, 0, 0 ], + "translation": [ 0, -2.75, -0.0625], + "scale":[ 0.5, 0.5, 0.5 ] + } + }, + "elements": [ + { + "name": "Top", + "from": [ 0, 18, 0 ], + "to": [ 16, 20, 16 ], + "faces": { + "north": { "texture": "#gearbox", "uv": [ 0, 0, 16, 2 ] }, + "east": { "texture": "#gearbox", "uv": [ 0, 0, 16, 2 ] }, + "south": { "texture": "#gearbox", "uv": [ 0, 0, 16, 2 ] }, + "west": { "texture": "#gearbox", "uv": [ 0, 0, 16, 2 ] }, + "up": { "texture": "#mechanical_press_top", "uv": [ 0, 0, 16, 16 ], "rotation": 180 }, + "down": { "texture": "#gearbox", "uv": [ 0, 0, 16, 16 ], "rotation": 180 } + } + }, + { + "name": "Core", + "from": [ 2, 8, 1 ], + "to": [ 14, 18, 15 ], + "faces": { + "north": { "texture": "#gearbox", "uv": [ 2, 2, 14, 12 ] }, + "south": { "texture": "#gearbox", "uv": [ 2, 2, 14, 12 ] }, + "down": { "texture": "#mechanical_press_bottom", "uv": [ 2, 1, 14, 15 ], "rotation": 180 } + } + }, + { + "name": "Side", + "from": [ 14, 6, 0 ], + "to": [ 16, 18, 16 ], + "faces": { + "north": { "texture": "#gearbox_top", "uv": [ 0, 2, 2, 14 ] }, + "east": { "texture": "#gearbox_top", "uv": [ 0, 4, 16, 16 ] }, + "south": { "texture": "#gearbox_top", "uv": [ 14, 2, 16, 14 ] }, + "west": { "texture": "#gearbox_top", "uv": [ 0, 4, 16, 16 ] }, + "down": { "texture": "#gearbox_top", "uv": [ 0, 0, 2, 16 ], "rotation": 180 } + } + }, + { + "name": "Side", + "from": [ 0, 6, 0 ], + "to": [ 2, 18, 16 ], + "faces": { + "north": { "texture": "#gearbox_top", "uv": [ 14, 2, 16, 14 ] }, + "east": { "texture": "#gearbox_top", "uv": [ 0, 4, 16, 16 ] }, + "south": { "texture": "#gearbox_top", "uv": [ 0, 2, 2, 14 ] }, + "west": { "texture": "#gearbox_top", "uv": [ 0, 4, 16, 16 ] }, + "down": { "texture": "#gearbox_top", "uv": [ 14, 0, 16, 16 ], "rotation": 180 } + } + }, + { + "name": "Pole1Core", + "from": [ 6, 4, 6 ], + "to": [ 10, 14, 10 ], + "faces": { + "east": { "texture": "#mechanical_press_pole", "uv": [ 6, 6, 10, 16 ] }, + "west": { "texture": "#mechanical_press_pole", "uv": [ 6, 6, 10, 16 ] } + } + }, + { + "name": "Pole2Core", + "from": [ 6, 14, 6 ], + "to": [ 10, 27, 10 ], + "faces": { + "east": { "texture": "#mechanical_press_pole", "uv": [ 6, 0, 10, 13 ] }, + "west": { "texture": "#mechanical_press_pole", "uv": [ 6, 0, 10, 13 ] }, + "up": { "texture": "#mechanical_press_pole", "uv": [ 11, 1, 15, 5 ], "rotation": 180 } + } + }, + { + "name": "Pole1Side", + "from": [ 5, 4, 5 ], + "to": [ 11, 14, 6 ], + "faces": { + "north": { "texture": "#mechanical_press_pole", "uv": [ 0, 6, 6, 16 ] }, + "east": { "texture": "#mechanical_press_pole", "uv": [ 0, 6, 1, 16 ] }, + "south": { "texture": "#mechanical_press_pole", "uv": [ 0, 6, 6, 16 ] }, + "west": { "texture": "#mechanical_press_pole", "uv": [ 5, 6, 6, 16 ] } + } + }, + { + "name": "Pole1Side", + "from": [ 5, 4, 10 ], + "to": [ 11, 14, 11 ], + "faces": { + "north": { "texture": "#mechanical_press_pole", "uv": [ 0, 6, 6, 16 ] }, + "east": { "texture": "#mechanical_press_pole", "uv": [ 0, 6, 1, 16 ] }, + "south": { "texture": "#mechanical_press_pole", "uv": [ 0, 6, 6, 16 ] }, + "west": { "texture": "#mechanical_press_pole", "uv": [ 5, 6, 6, 16 ] } + } + }, + { + "name": "Pole2Side", + "from": [ 5, 14, 10 ], + "to": [ 11, 27, 11 ], + "faces": { + "north": { "texture": "#mechanical_press_pole", "uv": [ 0, 0, 6, 13 ] }, + "east": { "texture": "#mechanical_press_pole", "uv": [ 0, 0, 1, 13 ] }, + "south": { "texture": "#mechanical_press_pole", "uv": [ 0, 0, 6, 13 ] }, + "west": { "texture": "#mechanical_press_pole", "uv": [ 5, 0, 6, 13 ] }, + "up": { "texture": "#mechanical_press_pole", "uv": [ 10, 0, 16, 1 ], "rotation": 180 } + } + }, + { + "name": "Pole2Side", + "from": [ 5, 14, 5 ], + "to": [ 11, 27, 6 ], + "faces": { + "north": { "texture": "#mechanical_press_pole", "uv": [ 0, 0, 6, 13 ] }, + "east": { "texture": "#mechanical_press_pole", "uv": [ 0, 0, 1, 13 ] }, + "south": { "texture": "#mechanical_press_pole", "uv": [ 0, 0, 6, 13 ] }, + "west": { "texture": "#mechanical_press_pole", "uv": [ 5, 0, 6, 13 ] }, + "up": { "texture": "#mechanical_press_pole", "uv": [ 10, 5, 16, 6 ], "rotation": 180 } + } + }, + { + "name": "Head", + "from": [ 3, 0, 3 ], + "to": [ 13, 4, 13 ], + "faces": { + "north": { "texture": "#mechanical_press_head", "uv": [ 1, 0, 11, 4 ] }, + "east": { "texture": "#mechanical_press_head", "uv": [ 1, 0, 11, 4 ] }, + "south": { "texture": "#mechanical_press_head", "uv": [ 1, 0, 11, 4 ] }, + "west": { "texture": "#mechanical_press_head", "uv": [ 1, 0, 11, 4 ] }, + "up": { "texture": "#mechanical_press_head", "uv": [ 1, 5, 11, 15 ], "rotation": 180 }, + "down": { "texture": "#mechanical_press_head", "uv": [ 1, 5, 11, 15 ], "rotation": 180 } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/item/propeller.json b/src/main/resources/assets/create/models/item/propeller.json new file mode 100644 index 000000000..aa588a2b3 --- /dev/null +++ b/src/main/resources/assets/create/models/item/propeller.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "create:item/propeller" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/create/textures/block/belt.png b/src/main/resources/assets/create/textures/block/belt.png index d325e29d8..daede5a4f 100644 Binary files a/src/main/resources/assets/create/textures/block/belt.png and b/src/main/resources/assets/create/textures/block/belt.png differ diff --git a/src/main/resources/assets/create/textures/block/belt_animated.png b/src/main/resources/assets/create/textures/block/belt_animated.png index c9504b7f1..225ff7dcc 100644 Binary files a/src/main/resources/assets/create/textures/block/belt_animated.png and b/src/main/resources/assets/create/textures/block/belt_animated.png differ diff --git a/src/main/resources/assets/create/textures/block/belt_support_side.png b/src/main/resources/assets/create/textures/block/belt_support_side.png new file mode 100644 index 000000000..8c4565857 Binary files /dev/null and b/src/main/resources/assets/create/textures/block/belt_support_side.png differ diff --git a/src/main/resources/assets/create/textures/block/brass_casing_side.png b/src/main/resources/assets/create/textures/block/brass_casing_side.png new file mode 100644 index 000000000..f231eb76d Binary files /dev/null and b/src/main/resources/assets/create/textures/block/brass_casing_side.png differ diff --git a/src/main/resources/assets/create/textures/block/flexpeater_item.png b/src/main/resources/assets/create/textures/block/flexpeater_item.png new file mode 100644 index 000000000..c7725b0d4 Binary files /dev/null and b/src/main/resources/assets/create/textures/block/flexpeater_item.png differ diff --git a/src/main/resources/assets/create/textures/block/flexpeater_off.png b/src/main/resources/assets/create/textures/block/flexpeater_off.png new file mode 100644 index 000000000..a5bd9cd36 Binary files /dev/null and b/src/main/resources/assets/create/textures/block/flexpeater_off.png differ diff --git a/src/main/resources/assets/create/textures/block/flexpeater_on.png b/src/main/resources/assets/create/textures/block/flexpeater_on.png new file mode 100644 index 000000000..2d6d50c09 Binary files /dev/null and b/src/main/resources/assets/create/textures/block/flexpeater_on.png differ diff --git a/src/main/resources/assets/create/textures/block/mechanical_press_bottom.png b/src/main/resources/assets/create/textures/block/mechanical_press_bottom.png new file mode 100644 index 000000000..662f783ea Binary files /dev/null and b/src/main/resources/assets/create/textures/block/mechanical_press_bottom.png differ diff --git a/src/main/resources/assets/create/textures/block/mechanical_press_head.png b/src/main/resources/assets/create/textures/block/mechanical_press_head.png new file mode 100644 index 000000000..b3a85575e Binary files /dev/null and b/src/main/resources/assets/create/textures/block/mechanical_press_head.png differ diff --git a/src/main/resources/assets/create/textures/block/mechanical_press_pole.png b/src/main/resources/assets/create/textures/block/mechanical_press_pole.png new file mode 100644 index 000000000..41546ab74 Binary files /dev/null and b/src/main/resources/assets/create/textures/block/mechanical_press_pole.png differ diff --git a/src/main/resources/assets/create/textures/block/mechanical_press_top.png b/src/main/resources/assets/create/textures/block/mechanical_press_top.png new file mode 100644 index 000000000..06b9ed01c Binary files /dev/null and b/src/main/resources/assets/create/textures/block/mechanical_press_top.png differ diff --git a/src/main/resources/assets/create/textures/block/old_belt.png b/src/main/resources/assets/create/textures/block/old_belt.png new file mode 100644 index 000000000..597617acd Binary files /dev/null and b/src/main/resources/assets/create/textures/block/old_belt.png differ diff --git a/src/main/resources/assets/create/textures/item/dough.png b/src/main/resources/assets/create/textures/item/dough.png new file mode 100644 index 000000000..8ebb49701 Binary files /dev/null and b/src/main/resources/assets/create/textures/item/dough.png differ diff --git a/src/main/resources/assets/create/textures/item/flour.png b/src/main/resources/assets/create/textures/item/flour.png new file mode 100644 index 000000000..4656b37e5 Binary files /dev/null and b/src/main/resources/assets/create/textures/item/flour.png differ diff --git a/src/main/resources/assets/create/textures/item/iron_sheet.png b/src/main/resources/assets/create/textures/item/iron_sheet.png new file mode 100644 index 000000000..788f22798 Binary files /dev/null and b/src/main/resources/assets/create/textures/item/iron_sheet.png differ diff --git a/src/main/resources/assets/create/textures/item/propeller.png b/src/main/resources/assets/create/textures/item/propeller.png new file mode 100644 index 000000000..3e80be28c Binary files /dev/null and b/src/main/resources/assets/create/textures/item/propeller.png differ diff --git a/src/main/resources/data/create/loot_tables/blocks/flexpeater.json b/src/main/resources/data/create/loot_tables/blocks/flexpeater.json new file mode 100644 index 000000000..f197c10a5 --- /dev/null +++ b/src/main/resources/data/create/loot_tables/blocks/flexpeater.json @@ -0,0 +1,19 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "create:flexpeater" + } + ], + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/create/loot_tables/blocks/mechanical_press.json b/src/main/resources/data/create/loot_tables/blocks/mechanical_press.json new file mode 100644 index 000000000..8844f26c5 --- /dev/null +++ b/src/main/resources/data/create/loot_tables/blocks/mechanical_press.json @@ -0,0 +1,19 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "create:mechanical_press" + } + ], + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/create/recipes/crafting/dough.json b/src/main/resources/data/create/recipes/crafting/dough.json new file mode 100644 index 000000000..c442e003b --- /dev/null +++ b/src/main/resources/data/create/recipes/crafting/dough.json @@ -0,0 +1,21 @@ +{ + "type": "minecraft:crafting_shapeless", + "ingredients": [ + { + "item": "create:flour" + }, + { + "item": "minecraft:water_bucket" + } + ], + "result": { + "item": "create:dough", + "count": 1 + }, + "conditions": [ + { + "type": "create:module", + "module": "contraptions" + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/create/recipes/crafting/encased_fan.json b/src/main/resources/data/create/recipes/crafting/encased_fan.json index 407e4f33d..ae505f03e 100644 --- a/src/main/resources/data/create/recipes/crafting/encased_fan.json +++ b/src/main/resources/data/create/recipes/crafting/encased_fan.json @@ -13,7 +13,7 @@ "item": "create:andesite_alloy_cube" }, "S": { - "item": "create:shaft" + "item": "create:propeller" }, "R": { "tag": "minecraft:logs" diff --git a/src/main/resources/data/create/recipes/crafting/flexpeater.json b/src/main/resources/data/create/recipes/crafting/flexpeater.json new file mode 100644 index 000000000..1b9a63661 --- /dev/null +++ b/src/main/resources/data/create/recipes/crafting/flexpeater.json @@ -0,0 +1,31 @@ +{ + "type": "crafting_shaped", + "pattern": [ + "RCT", + "SSS" + ], + "key": { + "S": { + "item": "minecraft:stone" + }, + "C": { + "item": "minecraft:clock" + }, + "R": { + "item": "minecraft:redstone" + }, + "T": { + "item": "minecraft:redstone_torch" + } + }, + "result": { + "item": "create:flexpeater", + "count": 1 + }, + "conditions": [ + { + "type": "create:module", + "module": "logistics" + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/create/recipes/crafting/mechanical_press.json b/src/main/resources/data/create/recipes/crafting/mechanical_press.json new file mode 100644 index 000000000..f861310aa --- /dev/null +++ b/src/main/resources/data/create/recipes/crafting/mechanical_press.json @@ -0,0 +1,35 @@ +{ + "type": "crafting_shaped", + "pattern": [ + "APA", + "BCB", + "AIA" + ], + "key": { + "B": { + "tag": "minecraft:planks" + }, + "A": { + "item": "create:andesite_alloy_cube" + }, + "P": { + "item": "create:piston_pole" + }, + "I": { + "item": "minecraft:iron_block" + }, + "C": { + "item": "create:cogwheel" + } + }, + "result": { + "item": "create:mechanical_press", + "count": 1 + }, + "conditions": [ + { + "type": "create:module", + "module": "contraptions" + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/create/recipes/crafting/propeller.json b/src/main/resources/data/create/recipes/crafting/propeller.json new file mode 100644 index 000000000..cd8364a24 --- /dev/null +++ b/src/main/resources/data/create/recipes/crafting/propeller.json @@ -0,0 +1,26 @@ +{ + "type": "crafting_shaped", + "pattern": [ + " I ", + "ISI", + " I " + ], + "key": { + "I": { + "item": "create:iron_sheet" + }, + "S": { + "item": "create:shaft" + } + }, + "result": { + "item": "create:propeller", + "count": 1 + }, + "conditions": [ + { + "type": "create:module", + "module": "contraptions" + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/create/recipes/crushing/wheat.json b/src/main/resources/data/create/recipes/crushing/wheat.json new file mode 100644 index 000000000..810141b3c --- /dev/null +++ b/src/main/resources/data/create/recipes/crushing/wheat.json @@ -0,0 +1,26 @@ +{ + "type": "create:crushing", + "group": "minecraft:misc", + "ingredients": [ + { + "item": "minecraft:wheat" + } + ], + "results": [ + { + "item": "create:flour", + "count": 1 + }, + { + "item": "create:flour", + "count": 2, + "chance": 0.25 + }, + { + "item": "minecraft:wheat_seeds", + "count": 1, + "chance": 0.25 + } + ], + "processingTime": 150 +} \ No newline at end of file diff --git a/src/main/resources/data/create/recipes/pressing/iron_ingot.json b/src/main/resources/data/create/recipes/pressing/iron_ingot.json new file mode 100644 index 000000000..fb403fcef --- /dev/null +++ b/src/main/resources/data/create/recipes/pressing/iron_ingot.json @@ -0,0 +1,16 @@ +{ + "type": "create:pressing", + "group": "minecraft:misc", + "ingredients": [ + { + "item": "minecraft:iron_ingot" + } + ], + "results": [ + { + "item": "create:iron_sheet", + "count": 1 + } + ], + "processingTime": 100 +} \ No newline at end of file diff --git a/src/main/resources/data/create/recipes/smelting/bread.json b/src/main/resources/data/create/recipes/smelting/bread.json new file mode 100644 index 000000000..e06db8c60 --- /dev/null +++ b/src/main/resources/data/create/recipes/smelting/bread.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:smelting", + "ingredient": { + "item": "create:dough" + }, + "result": "minecraft:bread", + "experience": 0.1, + "cookingtime": 200, + "conditions": [ + { + "type": "create:module", + "module": "contraptions" + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/create/recipes/crafting/palettes/dolomite.json b/src/main/resources/data/create/recipes/smelting/dolomite.json similarity index 100% rename from src/main/resources/data/create/recipes/crafting/palettes/dolomite.json rename to src/main/resources/data/create/recipes/smelting/dolomite.json diff --git a/src/main/resources/data/create/recipes/crafting/palettes/gabbro.json b/src/main/resources/data/create/recipes/smelting/gabbro.json similarity index 100% rename from src/main/resources/data/create/recipes/crafting/palettes/gabbro.json rename to src/main/resources/data/create/recipes/smelting/gabbro.json diff --git a/src/main/resources/data/create/recipes/crafting/palettes/limestone.json b/src/main/resources/data/create/recipes/smelting/limestone.json similarity index 100% rename from src/main/resources/data/create/recipes/crafting/palettes/limestone.json rename to src/main/resources/data/create/recipes/smelting/limestone.json diff --git a/src/main/resources/data/create/recipes/splashing/flour.json b/src/main/resources/data/create/recipes/splashing/flour.json new file mode 100644 index 000000000..f9dc10a4d --- /dev/null +++ b/src/main/resources/data/create/recipes/splashing/flour.json @@ -0,0 +1,16 @@ +{ + "type": "create:splashing", + "group": "minecraft:misc", + "ingredients": [ + { + "item": "create:flour" + } + ], + "results": [ + { + "item": "create:dough", + "count": 1 + } + ], + "processingTime": 100 +} \ No newline at end of file