A Better Belt Support

- Logistical Casing can now be used on belts to add casing around it
- Casings on belts allow for extractors and funnels to be attached to the belts directly
- Voxelshapers can now transform multipart shapes
This commit is contained in:
simibubi 2019-11-15 21:34:00 +01:00
parent e5c78fbd04
commit d85a8e2a49
19 changed files with 867 additions and 157 deletions

View file

@ -91,6 +91,19 @@ public abstract class BufferManipulator {
buffer.put(bufferPosition + 15, a);
}
public ByteBuffer getTranslated(float xIn, float yIn, float zIn, 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,
getZ(original, vertex) + zIn);
putLight(mutable, vertex, packedLightCoords);
}
return mutable;
}
public static ByteBuffer remanipulateBuffer(ByteBuffer buffer, float x, float y, float z, float xOrigin,
float yOrigin, float zOrigin, float yaw, float pitch) {
buffer.rewind();

View file

@ -3,11 +3,15 @@ package com.simibubi.create.foundation.utility;
import java.util.HashMap;
import java.util.Map;
import org.apache.commons.lang3.mutable.MutableObject;
import net.minecraft.block.Block;
import net.minecraft.util.Direction;
import net.minecraft.util.Direction.Axis;
import net.minecraft.util.Direction.AxisDirection;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.math.shapes.VoxelShape;
import net.minecraft.util.math.shapes.VoxelShapes;
public class VoxelShaper {
@ -17,7 +21,11 @@ public class VoxelShaper {
return shapes.get(direction);
}
public static VoxelShaper forHorizontalBlock(VoxelShape southShape) {
public VoxelShape get(Axis axis) {
return shapes.get(axisAsFace(axis));
}
public static VoxelShaper forHorizontal(VoxelShape southShape) {
VoxelShaper voxelShaper = new VoxelShaper();
for (Direction facing : Direction.values()) {
if (facing.getAxis().isVertical())
@ -27,7 +35,27 @@ public class VoxelShaper {
return voxelShaper;
}
public static VoxelShaper forDirectionalBlock(VoxelShape southShape) {
public static VoxelShaper forHorizontalAxis(VoxelShape zShape) {
VoxelShaper voxelShaper = new VoxelShaper();
for (Axis axis : Axis.values()) {
if (axis.isVertical())
continue;
Direction facing = axisAsFace(axis);
voxelShaper.shapes.put(facing, rotatedCopy(zShape, 0, (int) -facing.getHorizontalAngle()));
}
return voxelShaper;
}
public static VoxelShaper forRotatedPillar(VoxelShape zShape) {
VoxelShaper voxelShaper = new VoxelShaper();
for (Axis axis : Axis.values()) {
Direction facing = axisAsFace(axis);
voxelShaper.shapes.put(facing, rotatedCopy(zShape, 0, (int) -facing.getHorizontalAngle()));
}
return voxelShaper;
}
public static VoxelShaper forDirectional(VoxelShape southShape) {
VoxelShaper voxelShaper = new VoxelShaper();
for (Direction facing : Direction.values()) {
int rotX = facing.getAxis().isVertical() ? (facing == Direction.UP ? 270 : 90) : 0;
@ -43,19 +71,28 @@ public class VoxelShaper {
return this;
}
public static VoxelShape rotatedCopy(VoxelShape shape, int rotX, int rotY) {
Vec3d center = new Vec3d(8, 8, 8);
Vec3d v1 = new Vec3d(shape.getStart(Axis.X), shape.getStart(Axis.Y), shape.getStart(Axis.Z)).scale(16)
.subtract(center);
Vec3d v2 = new Vec3d(shape.getEnd(Axis.X), shape.getEnd(Axis.Y), shape.getEnd(Axis.Z)).scale(16)
.subtract(center);
private static Direction axisAsFace(Axis axis) {
return Direction.getFacingFromAxis(AxisDirection.POSITIVE, axis);
}
v1 = VecHelper.rotate(v1, rotX, Axis.X);
v1 = VecHelper.rotate(v1, rotY, Axis.Y).add(center);
v2 = VecHelper.rotate(v2, rotX, Axis.X);
v2 = VecHelper.rotate(v2, rotY, Axis.Y).add(center);
private static VoxelShape rotatedCopy(VoxelShape shape, int rotX, int rotY) {
MutableObject<VoxelShape> result = new MutableObject<>(VoxelShapes.empty());
return Block.makeCuboidShape(v1.x, v1.y, v1.z, v2.x, v2.y, v2.z);
shape.forEachBox((x1, y1, z1, x2, y2, z2) -> {
Vec3d center = new Vec3d(8, 8, 8);
Vec3d v1 = new Vec3d(x1, y1, z1).scale(16).subtract(center);
Vec3d v2 = new Vec3d(x2, y2, z2).scale(16).subtract(center);
v1 = VecHelper.rotate(v1, rotX, Axis.X);
v1 = VecHelper.rotate(v1, rotY, Axis.Y).add(center);
v2 = VecHelper.rotate(v2, rotX, Axis.X);
v2 = VecHelper.rotate(v2, rotY, Axis.Y).add(center);
VoxelShape rotated = Block.makeCuboidShape(v1.x, v1.y, v1.z, v2.x, v2.y, v2.z);
result.setValue(VoxelShapes.or(result.getValue(), rotated));
});
return result.getValue();
}
}

View file

@ -5,6 +5,6 @@ import net.minecraft.block.Block;
public class VoxelShapers {
public static final VoxelShaper SHORT_CASING = VoxelShaper
.forDirectionalBlock(Block.makeCuboidShape(0, 0, 0, 16, 16, 12));
.forDirectional(Block.makeCuboidShape(0, 0, 0, 16, 16, 12));
}

View file

@ -39,7 +39,7 @@ import net.minecraftforge.common.IPlantable;
public class HarvesterBlock extends HorizontalBlock implements IHaveMovementBehavior {
private static VoxelShaper SHAPER = VoxelShaper.forHorizontalBlock(Block.makeCuboidShape(0, 2, 0, 16, 14, 3));
private static VoxelShaper SHAPER = VoxelShaper.forHorizontal(Block.makeCuboidShape(0, 2, 0, 16, 14, 3));
public HarvesterBlock() {
super(Properties.from(Blocks.IRON_BLOCK));

View file

@ -15,16 +15,21 @@ import com.simibubi.create.modules.contraptions.relays.belt.BeltMovementHandler.
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.ItemEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.DyeColor;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemUseContext;
import net.minecraft.state.BooleanProperty;
import net.minecraft.state.EnumProperty;
import net.minecraft.state.IProperty;
import net.minecraft.state.StateContainer.Builder;
import net.minecraft.state.properties.BlockStateProperties;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ActionResultType;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.Direction;
import net.minecraft.util.Direction.Axis;
import net.minecraft.util.Direction.AxisDirection;
@ -35,6 +40,7 @@ import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.util.math.RayTraceResult;
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;
import net.minecraft.world.World;
import net.minecraftforge.common.Tags;
@ -45,10 +51,11 @@ public class BeltBlock extends HorizontalKineticBlock implements IWithoutBlockIt
public static final IProperty<Slope> SLOPE = EnumProperty.create("slope", Slope.class);
public static final IProperty<Part> PART = EnumProperty.create("part", Part.class);
public static final BooleanProperty CASING = BooleanProperty.create("casing");
public BeltBlock() {
super(Properties.from(Blocks.BROWN_WOOL));
setDefaultState(getDefaultState().with(SLOPE, Slope.HORIZONTAL).with(PART, Part.START));
setDefaultState(getDefaultState().with(SLOPE, Slope.HORIZONTAL).with(PART, Part.START).with(CASING, false));
}
@Override
@ -70,6 +77,16 @@ public class BeltBlock extends HorizontalKineticBlock implements IWithoutBlockIt
return AllItems.BELT_CONNECTOR.asStack();
}
@Override
public Material getMaterial(BlockState state) {
return state.get(CASING) ? Material.WOOD : Material.WOOL;
}
@Override
public boolean isFlammable(BlockState state, IBlockReader world, BlockPos pos, Direction face) {
return false;
}
@Override
public void onLanded(IBlockReader worldIn, Entity entityIn) {
super.onLanded(worldIn, entityIn);
@ -139,26 +156,9 @@ public class BeltBlock extends HorizontalKineticBlock implements IWithoutBlockIt
return false;
ItemStack heldItem = player.getHeldItem(handIn);
boolean isShaft = heldItem.getItem() == AllBlocks.SHAFT.get().asItem();
boolean isCasing = heldItem.getItem() == AllBlocks.LOGISTICAL_CASING.get().asItem();
boolean isDye = Tags.Items.DYES.contains(heldItem.getItem());
if (isShaft) {
TileEntity te = worldIn.getTileEntity(pos);
if (te == null || !(te instanceof BeltTileEntity))
return false;
BeltTileEntity belt = (BeltTileEntity) te;
if (belt.hasPulley())
return false;
if (worldIn.isRemote)
return true;
if (!player.isCreative())
heldItem.shrink(1);
belt.hasPulley = true;
belt.markDirty();
belt.sendData();
belt.attachKinetics();
return true;
}
if (isDye) {
if (worldIn.isRemote)
return true;
@ -173,12 +173,72 @@ public class BeltBlock extends HorizontalKineticBlock implements IWithoutBlockIt
return true;
}
TileEntity te = worldIn.getTileEntity(pos);
if (te == null || !(te instanceof BeltTileEntity))
return false;
BeltTileEntity belt = (BeltTileEntity) te;
if (isShaft) {
if (state.get(PART) != Part.MIDDLE)
return false;
if (worldIn.isRemote)
return true;
if (!player.isCreative())
heldItem.shrink(1);
worldIn.setBlockState(pos, state.with(PART, Part.PULLEY), 2);
belt.attachKinetics();
return true;
}
if (isCasing) {
if (state.get(CASING))
return false;
if (state.get(SLOPE) == Slope.VERTICAL)
return false;
if (!player.isCreative())
heldItem.shrink(1);
worldIn.setBlockState(pos, state.with(CASING, true), 2);
return true;
}
return false;
}
@Override
public ActionResultType onWrenched(BlockState state, ItemUseContext context) {
World world = context.getWorld();
TileEntity te = world.getTileEntity(context.getPos());
if (te == null || !(te instanceof BeltTileEntity))
return ActionResultType.PASS;
BeltTileEntity belt = (BeltTileEntity) te;
PlayerEntity player = context.getPlayer();
if (state.get(CASING)) {
if (world.isRemote)
return ActionResultType.SUCCESS;
world.setBlockState(context.getPos(), state.with(CASING, false), 2);
if (!player.isCreative())
player.inventory.placeItemBackInInventory(world, new ItemStack(AllBlocks.LOGISTICAL_CASING.block));
return ActionResultType.SUCCESS;
}
if (state.get(PART) == Part.PULLEY) {
if (world.isRemote)
return ActionResultType.SUCCESS;
world.setBlockState(context.getPos(), state.with(PART, Part.MIDDLE), 2);
belt.detachKinetics();
belt.attachKinetics();
if (!player.isCreative())
player.inventory.placeItemBackInInventory(world, new ItemStack(AllBlocks.SHAFT.block));
return ActionResultType.SUCCESS;
}
return super.onWrenched(state, context);
}
@Override
protected void fillStateContainer(Builder<Block, BlockState> builder) {
builder.add(SLOPE, PART);
builder.add(SLOPE, PART, CASING);
super.fillStateContainer(builder);
}
@ -189,7 +249,7 @@ public class BeltBlock extends HorizontalKineticBlock implements IWithoutBlockIt
@Override
public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) {
return BeltShapes.getShape(state, worldIn, pos, context);
return VoxelShapes.or(BeltShapes.getShape(state), BeltShapes.getCasingShape(state));
}
@Override
@ -198,8 +258,8 @@ public class BeltBlock extends HorizontalKineticBlock implements IWithoutBlockIt
}
@Override
protected boolean hasStaticPart() {
return false;
public boolean canRenderInLayer(BlockState state, BlockRenderLayer layer) {
return state.get(CASING) && layer == getRenderLayer();
}
@Override
@ -222,6 +282,8 @@ public class BeltBlock extends HorizontalKineticBlock implements IWithoutBlockIt
public void onReplaced(BlockState state, World worldIn, BlockPos pos, BlockState newState, boolean isMoving) {
if (worldIn.isRemote)
return;
if (state.getBlock() == newState.getBlock())
return;
boolean endWasDestroyed = state.get(PART) == Part.END;
TileEntity tileEntity = worldIn.getTileEntity(pos);
@ -294,7 +356,7 @@ public class BeltBlock extends HorizontalKineticBlock implements IWithoutBlockIt
}
public enum Part implements IStringSerializable {
START, MIDDLE, END;
START, MIDDLE, END, PULLEY;
@Override
public String getName() {
@ -333,4 +395,34 @@ public class BeltBlock extends HorizontalKineticBlock implements IWithoutBlockIt
return positions;
}
@Override
protected boolean hasStaticPart() {
return false;
}
public static boolean canAccessFromSide(Direction facing, BlockState belt) {
if (facing == null)
return true;
if (!belt.get(BeltBlock.CASING))
return false;
Part part = belt.get(BeltBlock.PART);
if (part != Part.MIDDLE && facing.getAxis() == belt.get(HORIZONTAL_FACING).rotateY().getAxis())
return false;
Slope slope = belt.get(BeltBlock.SLOPE);
if (slope != Slope.HORIZONTAL) {
if (slope == Slope.DOWNWARD && part == Part.END)
return true;
if (slope == Slope.UPWARD && part == Part.START)
return true;
Direction beltSide = belt.get(HORIZONTAL_FACING);
if (slope == Slope.DOWNWARD)
beltSide = beltSide.getOpposite();
if (beltSide == facing)
return false;
}
return true;
}
}

View file

@ -100,6 +100,8 @@ public class BeltConnectorItem extends Item {
for (BlockPos pos : beltsToCreate) {
BeltBlock.Part part = pos.equals(start) ? Part.START : pos.equals(end) ? Part.END : Part.MIDDLE;
boolean pulley = AllBlocks.SHAFT.typeOf(world.getBlockState(pos));
if (part == Part.MIDDLE && pulley)
part = Part.PULLEY;
world.setBlockState(pos, beltBlock.with(BeltBlock.SLOPE, slope).with(BeltBlock.PART, part)
.with(BeltBlock.HORIZONTAL_FACING, facing), 3);
@ -108,7 +110,6 @@ public class BeltConnectorItem extends Item {
te.setController(start);
te.beltLength = beltsToCreate.size();
te.index = index;
te.hasPulley = pulley;
}
index++;

View file

@ -2,90 +2,89 @@ package com.simibubi.create.modules.contraptions.relays.belt;
import static net.minecraft.block.Block.makeCuboidShape;
import com.simibubi.create.foundation.utility.VoxelShaper;
import com.simibubi.create.modules.contraptions.relays.belt.BeltBlock.Part;
import com.simibubi.create.modules.contraptions.relays.belt.BeltBlock.Slope;
import net.minecraft.block.BlockState;
import net.minecraft.util.Direction;
import net.minecraft.util.Direction.Axis;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3i;
import net.minecraft.util.math.shapes.IBooleanFunction;
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 BeltShapes {
private static final VoxelShape FULL = makeCuboidShape(0, 0, 0, 16, 16, 16),
FLAT_STRAIGHT_X = makeCuboidShape(1, 3, 0, 15, 13, 16),
FLAT_STRAIGHT_Z = makeCuboidShape(0, 3, 1, 16, 13, 15),
VERTICAL_STRAIGHT_X = makeCuboidShape(3, 0, 1, 13, 16, 15),
VERTICAL_STRAIGHT_Z = makeCuboidShape(1, 0, 3, 15, 16, 13),
SLOPE_END_EAST = makeCuboidShape(0, 3, 1, 10, 13, 15),
SLOPE_END_WEST = makeCuboidShape(6, 3, 1, 16, 13, 15),
SLOPE_END_SOUTH = makeCuboidShape(1, 3, 0, 15, 13, 10),
SLOPE_END_NORTH = makeCuboidShape(1, 3, 6, 15, 13, 16),
SLOPE_BUILDING_BLOCK_X = makeCuboidShape(5, 5, 1, 11, 11, 15),
private static final VoxelShape SLOPE_BUILDING_BLOCK_X = makeCuboidShape(5, 5, 1, 11, 11, 15),
SLOPE_BUILDING_BLOCK_Z = makeCuboidShape(1, 5, 5, 15, 11, 11),
CASING_HORIZONTAL = makeCuboidShape(0, 0, 0, 16, 11, 16);
SLOPE_UPWARD_END_EAST = VoxelShapes.or(SLOPE_END_EAST, createHalfSlope(Direction.EAST, false)),
SLOPE_UPWARD_END_WEST = VoxelShapes.or(SLOPE_END_WEST, createHalfSlope(Direction.WEST, false)),
SLOPE_UPWARD_END_SOUTH = VoxelShapes.or(SLOPE_END_SOUTH, createHalfSlope(Direction.SOUTH, false)),
SLOPE_UPWARD_END_NORTH = VoxelShapes.or(SLOPE_END_NORTH, createHalfSlope(Direction.NORTH, false)),
private static final VoxelShaper SLOPE_END = VoxelShaper.forHorizontal(makeCuboidShape(1, 3, 0, 15, 13, 10)),
SLOPE_TOP_END = VoxelShaper.forHorizontal(
VoxelShapes.or(SLOPE_END.get(Direction.SOUTH), createHalfSlope(Direction.SOUTH, false))),
SLOPE_BOTTOM_END = VoxelShaper.forHorizontal(
VoxelShapes.or(SLOPE_END.get(Direction.SOUTH), createHalfSlope(Direction.SOUTH, true))),
FLAT_STRAIGHT = VoxelShaper.forHorizontalAxis(makeCuboidShape(0, 3, 1, 16, 13, 15)),
VERTICAL_STRAIGHT = VoxelShaper.forHorizontalAxis(makeCuboidShape(1, 0, 3, 15, 16, 13)),
SLOPE_STRAIGHT = VoxelShaper.forHorizontal(createSlope(Direction.SOUTH)),
CASING_TOP_END = VoxelShaper.forHorizontal(makeCuboidShape(0, 0, 0, 16, 11, 11));
SLOPE_DOWNWARD_END_EAST = VoxelShapes.or(SLOPE_END_EAST, createHalfSlope(Direction.EAST, true)),
SLOPE_DOWNWARD_END_WEST = VoxelShapes.or(SLOPE_END_WEST, createHalfSlope(Direction.WEST, true)),
SLOPE_DOWNWARD_END_SOUTH = VoxelShapes.or(SLOPE_END_SOUTH, createHalfSlope(Direction.SOUTH, true)),
SLOPE_DOWNWARD_END_NORTH = VoxelShapes.or(SLOPE_END_NORTH, createHalfSlope(Direction.NORTH, true)),
SLOPE_EAST = createSlope(Direction.EAST), SLOPE_WEST = createSlope(Direction.WEST),
SLOPE_NORTH = createSlope(Direction.NORTH), SLOPE_SOUTH = createSlope(Direction.SOUTH);
public static VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) {
public static VoxelShape getShape(BlockState state) {
Direction facing = state.get(BeltBlock.HORIZONTAL_FACING);
Axis axis = facing.getAxis();
Axis perpendicularAxis = facing.rotateY().getAxis();
Part part = state.get(BeltBlock.PART);
Slope slope = state.get(BeltBlock.SLOPE);
if (slope == Slope.HORIZONTAL)
return axis == Axis.Z ? FLAT_STRAIGHT_X : FLAT_STRAIGHT_Z;
return FLAT_STRAIGHT.get(perpendicularAxis);
if (slope == Slope.VERTICAL)
return axis == Axis.X ? VERTICAL_STRAIGHT_X : VERTICAL_STRAIGHT_Z;
return VERTICAL_STRAIGHT.get(axis);
if (part != Part.MIDDLE) {
boolean upward = slope == Slope.UPWARD;
if (part == Part.START)
slope = upward ? Slope.DOWNWARD : Slope.UPWARD;
upward = !upward;
else
facing = facing.getOpposite();
if (facing == Direction.NORTH)
return upward ? SLOPE_UPWARD_END_NORTH : SLOPE_DOWNWARD_END_NORTH;
if (facing == Direction.SOUTH)
return upward ? SLOPE_UPWARD_END_SOUTH : SLOPE_DOWNWARD_END_SOUTH;
if (facing == Direction.EAST)
return upward ? SLOPE_UPWARD_END_EAST : SLOPE_DOWNWARD_END_EAST;
if (facing == Direction.WEST)
return upward ? SLOPE_UPWARD_END_WEST : SLOPE_DOWNWARD_END_WEST;
return upward ? SLOPE_TOP_END.get(facing) : SLOPE_BOTTOM_END.get(facing);
}
if (slope == Slope.DOWNWARD)
facing = facing.getOpposite();
if (facing == Direction.NORTH)
return SLOPE_NORTH;
if (facing == Direction.SOUTH)
return SLOPE_SOUTH;
if (facing == Direction.EAST)
return SLOPE_EAST;
if (facing == Direction.WEST)
return SLOPE_WEST;
return SLOPE_STRAIGHT.get(facing);
}
return FULL;
public static VoxelShape getCasingShape(BlockState state) {
if (!state.get(BeltBlock.CASING))
return VoxelShapes.empty();
Direction facing = state.get(BeltBlock.HORIZONTAL_FACING);
Part part = state.get(BeltBlock.PART);
Slope slope = state.get(BeltBlock.SLOPE);
if (slope == Slope.HORIZONTAL)
return CASING_HORIZONTAL;
if (slope == Slope.VERTICAL)
return VoxelShapes.empty();
if (part != Part.MIDDLE) {
boolean upward = slope == Slope.UPWARD;
if (part == Part.START)
upward = !upward;
else
facing = facing.getOpposite();
return upward ? CASING_TOP_END.get(facing) : CASING_HORIZONTAL;
}
if (slope == Slope.DOWNWARD)
facing = facing.getOpposite();
return CASING_TOP_END.get(facing.getOpposite());
}
protected static VoxelShape createSlope(Direction facing) {

View file

@ -48,7 +48,6 @@ public class BeltTileEntity extends KineticTileEntity {
public int color;
public int beltLength;
public int index;
public boolean hasPulley;
protected BlockPos controller;
protected BeltInventory inventory;
@ -132,8 +131,11 @@ public class BeltTileEntity extends KineticTileEntity {
@Override
public <T> LazyOptional<T> getCapability(Capability<T> cap, Direction side) {
if (cap == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY)
return itemHandler.cast();
if (cap == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) {
if (side == Direction.UP || BeltBlock.canAccessFromSide(side, getBlockState())) {
return itemHandler.cast();
}
}
return super.getCapability(cap, side);
}
@ -150,7 +152,6 @@ public class BeltTileEntity extends KineticTileEntity {
compound.putInt("Color", color);
compound.putInt("Length", beltLength);
compound.putInt("Index", index);
compound.putBoolean("Pulley", hasPulley);
if (isController())
compound.put("Inventory", getInventory().write());
@ -164,7 +165,6 @@ public class BeltTileEntity extends KineticTileEntity {
color = compound.getInt("Color");
beltLength = compound.getInt("Length");
index = compound.getInt("Index");
hasPulley = compound.getBoolean("Pulley");
if (isController())
getInventory().read(compound.getCompound("Inventory"));
@ -209,8 +209,7 @@ public class BeltTileEntity extends KineticTileEntity {
public boolean hasPulley() {
if (!AllBlocks.BELT.typeOf(getBlockState()))
return false;
Part part = getBlockState().get(BeltBlock.PART);
return part == END || part == Part.START || hasPulley;
return getBlockState().get(BeltBlock.PART) != Part.MIDDLE;
}
protected boolean isLastBelt() {

View file

@ -83,7 +83,7 @@ public class BeltTileEntityRenderer extends TileEntityRenderer<BeltTileEntity> {
itemRenderer.renderItem(transported.stack, TransformType.FIXED);
GlStateManager.popMatrix();
GlStateManager.rotated(10, 0, 1, 0);
GlStateManager.translated(0, 1/16d, 0);
GlStateManager.translated(0, 1 / 16d, 0);
}
RenderHelper.disableStandardItemLighting();
@ -108,7 +108,8 @@ public class BeltTileEntityRenderer extends TileEntityRenderer<BeltTileEntity> {
axis, angle);
}
KineticTileEntityRenderer.cacheIfMissing(te.getBlockState(), getWorld(), BeltModelAnimator::new);
KineticTileEntityRenderer.cacheIfMissing(te.getBlockState().with(BeltBlock.CASING, false), getWorld(),
BeltModelAnimator::new);
renderBeltFromCache(te, (float) x, (float) y, (float) z, buffer);
}
@ -118,7 +119,7 @@ public class BeltTileEntityRenderer extends TileEntityRenderer<BeltTileEntity> {
}
public void renderBeltFromCache(BeltTileEntity te, float x, float y, float z, BufferBuilder buffer) {
buffer.putBulkData(((BeltModelAnimator) KineticTileEntityRenderer.cachedBuffers.get(te.getBlockState()))
.getTransformed(te, x, y, z, te.color));
buffer.putBulkData(((BeltModelAnimator) KineticTileEntityRenderer.cachedBuffers
.get(te.getBlockState().with(BeltBlock.CASING, false))).getTransformed(te, x, y, z, te.color));
}
}

View file

@ -3,10 +3,12 @@ package com.simibubi.create.modules.logistics.block.belts;
import java.util.Arrays;
import java.util.List;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.foundation.block.IWithTileEntity;
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.BeltInventory.TransportedItemStack;
import com.simibubi.create.modules.contraptions.relays.belt.BeltBlock;
import com.simibubi.create.modules.contraptions.relays.belt.BeltTileEntity;
import com.simibubi.create.modules.logistics.block.IInventoryManipulator;
@ -70,6 +72,11 @@ public class BeltFunnelBlock extends HorizontalBlock implements IBeltAttachment,
public boolean isValidPosition(BlockState state, IWorldReader worldIn, BlockPos pos) {
BlockPos neighbourPos = pos.offset(state.get(HORIZONTAL_FACING));
BlockState neighbour = worldIn.getBlockState(neighbourPos);
if (AllBlocks.BELT.typeOf(neighbour)) {
return BeltBlock.canAccessFromSide(state.get(HORIZONTAL_FACING), neighbour);
}
return !neighbour.getShape(worldIn, pos).isEmpty();
}

View file

@ -3,7 +3,9 @@ package com.simibubi.create.modules.logistics.block.belts;
import java.util.ArrayList;
import java.util.List;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.foundation.utility.VecHelper;
import com.simibubi.create.modules.contraptions.relays.belt.BeltBlock;
import com.simibubi.create.modules.logistics.block.IBlockWithFilter;
import com.simibubi.create.modules.logistics.block.IExtractor;
@ -91,11 +93,17 @@ public class ExtractorBlock extends HorizontalBlock implements IBlockWithFilter
@Override
public boolean isValidPosition(BlockState state, IWorldReader worldIn, BlockPos pos) {
BlockPos neighbourPos = pos.offset(state.get(HORIZONTAL_FACING));
Direction facing = state.get(HORIZONTAL_FACING);
BlockPos neighbourPos = pos.offset(facing);
BlockState neighbour = worldIn.getBlockState(neighbourPos);
if (AllBlocks.BELT.typeOf(neighbour)) {
return BeltBlock.canAccessFromSide(facing, neighbour);
}
return !neighbour.getShape(worldIn, pos).isEmpty();
}
@Override
public void onNeighborChange(BlockState state, IWorldReader world, BlockPos pos, BlockPos neighbor) {
if (world.isRemote())
@ -121,7 +129,7 @@ public class ExtractorBlock extends HorizontalBlock implements IBlockWithFilter
boolean isMoving) {
if (worldIn.isRemote)
return;
Direction blockFacing = state.get(HORIZONTAL_FACING);
if (fromPos.equals(pos.offset(blockFacing))) {
if (!isValidPosition(state, worldIn, pos)) {

View file

@ -1,75 +1,175 @@
{
"forgemarker": 1,
"defaults": {
"model": "create:block/belt/horizontal_middle"
},
"variants": {
"slope=horizontal,part=start,facing=north": { "model": "create:block/belt/horizontal_end", "x": 0, "y": 180 },
"slope=horizontal,part=start,facing=south": { "model": "create:block/belt/horizontal_end", "x": 0, "y": 0 },
"slope=horizontal,part=start,facing=east": { "model": "create:block/belt/horizontal_end", "x": 0, "y": 270 },
"slope=horizontal,part=start,facing=west": { "model": "create:block/belt/horizontal_end", "x": 0, "y": 90 },
"casing=false,slope=horizontal,part=start,facing=north": { "model": "create:block/belt/horizontal_end", "x": 0, "y": 180 },
"casing=false,slope=horizontal,part=start,facing=south": { "model": "create:block/belt/horizontal_end", "x": 0, "y": 0 },
"casing=false,slope=horizontal,part=start,facing=east": { "model": "create:block/belt/horizontal_end", "x": 0, "y": 270 },
"casing=false,slope=horizontal,part=start,facing=west": { "model": "create:block/belt/horizontal_end", "x": 0, "y": 90 },
"slope=horizontal,part=middle,facing=north": { "model": "create:block/belt/horizontal_middle", "x": 0, "y": 180 },
"slope=horizontal,part=middle,facing=south": { "model": "create:block/belt/horizontal_middle", "x": 0, "y": 0 },
"slope=horizontal,part=middle,facing=east": { "model": "create:block/belt/horizontal_middle", "x": 0, "y": 270 },
"slope=horizontal,part=middle,facing=west": { "model": "create:block/belt/horizontal_middle", "x": 0, "y": 90 },
"casing=false,slope=horizontal,part=middle,facing=north": { "model": "create:block/belt/horizontal_middle", "x": 0, "y": 180 },
"casing=false,slope=horizontal,part=middle,facing=south": { "model": "create:block/belt/horizontal_middle", "x": 0, "y": 0 },
"casing=false,slope=horizontal,part=middle,facing=east": { "model": "create:block/belt/horizontal_middle", "x": 0, "y": 270 },
"casing=false,slope=horizontal,part=middle,facing=west": { "model": "create:block/belt/horizontal_middle", "x": 0, "y": 90 },
"slope=horizontal,part=end,facing=north": { "model": "create:block/belt/horizontal_start", "x": 0, "y": 180 },
"slope=horizontal,part=end,facing=south": { "model": "create:block/belt/horizontal_start", "x": 0, "y": 0 },
"slope=horizontal,part=end,facing=east": { "model": "create:block/belt/horizontal_start", "x": 0, "y": 270 },
"slope=horizontal,part=end,facing=west": { "model": "create:block/belt/horizontal_start", "x": 0, "y": 90 },
"casing=false,slope=horizontal,part=end,facing=north": { "model": "create:block/belt/horizontal_start", "x": 0, "y": 180 },
"casing=false,slope=horizontal,part=end,facing=south": { "model": "create:block/belt/horizontal_start", "x": 0, "y": 0 },
"casing=false,slope=horizontal,part=end,facing=east": { "model": "create:block/belt/horizontal_start", "x": 0, "y": 270 },
"casing=false,slope=horizontal,part=end,facing=west": { "model": "create:block/belt/horizontal_start", "x": 0, "y": 90 },
"casing=false,slope=horizontal,part=pulley,facing=north": { "model": "create:block/belt/horizontal_middle", "x": 0, "y": 180 },
"casing=false,slope=horizontal,part=pulley,facing=south": { "model": "create:block/belt/horizontal_middle", "x": 0, "y": 0 },
"casing=false,slope=horizontal,part=pulley,facing=east": { "model": "create:block/belt/horizontal_middle", "x": 0, "y": 270 },
"casing=false,slope=horizontal,part=pulley,facing=west": { "model": "create:block/belt/horizontal_middle", "x": 0, "y": 90 },
"casing=false,slope=vertical,part=end,facing=north": { "model": "create:block/belt/horizontal_end", "x": 90, "y": 180 },
"casing=false,slope=vertical,part=end,facing=south": { "model": "create:block/belt/horizontal_start", "x": 90, "y": 0 },
"casing=false,slope=vertical,part=end,facing=east": { "model": "create:block/belt/horizontal_start", "x": 90, "y": 270 },
"casing=false,slope=vertical,part=end,facing=west": { "model": "create:block/belt/horizontal_end", "x": 90, "y": 90 },
"slope=vertical,part=end,facing=north": { "model": "create:block/belt/horizontal_end", "x": 90, "y": 180 },
"slope=vertical,part=end,facing=south": { "model": "create:block/belt/horizontal_start", "x": 90, "y": 0 },
"slope=vertical,part=end,facing=east": { "model": "create:block/belt/horizontal_start", "x": 90, "y": 270 },
"slope=vertical,part=end,facing=west": { "model": "create:block/belt/horizontal_end", "x": 90, "y": 90 },
"slope=vertical,part=middle,facing=north": { "model": "create:block/belt/horizontal_middle", "x": 90, "y": 180 },
"slope=vertical,part=middle,facing=south": { "model": "create:block/belt/horizontal_middle", "x": 90, "y": 0 },
"slope=vertical,part=middle,facing=east": { "model": "create:block/belt/horizontal_middle", "x": 90, "y": 270 },
"slope=vertical,part=middle,facing=west": { "model": "create:block/belt/horizontal_middle", "x": 90, "y": 90 },
"slope=vertical,part=start,facing=north": { "model": "create:block/belt/horizontal_start", "x": 90, "y": 180 },
"slope=vertical,part=start,facing=south": { "model": "create:block/belt/horizontal_end", "x": 90, "y": 0 },
"slope=vertical,part=start,facing=east": { "model": "create:block/belt/horizontal_end", "x": 90, "y": 270 },
"slope=vertical,part=start,facing=west": { "model": "create:block/belt/horizontal_start", "x": 90, "y": 90 },
"casing=false,slope=vertical,part=middle,facing=north": { "model": "create:block/belt/horizontal_middle", "x": 90, "y": 180 },
"casing=false,slope=vertical,part=middle,facing=south": { "model": "create:block/belt/horizontal_middle", "x": 90, "y": 0 },
"casing=false,slope=vertical,part=middle,facing=east": { "model": "create:block/belt/horizontal_middle", "x": 90, "y": 270 },
"casing=false,slope=vertical,part=middle,facing=west": { "model": "create:block/belt/horizontal_middle", "x": 90, "y": 90 },
"casing=false,slope=vertical,part=start,facing=north": { "model": "create:block/belt/horizontal_start", "x": 90, "y": 180 },
"casing=false,slope=vertical,part=start,facing=south": { "model": "create:block/belt/horizontal_end", "x": 90, "y": 0 },
"casing=false,slope=vertical,part=start,facing=east": { "model": "create:block/belt/horizontal_end", "x": 90, "y": 270 },
"casing=false,slope=vertical,part=start,facing=west": { "model": "create:block/belt/horizontal_start", "x": 90, "y": 90 },
"casing=false,slope=vertical,part=pulley,facing=north": { "model": "create:block/belt/horizontal_middle", "x": 90, "y": 180 },
"casing=false,slope=vertical,part=pulley,facing=south": { "model": "create:block/belt/horizontal_middle", "x": 90, "y": 0 },
"casing=false,slope=vertical,part=pulley,facing=east": { "model": "create:block/belt/horizontal_middle", "x": 90, "y": 270 },
"casing=false,slope=vertical,part=pulley,facing=west": { "model": "create:block/belt/horizontal_middle", "x": 90, "y": 90 },
"slope=upward,part=start,facing=north": { "model": "create:block/belt/downward_end", "x": 0, "y": 180 },
"slope=upward,part=start,facing=south": { "model": "create:block/belt/downward_end", "x": 0, "y": 0 },
"slope=upward,part=start,facing=east": { "model": "create:block/belt/downward_end", "x": 0, "y": 270 },
"slope=upward,part=start,facing=west": { "model": "create:block/belt/downward_end", "x": 0, "y": 90 },
"casing=false,slope=upward,part=start,facing=north": { "model": "create:block/belt/downward_end", "x": 0, "y": 180 },
"casing=false,slope=upward,part=start,facing=south": { "model": "create:block/belt/downward_end", "x": 0, "y": 0 },
"casing=false,slope=upward,part=start,facing=east": { "model": "create:block/belt/downward_end", "x": 0, "y": 270 },
"casing=false,slope=upward,part=start,facing=west": { "model": "create:block/belt/downward_end", "x": 0, "y": 90 },
"slope=upward,part=middle,facing=north": { "model": "create:block/belt/downward_middle", "x": 0, "y": 180 },
"slope=upward,part=middle,facing=south": { "model": "create:block/belt/downward_middle", "x": 0, "y": 0 },
"slope=upward,part=middle,facing=east": { "model": "create:block/belt/downward_middle", "x": 0, "y": 270 },
"slope=upward,part=middle,facing=west": { "model": "create:block/belt/downward_middle", "x": 0, "y": 90 },
"slope=upward,part=end,facing=north": { "model": "create:block/belt/downward_start", "x": 0, "y": 180 },
"slope=upward,part=end,facing=south": { "model": "create:block/belt/downward_start", "x": 0, "y": 0 },
"slope=upward,part=end,facing=east": { "model": "create:block/belt/downward_start", "x": 0, "y": 270 },
"slope=upward,part=end,facing=west": { "model": "create:block/belt/downward_start", "x": 0, "y": 90 },
"casing=false,slope=upward,part=middle,facing=north": { "model": "create:block/belt/downward_middle", "x": 0, "y": 180 },
"casing=false,slope=upward,part=middle,facing=south": { "model": "create:block/belt/downward_middle", "x": 0, "y": 0 },
"casing=false,slope=upward,part=middle,facing=east": { "model": "create:block/belt/downward_middle", "x": 0, "y": 270 },
"casing=false,slope=upward,part=middle,facing=west": { "model": "create:block/belt/downward_middle", "x": 0, "y": 90 },
"casing=false,slope=upward,part=end,facing=north": { "model": "create:block/belt/downward_start", "x": 0, "y": 180 },
"casing=false,slope=upward,part=end,facing=south": { "model": "create:block/belt/downward_start", "x": 0, "y": 0 },
"casing=false,slope=upward,part=end,facing=east": { "model": "create:block/belt/downward_start", "x": 0, "y": 270 },
"casing=false,slope=upward,part=end,facing=west": { "model": "create:block/belt/downward_start", "x": 0, "y": 90 },
"casing=false,slope=upward,part=pulley,facing=north": { "model": "create:block/belt/downward_middle", "x": 0, "y": 180 },
"casing=false,slope=upward,part=pulley,facing=south": { "model": "create:block/belt/downward_middle", "x": 0, "y": 0 },
"casing=false,slope=upward,part=pulley,facing=east": { "model": "create:block/belt/downward_middle", "x": 0, "y": 270 },
"casing=false,slope=upward,part=pulley,facing=west": { "model": "create:block/belt/downward_middle", "x": 0, "y": 90 },
"slope=downward,part=start,facing=north": { "model": "create:block/belt/upward_end", "x": 0, "y": 180 },
"slope=downward,part=start,facing=south": { "model": "create:block/belt/upward_end", "x": 0, "y": 0 },
"slope=downward,part=start,facing=east": { "model": "create:block/belt/upward_end", "x": 0, "y": 270 },
"slope=downward,part=start,facing=west": { "model": "create:block/belt/upward_end", "x": 0, "y": 90 },
"casing=false,slope=downward,part=start,facing=north": { "model": "create:block/belt/upward_end", "x": 0, "y": 180 },
"casing=false,slope=downward,part=start,facing=south": { "model": "create:block/belt/upward_end", "x": 0, "y": 0 },
"casing=false,slope=downward,part=start,facing=east": { "model": "create:block/belt/upward_end", "x": 0, "y": 270 },
"casing=false,slope=downward,part=start,facing=west": { "model": "create:block/belt/upward_end", "x": 0, "y": 90 },
"slope=downward,part=middle,facing=north": { "model": "create:block/belt/upward_middle", "x": 0, "y": 180 },
"slope=downward,part=middle,facing=south": { "model": "create:block/belt/upward_middle", "x": 0, "y": 0 },
"slope=downward,part=middle,facing=east": { "model": "create:block/belt/upward_middle", "x": 0, "y": 270 },
"slope=downward,part=middle,facing=west": { "model": "create:block/belt/upward_middle", "x": 0, "y": 90 },
"casing=false,slope=downward,part=middle,facing=north": { "model": "create:block/belt/upward_middle", "x": 0, "y": 180 },
"casing=false,slope=downward,part=middle,facing=south": { "model": "create:block/belt/upward_middle", "x": 0, "y": 0 },
"casing=false,slope=downward,part=middle,facing=east": { "model": "create:block/belt/upward_middle", "x": 0, "y": 270 },
"casing=false,slope=downward,part=middle,facing=west": { "model": "create:block/belt/upward_middle", "x": 0, "y": 90 },
"slope=downward,part=end,facing=north": { "model": "create:block/belt/upward_start", "x": 0, "y": 180 },
"slope=downward,part=end,facing=south": { "model": "create:block/belt/upward_start", "x": 0, "y": 0 },
"slope=downward,part=end,facing=east": { "model": "create:block/belt/upward_start", "x": 0, "y": 270 },
"slope=downward,part=end,facing=west": { "model": "create:block/belt/upward_start", "x": 0, "y": 90 }
"casing=false,slope=downward,part=end,facing=north": { "model": "create:block/belt/upward_start", "x": 0, "y": 180 },
"casing=false,slope=downward,part=end,facing=south": { "model": "create:block/belt/upward_start", "x": 0, "y": 0 },
"casing=false,slope=downward,part=end,facing=east": { "model": "create:block/belt/upward_start", "x": 0, "y": 270 },
"casing=false,slope=downward,part=end,facing=west": { "model": "create:block/belt/upward_start", "x": 0, "y": 90 },
"casing=false,slope=downward,part=pulley,facing=north": { "model": "create:block/belt/upward_middle", "x": 0, "y": 180 },
"casing=false,slope=downward,part=pulley,facing=south": { "model": "create:block/belt/upward_middle", "x": 0, "y": 0 },
"casing=false,slope=downward,part=pulley,facing=east": { "model": "create:block/belt/upward_middle", "x": 0, "y": 270 },
"casing=false,slope=downward,part=pulley,facing=west": { "model": "create:block/belt/upward_middle", "x": 0, "y": 90 },
"casing=true,slope=horizontal,part=start,facing=north": { "model": "create:block/belt/horizontal_casing_pulley", "x": 0, "y": 180 },
"casing=true,slope=horizontal,part=start,facing=south": { "model": "create:block/belt/horizontal_casing_pulley", "x": 0, "y": 0 },
"casing=true,slope=horizontal,part=start,facing=east": { "model": "create:block/belt/horizontal_casing_pulley", "x": 0, "y": 270 },
"casing=true,slope=horizontal,part=start,facing=west": { "model": "create:block/belt/horizontal_casing_pulley", "x": 0, "y": 90 },
"casing=true,slope=horizontal,part=middle,facing=north": { "model": "create:block/belt/horizontal_casing", "x": 0, "y": 180 },
"casing=true,slope=horizontal,part=middle,facing=south": { "model": "create:block/belt/horizontal_casing", "x": 0, "y": 0 },
"casing=true,slope=horizontal,part=middle,facing=east": { "model": "create:block/belt/horizontal_casing", "x": 0, "y": 270 },
"casing=true,slope=horizontal,part=middle,facing=west": { "model": "create:block/belt/horizontal_casing", "x": 0, "y": 90 },
"casing=true,slope=horizontal,part=end,facing=north": { "model": "create:block/belt/horizontal_casing_pulley", "x": 0, "y": 180 },
"casing=true,slope=horizontal,part=end,facing=south": { "model": "create:block/belt/horizontal_casing_pulley", "x": 0, "y": 0 },
"casing=true,slope=horizontal,part=end,facing=east": { "model": "create:block/belt/horizontal_casing_pulley", "x": 0, "y": 270 },
"casing=true,slope=horizontal,part=end,facing=west": { "model": "create:block/belt/horizontal_casing_pulley", "x": 0, "y": 90 },
"casing=true,slope=horizontal,part=pulley,facing=north": { "model": "create:block/belt/horizontal_casing_pulley", "x": 0, "y": 180 },
"casing=true,slope=horizontal,part=pulley,facing=south": { "model": "create:block/belt/horizontal_casing_pulley", "x": 0, "y": 0 },
"casing=true,slope=horizontal,part=pulley,facing=east": { "model": "create:block/belt/horizontal_casing_pulley", "x": 0, "y": 270 },
"casing=true,slope=horizontal,part=pulley,facing=west": { "model": "create:block/belt/horizontal_casing_pulley", "x": 0, "y": 90 },
"casing=true,slope=upward,part=start,facing=north": { "model": "create:block/belt/diagonal_casing_bottom", "x": 0, "y": 0 },
"casing=true,slope=upward,part=start,facing=south": { "model": "create:block/belt/diagonal_casing_bottom", "x": 0, "y": 180 },
"casing=true,slope=upward,part=start,facing=east": { "model": "create:block/belt/diagonal_casing_bottom", "x": 0, "y": 90 },
"casing=true,slope=upward,part=start,facing=west": { "model": "create:block/belt/diagonal_casing_bottom", "x": 0, "y": 270 },
"casing=true,slope=upward,part=middle,facing=north": { "model": "create:block/belt/diagonal_casing_middle", "x": 0, "y": 0 },
"casing=true,slope=upward,part=middle,facing=south": { "model": "create:block/belt/diagonal_casing_middle", "x": 0, "y": 180 },
"casing=true,slope=upward,part=middle,facing=east": { "model": "create:block/belt/diagonal_casing_middle", "x": 0, "y": 90 },
"casing=true,slope=upward,part=middle,facing=west": { "model": "create:block/belt/diagonal_casing_middle", "x": 0, "y": 270 },
"casing=true,slope=upward,part=end,facing=north": { "model": "create:block/belt/diagonal_casing_top", "x": 0, "y": 180 },
"casing=true,slope=upward,part=end,facing=south": { "model": "create:block/belt/diagonal_casing_top", "x": 0, "y": 0 },
"casing=true,slope=upward,part=end,facing=east": { "model": "create:block/belt/diagonal_casing_top", "x": 0, "y": 270 },
"casing=true,slope=upward,part=end,facing=west": { "model": "create:block/belt/diagonal_casing_top", "x": 0, "y": 90 },
"casing=true,slope=upward,part=pulley,facing=north": { "model": "create:block/belt/diagonal_casing_middle_pulley", "x": 0, "y": 0 },
"casing=true,slope=upward,part=pulley,facing=south": { "model": "create:block/belt/diagonal_casing_middle_pulley", "x": 0, "y": 180 },
"casing=true,slope=upward,part=pulley,facing=east": { "model": "create:block/belt/diagonal_casing_middle_pulley", "x": 0, "y": 90 },
"casing=true,slope=upward,part=pulley,facing=west": { "model": "create:block/belt/diagonal_casing_middle_pulley", "x": 0, "y": 270 },
"casing=true,slope=vertical,part=end,facing=north": { "model": "create:block/belt/horizontal_end", "x": 90, "y": 180 },
"casing=true,slope=vertical,part=end,facing=south": { "model": "create:block/belt/horizontal_start", "x": 90, "y": 0 },
"casing=true,slope=vertical,part=end,facing=east": { "model": "create:block/belt/horizontal_start", "x": 90, "y": 270 },
"casing=true,slope=vertical,part=end,facing=west": { "model": "create:block/belt/horizontal_end", "x": 90, "y": 90 },
"casing=true,slope=vertical,part=middle,facing=north": { "model": "create:block/belt/horizontal_middle", "x": 90, "y": 180 },
"casing=true,slope=vertical,part=middle,facing=south": { "model": "create:block/belt/horizontal_middle", "x": 90, "y": 0 },
"casing=true,slope=vertical,part=middle,facing=east": { "model": "create:block/belt/horizontal_middle", "x": 90, "y": 270 },
"casing=true,slope=vertical,part=middle,facing=west": { "model": "create:block/belt/horizontal_middle", "x": 90, "y": 90 },
"casing=true,slope=vertical,part=start,facing=north": { "model": "create:block/belt/horizontal_start", "x": 90, "y": 180 },
"casing=true,slope=vertical,part=start,facing=south": { "model": "create:block/belt/horizontal_end", "x": 90, "y": 0 },
"casing=true,slope=vertical,part=start,facing=east": { "model": "create:block/belt/horizontal_end", "x": 90, "y": 270 },
"casing=true,slope=vertical,part=start,facing=west": { "model": "create:block/belt/horizontal_start", "x": 90, "y": 90 },
"casing=true,slope=vertical,part=pulley,facing=north": { "model": "create:block/belt/horizontal_middle", "x": 90, "y": 180 },
"casing=true,slope=vertical,part=pulley,facing=south": { "model": "create:block/belt/horizontal_middle", "x": 90, "y": 0 },
"casing=true,slope=vertical,part=pulley,facing=east": { "model": "create:block/belt/horizontal_middle", "x": 90, "y": 270 },
"casing=true,slope=vertical,part=pulley,facing=west": { "model": "create:block/belt/horizontal_middle", "x": 90, "y": 90 },
"casing=true,slope=downward,part=start,facing=north": { "model": "create:block/belt/diagonal_casing_top", "x": 0, "y": 0 },
"casing=true,slope=downward,part=start,facing=south": { "model": "create:block/belt/diagonal_casing_top", "x": 0, "y": 180 },
"casing=true,slope=downward,part=start,facing=east": { "model": "create:block/belt/diagonal_casing_top", "x": 0, "y": 90 },
"casing=true,slope=downward,part=start,facing=west": { "model": "create:block/belt/diagonal_casing_top", "x": 0, "y": 270 },
"casing=true,slope=downward,part=middle,facing=north": { "model": "create:block/belt/diagonal_casing_middle", "x": 0, "y": 180 },
"casing=true,slope=downward,part=middle,facing=south": { "model": "create:block/belt/diagonal_casing_middle", "x": 0, "y": 0 },
"casing=true,slope=downward,part=middle,facing=east": { "model": "create:block/belt/diagonal_casing_middle", "x": 0, "y": 270 },
"casing=true,slope=downward,part=middle,facing=west": { "model": "create:block/belt/diagonal_casing_middle", "x": 0, "y": 90 },
"casing=true,slope=downward,part=end,facing=north": { "model": "create:block/belt/diagonal_casing_bottom", "x": 0, "y": 180 },
"casing=true,slope=downward,part=end,facing=south": { "model": "create:block/belt/diagonal_casing_bottom", "x": 0, "y": 0 },
"casing=true,slope=downward,part=end,facing=east": { "model": "create:block/belt/diagonal_casing_bottom", "x": 0, "y": 270 },
"casing=true,slope=downward,part=end,facing=west": { "model": "create:block/belt/diagonal_casing_bottom", "x": 0, "y": 90 },
"casing=true,slope=downward,part=pulley,facing=north": { "model": "create:block/belt/diagonal_casing_middle_pulley", "x": 0, "y": 180 },
"casing=true,slope=downward,part=pulley,facing=south": { "model": "create:block/belt/diagonal_casing_middle_pulley", "x": 0, "y": 0 },
"casing=true,slope=downward,part=pulley,facing=east": { "model": "create:block/belt/diagonal_casing_middle_pulley", "x": 0, "y": 270 },
"casing=true,slope=downward,part=pulley,facing=west": { "model": "create:block/belt/diagonal_casing_middle_pulley", "x": 0, "y": 90 }
}
}

View file

@ -0,0 +1,98 @@
{
"credit": "Made with Blockbench",
"parent": "block/block",
"textures": {
"particle": "create:block/brass_casing_side",
"1": "create:block/belt_support_side",
"2": "create:block/brass_casing_side",
"8": "create:block/gearbox"
},
"elements": [
{
"name": "Casing",
"from": [1.1, 5, 2],
"to": [14.9, 11, 14],
"rotation": {"angle": 45, "axis": "x", "origin": [8, 8, 8]},
"faces": {
"north": {"uv": [0, 0, 15, 6], "texture": "#1"},
"east": {"uv": [2, 5, 14, 11], "texture": "#8"},
"south": {"uv": [0, 0, 15, 6], "texture": "#1"},
"west": {"uv": [2, 5, 14, 11], "texture": "#8"}
}
},
{
"name": "Casing",
"from": [1.1, 11, 6],
"to": [14.9, 13, 10],
"rotation": {"angle": 45, "axis": "x", "origin": [8, 8, 8]},
"faces": {
"east": {"uv": [6, 3, 10, 5], "texture": "#8"},
"west": {"uv": [6, 3, 10, 5], "texture": "#8"}
}
},
{
"name": "Left",
"from": [0, 0, 0],
"to": [16, 10, 5],
"faces": {
"north": {"uv": [0, 0, 10, 16], "rotation": 90, "texture": "#2"},
"east": {"uv": [11, 1, 16, 11], "texture": "#2"},
"south": {"uv": [0, 1, 16, 11], "texture": "#2"},
"west": {"uv": [0, 1, 5, 11], "texture": "#2"},
"up": {"uv": [0, 0, 5, 16], "rotation": 90, "texture": "#2"},
"down": {"uv": [0, 0, 5, 16], "rotation": 90, "texture": "#2"}
}
},
{
"name": "Zfighter2",
"from": [0.5, 0.1, 15.1],
"to": [15.5, 11.1, 16.1],
"faces": {
"east": {"uv": [12, 0, 13, 10.8], "texture": "#2"},
"south": {"uv": [0, 0, 15, 10.8], "texture": "#2"},
"west": {"uv": [0, 0, 1, 10.8], "texture": "#2"},
"up": {"uv": [0, 0, 15, 1], "texture": "#2"},
"down": {"uv": [0, 0, 1, 15], "rotation": 90, "texture": "#2"}
}
},
{
"name": "Right",
"from": [0, 0, 11],
"to": [16, 11, 16],
"faces": {
"north": {"uv": [0, 0, 2, 11], "texture": "#2"},
"east": {"uv": [0, 0, 4, 11], "texture": "#2"},
"south": {"uv": [0, 0, 16, 11], "texture": "#2"},
"west": {"uv": [12, 0, 16, 11], "texture": "#2"},
"up": {"uv": [12, 0, 16, 16], "rotation": 90, "texture": "#2"},
"down": {"uv": [12, 0, 16, 16], "rotation": 90, "texture": "#2"}
}
},
{
"name": "Down",
"from": [0, 0, 5],
"to": [16, 5.1, 11],
"faces": {
"north": {"uv": [0, 6, 16, 11], "texture": "#2"},
"east": {"uv": [4, 5.9, 10, 11], "texture": "#2"},
"west": {"uv": [4, 5.9, 10, 11], "texture": "#2"},
"up": {"uv": [0, 2, 16, 8], "texture": "#2"},
"down": {"uv": [4, 0, 10, 16], "rotation": 90, "texture": "#2"}
}
},
{
"name": "Top Diagonal",
"from": [-0.1, 2, -3.325],
"to": [16.1, 11, 4.7],
"rotation": {"angle": 45, "axis": "x", "origin": [8, 8, 8]},
"faces": {
"north": {"uv": [7, 0, 16, 16], "rotation": 270, "texture": "#2"},
"east": {"uv": [0, 0, 8.025, 9], "texture": "#2"},
"south": {"uv": [7, 0, 16, 16], "rotation": 270, "texture": "#2"},
"west": {"uv": [0, 0, 8.025, 9], "texture": "#2"},
"up": {"uv": [0, 0, 8.025, 16], "rotation": 270, "texture": "#2"},
"down": {"uv": [0, 0, 8.025, 16], "rotation": 270, "texture": "#2"}
}
}
]
}

View file

@ -0,0 +1,74 @@
{
"credit": "Made with Blockbench",
"parent": "block/block",
"textures": {
"particle": "create:block/brass_casing_side",
"2": "create:block/brass_casing_side",
"8": "create:block/gearbox"
},
"elements": [
{
"name": "Casing",
"from": [1.1, 11, 6],
"to": [14.9, 13, 10],
"rotation": {"angle": 45, "axis": "x", "origin": [8, 8, 8]},
"faces": {
"east": {"uv": [6, 3, 10, 5], "texture": "#8"},
"west": {"uv": [6, 3, 10, 5], "texture": "#8"}
}
},
{
"name": "Left",
"from": [0, 0, 0],
"to": [16, 10, 5],
"faces": {
"north": {"uv": [0, 0, 10, 16], "rotation": 90, "texture": "#2"},
"east": {"uv": [11, 1, 16, 11], "texture": "#2"},
"south": {"uv": [0, 1, 16, 11], "texture": "#2"},
"west": {"uv": [0, 1, 5, 11], "texture": "#2"},
"up": {"uv": [0, 0, 5, 16], "rotation": 90, "texture": "#2"},
"down": {"uv": [0, 0, 5, 16], "rotation": 90, "texture": "#2"}
}
},
{
"name": "Down",
"from": [0, 0, 5],
"to": [16, 5.1, 11],
"faces": {
"north": {"uv": [0, 6, 16, 11], "texture": "#2"},
"east": {"uv": [4, 5.9, 10, 11], "texture": "#2"},
"west": {"uv": [4, 5.9, 10, 11], "texture": "#2"},
"up": {"uv": [0, 2, 16, 8], "texture": "#2"},
"down": {"uv": [4, 0, 10, 16], "rotation": 90, "texture": "#2"}
}
},
{
"name": "Top Diagonal",
"from": [-0.1, 2, -3.325],
"to": [16.1, 11, 10],
"rotation": {"angle": 45, "axis": "x", "origin": [8, 8, 8]},
"faces": {
"north": {"uv": [7, 0, 16, 16], "rotation": 270, "texture": "#2"},
"east": {"uv": [0, 0, 13.325, 9], "texture": "#2"},
"south": {"uv": [7, 0, 16, 16], "rotation": 270, "texture": "#2"},
"west": {"uv": [0, 0, 8.025, 9], "texture": "#2"},
"up": {"uv": [0, 0, 8.025, 16], "rotation": 270, "texture": "#2"},
"down": {"uv": [0, 0, 8.025, 16], "rotation": 270, "texture": "#2"}
}
},
{
"name": "Top Diagonal",
"from": [-0.1, 2, 10],
"to": [16.1, 11, 19.3],
"rotation": {"angle": 45, "axis": "x", "origin": [8, 8, 8]},
"faces": {
"north": {"uv": [7, 0, 16, 16], "rotation": 270, "texture": "#2"},
"east": {"uv": [0, 0, 9.3, 9], "texture": "#2"},
"south": {"uv": [7, 0, 16, 16], "rotation": 270, "texture": "#2"},
"west": {"uv": [0, 0, 9.3, 9], "texture": "#2"},
"up": {"uv": [0, 0, 8.025, 16], "rotation": 270, "texture": "#2"},
"down": {"uv": [0, 0, 8.025, 16], "rotation": 270, "texture": "#2"}
}
}
]
}

View file

@ -0,0 +1,87 @@
{
"credit": "Made with Blockbench",
"parent": "block/block",
"textures": {
"particle": "create:block/brass_casing_side",
"1": "create:block/belt_support_side",
"2": "create:block/brass_casing_side",
"8": "create:block/gearbox"
},
"elements": [
{
"name": "Casing",
"from": [1.1, 5, 2],
"to": [14.9, 11, 14],
"rotation": {"angle": 45, "axis": "x", "origin": [8, 8, 8]},
"faces": {
"north": {"uv": [0, 0, 15, 6], "texture": "#1"},
"east": {"uv": [2, 5, 14, 11], "texture": "#8"},
"south": {"uv": [0, 0, 15, 6], "texture": "#1"},
"west": {"uv": [2, 5, 14, 11], "texture": "#8"}
}
},
{
"name": "Casing",
"from": [1.1, 11, 6],
"to": [14.9, 13, 10],
"rotation": {"angle": 45, "axis": "x", "origin": [8, 8, 8]},
"faces": {
"east": {"uv": [6, 3, 10, 5], "texture": "#8"},
"west": {"uv": [6, 3, 10, 5], "texture": "#8"}
}
},
{
"name": "Left",
"from": [0, 0, 0],
"to": [16, 10, 5],
"faces": {
"north": {"uv": [0, 0, 10, 16], "rotation": 90, "texture": "#2"},
"east": {"uv": [11, 1, 16, 11], "texture": "#2"},
"south": {"uv": [0, 1, 16, 11], "texture": "#2"},
"west": {"uv": [0, 1, 5, 11], "texture": "#2"},
"up": {"uv": [0, 0, 5, 16], "rotation": 90, "texture": "#2"},
"down": {"uv": [0, 0, 5, 16], "rotation": 90, "texture": "#2"}
}
},
{
"name": "Down",
"from": [0, 0, 5],
"to": [16, 5.1, 11],
"faces": {
"north": {"uv": [0, 6, 16, 11], "texture": "#2"},
"east": {"uv": [4, 5.9, 10, 11], "texture": "#2"},
"west": {"uv": [4, 5.9, 10, 11], "texture": "#2"},
"up": {"uv": [0, 2, 16, 8], "texture": "#2"},
"down": {"uv": [4, 0, 10, 16], "rotation": 90, "texture": "#2"}
}
},
{
"name": "Top Diagonal",
"from": [-0.1, 2, -3.325],
"to": [16.1, 11, 4.7],
"rotation": {"angle": 45, "axis": "x", "origin": [8, 8, 8]},
"faces": {
"north": {"uv": [7, 0, 16, 16], "rotation": 270, "texture": "#2"},
"east": {"uv": [0, 0, 8.025, 9], "texture": "#2"},
"south": {"uv": [7, 0, 16, 16], "rotation": 270, "texture": "#2"},
"west": {"uv": [0, 0, 8.025, 9], "texture": "#2"},
"up": {"uv": [0, 0, 8.025, 16], "rotation": 270, "texture": "#2"},
"down": {"uv": [0, 0, 8.025, 16], "rotation": 270, "texture": "#2"}
}
},
{
"name": "Top Diagonal",
"from": [-0.1, 2, 11.275],
"to": [16.1, 11, 19.3],
"rotation": {"angle": 45, "axis": "x", "origin": [8, 8, 8]},
"faces": {
"north": {"uv": [7, 0, 16, 16], "rotation": 270, "texture": "#2"},
"east": {"uv": [0, 0, 8.025, 9], "texture": "#2"},
"south": {"uv": [7, 0, 16, 16], "rotation": 270, "texture": "#2"},
"west": {"uv": [0, 0, 8.025, 9], "texture": "#2"},
"up": {"uv": [0, 0, 8.025, 16], "rotation": 270, "texture": "#2"},
"down": {"uv": [0, 0, 8.025, 16], "rotation": 270, "texture": "#2"}
}
}
]
}

View file

@ -0,0 +1,86 @@
{
"credit": "Made with Blockbench",
"parent": "block/block",
"textures": {
"particle": "create:block/brass_casing_side",
"1": "create:block/belt_support_side",
"2": "create:block/brass_casing_side",
"8": "create:block/gearbox"
},
"elements": [
{
"name": "Casing",
"from": [1.1, 4, 4],
"to": [14.9, 11, 14],
"rotation": {"angle": 45, "axis": "x", "origin": [8, 8, 8]},
"faces": {
"north": {"uv": [0, 0, 15, 6], "texture": "#1"},
"east": {"uv": [2, 5, 12, 12], "texture": "#8"},
"south": {"uv": [0, 0, 15, 6], "texture": "#1"},
"west": {"uv": [4, 5, 14, 12], "texture": "#8"}
}
},
{
"name": "Casing",
"from": [1.1, 11, 6],
"to": [14.9, 13, 10],
"rotation": {"angle": 45, "axis": "x", "origin": [8, 8, 8]},
"faces": {
"east": {"uv": [6, 3, 10, 5], "texture": "#8"},
"west": {"uv": [6, 3, 10, 5], "texture": "#8"}
}
},
{
"name": "Zfighter2",
"from": [0.5, 0.1, 15.1],
"to": [15.5, 11.1, 16.1],
"faces": {
"east": {"uv": [12, 0, 13, 10.8], "texture": "#2"},
"south": {"uv": [0, 0, 15, 10.8], "texture": "#2"},
"west": {"uv": [0, 0, 1, 10.8], "texture": "#2"},
"up": {"uv": [0, 0, 15, 1], "texture": "#2"},
"down": {"uv": [0, 0, 1, 15], "rotation": 90, "texture": "#2"}
}
},
{
"name": "Right",
"from": [0, 0, 11],
"to": [16, 11, 16],
"faces": {
"north": {"uv": [0, 0, 2, 11], "texture": "#2"},
"east": {"uv": [0, 0, 4, 11], "texture": "#2"},
"south": {"uv": [0, 0, 16, 11], "texture": "#2"},
"west": {"uv": [12, 0, 16, 11], "texture": "#2"},
"up": {"uv": [12, 0, 16, 16], "rotation": 90, "texture": "#2"},
"down": {"uv": [12, 0, 16, 16], "rotation": 90, "texture": "#2"}
}
},
{
"name": "Down",
"from": [0, 0, 5],
"to": [16, 5.1, 11],
"faces": {
"north": {"uv": [0, 6, 16, 11], "texture": "#2"},
"east": {"uv": [4, 5.9, 10, 11], "texture": "#2"},
"south": {"uv": [0, 0, 16, 5], "texture": "#missing"},
"west": {"uv": [4, 5.9, 10, 11], "texture": "#2"},
"up": {"uv": [0, 2, 16, 8], "texture": "#2"},
"down": {"uv": [4, 0, 10, 16], "rotation": 90, "texture": "#2"}
}
},
{
"name": "Top Diagonal",
"from": [-0.1, 2, -3.328],
"to": [16.1, 11, 4.697],
"rotation": {"angle": -45, "axis": "x", "origin": [8, 8, 8]},
"faces": {
"north": {"uv": [7, 0, 16, 16], "rotation": 270, "texture": "#2"},
"east": {"uv": [0, 0, 8.025, 9], "texture": "#2"},
"south": {"uv": [7, 0, 16, 16], "rotation": 270, "texture": "#2"},
"west": {"uv": [0, 0, 8.025, 9], "texture": "#2"},
"up": {"uv": [0, 0, 8.025, 16], "rotation": 270, "texture": "#2"},
"down": {"uv": [0, 0, 8.025, 16], "rotation": 270, "texture": "#2"}
}
}
]
}

View file

@ -0,0 +1,24 @@
{
"credit": "Made with Blockbench",
"parent": "block/block",
"textures": {
"particle": "create:block/brass_casing_side",
"1": "create:block/belt_support_side",
"2": "create:block/brass_casing_side"
},
"elements": [
{
"name": "Casing",
"from": [0, 0, 0],
"to": [16, 11, 16],
"faces": {
"north": {"uv": [0, 0, 16, 11], "texture": "#1"},
"east": {"uv": [0, 0, 16, 11], "texture": "#2"},
"south": {"uv": [0, 0, 16, 11], "texture": "#1"},
"west": {"uv": [0, 0, 16, 11], "texture": "#2"},
"up": {"uv": [0, 0, 16, 16], "rotation": 90, "texture": "#2"},
"down": {"uv": [0, 0, 16, 16], "rotation": 90, "texture": "#2"}
}
}
]
}

View file

@ -0,0 +1,84 @@
{
"credit": "Made with Blockbench",
"parent": "block/block",
"textures": {
"particle": "create:block/brass_casing_side",
"1": "create:block/belt_support_side",
"2": "create:block/brass_casing_side",
"8": "create:block/gearbox"
},
"elements": [
{
"name": "Casing",
"from": [1, 5, 2],
"to": [15, 11, 14],
"faces": {
"north": {"uv": [0, 0, 15, 6], "texture": "#1"},
"east": {"uv": [2, 5, 14, 11], "texture": "#8"},
"south": {"uv": [0, 0, 15, 6], "texture": "#1"},
"west": {"uv": [2, 5, 14, 11], "texture": "#8"}
}
},
{
"name": "Left",
"from": [0, 0, 0],
"to": [16, 11, 4],
"faces": {
"north": {"uv": [0, 0, 16, 11], "texture": "#2"},
"east": {"uv": [12, 0, 16, 11], "texture": "#2"},
"south": {"uv": [14, 0, 16, 11], "texture": "#2"},
"west": {"uv": [0, 0, 4, 11], "texture": "#2"},
"up": {"uv": [0, 0, 4, 16], "rotation": 90, "texture": "#2"},
"down": {"uv": [0, 0, 4, 16], "rotation": 90, "texture": "#2"}
}
},
{
"name": "Zfighter",
"from": [0.5, 0.1, -0.1],
"to": [15.5, 10.9, 0.9],
"faces": {
"north": {"uv": [0, 0, 15, 10.8], "texture": "#2"},
"east": {"uv": [12, 0, 13, 10.8], "texture": "#2"},
"west": {"uv": [0, 0, 1, 10.8], "texture": "#2"},
"up": {"uv": [0, 0, 15, 1], "texture": "#2"},
"down": {"uv": [0, 0, 1, 15], "rotation": 90, "texture": "#2"}
}
},
{
"name": "Zfighter2",
"from": [0.5, 0.1, 15.1],
"to": [15.5, 10.9, 16.1],
"faces": {
"east": {"uv": [12, 0, 13, 10.8], "texture": "#2"},
"south": {"uv": [0, 0, 15, 10.8], "texture": "#2"},
"west": {"uv": [0, 0, 1, 10.8], "texture": "#2"},
"up": {"uv": [0, 0, 15, 1], "texture": "#2"},
"down": {"uv": [0, 0, 1, 15], "rotation": 90, "texture": "#2"}
}
},
{
"name": "Right",
"from": [0, 0, 12],
"to": [16, 11, 16],
"faces": {
"north": {"uv": [0, 0, 2, 11], "texture": "#2"},
"east": {"uv": [0, 0, 4, 11], "texture": "#2"},
"south": {"uv": [0, 0, 16, 11], "texture": "#2"},
"west": {"uv": [12, 0, 16, 11], "texture": "#2"},
"up": {"uv": [12, 0, 16, 16], "rotation": 90, "texture": "#2"},
"down": {"uv": [12, 0, 16, 16], "rotation": 90, "texture": "#2"}
}
},
{
"name": "Down",
"from": [0, 0, 4],
"to": [16, 4, 12],
"faces": {
"east": {"uv": [4, 7, 12, 11], "texture": "#2"},
"west": {"uv": [4, 7, 12, 11], "texture": "#2"},
"up": {"uv": [0, 2, 16, 10], "texture": "#2"},
"down": {"uv": [4, 0, 12, 16], "rotation": 90, "texture": "#2"}
}
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 481 B