Back to Belt

- Mechanical Belts can now be dyed with any color
- Added the Mechanical Press with a new Pressing recipe type
- Added the belt support, purely decorational
- Added the FlexpeaterTM
- Added some unspectacular ingredients and recipes
This commit is contained in:
simibubi 2019-09-13 18:36:18 +02:00
parent ee46359ce4
commit ca355d1ec3
77 changed files with 1705 additions and 21 deletions

View file

@ -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);
}
}
}
}

View file

@ -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<Item> iForgeRegistry) {
for (AllItems item : values()) {
if (item.get() == null)

View file

@ -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),

View file

@ -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<CrushingRecipe> CRUSHING = register("crushing");
public static IRecipeType<SplashingRecipe> SPLASHING = register("splashing");
public static IRecipeType<PressingRecipe> PRESSING = register("pressing");
static <T extends IRecipe<?>> IRecipeType<T> register(final String key) {
return Registry.register(Registry.RECIPE_TYPE, new ResourceLocation(key), new IRecipeType<T>() {

View file

@ -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)

View file

@ -35,6 +35,7 @@ public class CreateClient {
AllContainers.registerScreenFactories();
AllTileEntities.registerRenderers();
AllItems.registerColorHandlers();
AllBlocks.registerColorHandlers();
}
@SubscribeEvent

View file

@ -0,0 +1,9 @@
package com.simibubi.create.foundation.block;
import net.minecraft.client.renderer.color.IBlockColor;
public interface IBlockWithColorHandler {
public IBlockColor getColorHandler();
}

View file

@ -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);

View file

@ -13,11 +13,11 @@ import net.minecraft.util.Rotation;
public abstract class HorizontalKineticBlock extends KineticBlock {
public static final IProperty<Direction> HORIZONTAL_FACING = BlockStateProperties.HORIZONTAL_FACING;
public HorizontalKineticBlock(Properties properties) {
super(properties);
}
@Override
protected void fillStateContainer(Builder<Block, BlockState> 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)));

View file

@ -80,7 +80,7 @@ public class MotorBlock extends HorizontalKineticBlock
}
@Override
public String getValueName() {
public String getValueName(BlockState state, IWorld world, BlockPos pos) {
return "Speed";
}

View file

@ -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<MechanicalPressTileEntity>, 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<Block, BlockState> builder) {
builder.add(HORIZONTAL_FACING);
super.fillStateContainer(builder);
}
}
@Override
public List<BlockPos> getPotentialAttachmentLocations(BeltTileEntity te) {
return Arrays.asList(te.getPos().up(2));
}
@Override
public Optional<BlockPos> 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;
}
}

View file

@ -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<PressingRecipe> 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++;
}
}

View file

@ -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));
}
}

View file

@ -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<MechanicalPressTileEntity.PressingInv> {
public PressingRecipe(ResourceLocation id, String group, List<Ingredient> ingredients,
List<StochasticOutput> 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));
}
}

View file

@ -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";
}

View file

@ -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";
}

View file

@ -21,6 +21,7 @@ public enum AllBeltAttachments {
BELT_FUNNEL(AllBlocks.BELT_FUNNEL),
BELT_OBSERVER(AllBlocks.ENTITY_DETECTOR),
MECHANICAL_PRESS(AllBlocks.MECHANICAL_PRESS),
;

View file

@ -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<BeltTileEntity> {
@ -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<Block, BlockState> builder) {
builder.add(SLOPE, PART);

View file

@ -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);
}
}

View file

@ -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<Entity, TransportedEntityInfo> 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;
}

View file

@ -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));
}
}

View file

@ -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<FlexpeaterTileEntity> {
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();
}
}

View file

@ -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<FlexpeaterTileEntity>, 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<Block, BlockState> 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;
}
}

View file

@ -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));
}
}
}

View file

@ -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<FlexpeaterTileEntity> {
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));
}
}

View file

@ -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);

View file

@ -0,0 +1,5 @@
{
"variants": {
"": { "model": "create:block/belt_support" }
}
}

View file

@ -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 }
}
}

View file

@ -0,0 +1,5 @@
{
"variants": {
"": { "model": "create:block/flexpeater_indicator" }
}
}

View file

@ -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 }
}
}
}

View file

@ -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 }
}
}
}

View file

@ -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",

View file

@ -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 ] }
}
}
]
}

View file

@ -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 ] }
}
}
]
}

View file

@ -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 ] }
}
}
]
}

View file

@ -0,0 +1,7 @@
{
"parent": "create:block/flexpeater",
"textures": {
"flexpeater_off": "create:block/flexpeater_on",
"particle": "create:block/flexpeater_on"
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "create:block/flexpeater_powered",
"textures": {
"torch": "minecraft:block/redstone_torch"
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "create:block/flexpeater",
"textures": {
"torch": "minecraft:block/redstone_torch"
}
}

View file

@ -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 ] }
}
}
]
}

View file

@ -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 }
}
}
]
}

View file

@ -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 ]
}
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "create:item/dough"
}
}

View file

@ -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 ]
}
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "create:item/flour"
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "create:item/iron_sheet"
}
}

View file

@ -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 }
}
}
]
}

View file

@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "create:item/propeller"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 322 B

After

Width:  |  Height:  |  Size: 385 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 491 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 486 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 527 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 526 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 529 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 549 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 462 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 542 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 528 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 345 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 348 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 448 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 382 B

View file

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

View file

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

View file

@ -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"
}
]
}

View file

@ -13,7 +13,7 @@
"item": "create:andesite_alloy_cube"
},
"S": {
"item": "create:shaft"
"item": "create:propeller"
},
"R": {
"tag": "minecraft:logs"

View file

@ -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"
}
]
}

View file

@ -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"
}
]
}

View file

@ -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"
}
]
}

View file

@ -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
}

View file

@ -0,0 +1,16 @@
{
"type": "create:pressing",
"group": "minecraft:misc",
"ingredients": [
{
"item": "minecraft:iron_ingot"
}
],
"results": [
{
"item": "create:iron_sheet",
"count": 1
}
],
"processingTime": 100
}

View file

@ -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"
}
]
}

View file

@ -0,0 +1,16 @@
{
"type": "create:splashing",
"group": "minecraft:misc",
"ingredients": [
{
"item": "create:flour"
}
],
"results": [
{
"item": "create:dough",
"count": 1
}
],
"processingTime": 100
}