Improved Belts

- Limiting belts to 45 Degree angles allows for actual hitboxes and vanilla model action
- Animation now only moves around the texture coordinates of cached vertices
This commit is contained in:
simibubi 2019-08-10 01:00:36 +02:00
parent 3ec8afd091
commit a0149425d5
39 changed files with 1199 additions and 442 deletions

View file

@ -1,13 +1,13 @@
package com.simibubi.create;
import com.simibubi.create.foundation.block.IRenderUtilityBlock;
import com.simibubi.create.foundation.block.IWithoutBlockItem;
import com.simibubi.create.foundation.block.RenderUtilityBlock;
import com.simibubi.create.modules.kinetics.base.HalfAxisBlock;
import com.simibubi.create.modules.kinetics.generators.MotorBlock;
import com.simibubi.create.modules.kinetics.receivers.TurntableBlock;
import com.simibubi.create.modules.kinetics.relays.AxisBlock;
import com.simibubi.create.modules.kinetics.relays.AxisTunnelBlock;
import com.simibubi.create.modules.kinetics.relays.BeltPulleyBlock;
import com.simibubi.create.modules.kinetics.relays.BeltBlock;
import com.simibubi.create.modules.kinetics.relays.CogWheelBlock;
import com.simibubi.create.modules.kinetics.relays.GearboxBlock;
import com.simibubi.create.modules.kinetics.relays.GearshifterBlock;
@ -41,8 +41,8 @@ public enum AllBlocks {
LARGE_GEAR(new CogWheelBlock(true)),
AXIS_TUNNEL(new AxisTunnelBlock()),
GEARSHIFTER(new GearshifterBlock()),
BELT_PULLEY(new BeltPulleyBlock()),
BELT(new RenderUtilityBlock()),
BELT(new BeltBlock()),
BELT_ANIMATION(new RenderUtilityBlock()),
TURNTABLE(new TurntableBlock()),
HALF_AXIS(new HalfAxisBlock()),
@ -71,7 +71,7 @@ public enum AllBlocks {
public static void registerItemBlocks(IForgeRegistry<Item> registry) {
for (AllBlocks block : values()) {
if (block.get() instanceof IRenderUtilityBlock)
if (block.get() instanceof IWithoutBlockItem)
continue;
registry.register(new BlockItem(block.get(), AllItems.standardProperties())

View file

@ -5,7 +5,6 @@ import com.simibubi.create.modules.curiosities.placementHandgun.BuilderGunItem;
import com.simibubi.create.modules.curiosities.placementHandgun.BuilderGunItemRenderer;
import com.simibubi.create.modules.curiosities.placementHandgun.BuilderGunModel;
import com.simibubi.create.modules.kinetics.relays.BeltItem;
import com.simibubi.create.modules.kinetics.relays.BeltPulleyTileEntityRenderer;
import com.simibubi.create.modules.schematics.item.BlueprintAndQuillItem;
import com.simibubi.create.modules.schematics.item.BlueprintItem;
import com.simibubi.create.modules.symmetry.SymmetryWandItem;
@ -18,9 +17,9 @@ import net.minecraft.client.renderer.model.ModelRotation;
import net.minecraft.client.renderer.tileentity.ItemStackTileEntityRenderer;
import net.minecraft.item.Item;
import net.minecraft.item.Item.Properties;
import net.minecraft.util.ResourceLocation;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Rarity;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.client.event.ModelBakeEvent;
@ -45,7 +44,7 @@ public enum AllItems {
BLUEPRINT_AND_QUILL(new BlueprintAndQuillItem(standardProperties().maxStackSize(1))),
BLUEPRINT(new BlueprintItem(standardProperties())),
BELT(new BeltItem(standardProperties())),
BELT_CONNECTOR(new BeltItem(standardProperties())),
;
@ -94,9 +93,6 @@ public enum AllItems {
ModelResourceLocation handgunLocation = getModelLocation(PLACEMENT_HANDGUN);
template = event.getModelRegistry().get(handgunLocation);
event.getModelRegistry().put(handgunLocation, new BuilderGunModel(template).loadPartials(event));
BeltPulleyTileEntityRenderer.beltModel = event.getModelLoader()
.func_217845_a(new ResourceLocation(Create.ID, "block/belt"), ModelRotation.X0_Y0);
}
protected static ModelResourceLocation getModelLocation(AllItems item) {

View file

@ -2,7 +2,10 @@ package com.simibubi.create;
import net.minecraft.client.Minecraft;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
@EventBusSubscriber(value = Dist.CLIENT)
public enum AllSpecialTextures {
Selection("selection.png"),

View file

@ -9,8 +9,8 @@ import com.simibubi.create.modules.kinetics.receivers.TurntableTileEntity;
import com.simibubi.create.modules.kinetics.relays.AxisTileEntity;
import com.simibubi.create.modules.kinetics.relays.AxisTunnelTileEntity;
import com.simibubi.create.modules.kinetics.relays.AxisTunnelTileEntityRenderer;
import com.simibubi.create.modules.kinetics.relays.BeltPulleyTileEntity;
import com.simibubi.create.modules.kinetics.relays.BeltPulleyTileEntityRenderer;
import com.simibubi.create.modules.kinetics.relays.BeltTileEntity;
import com.simibubi.create.modules.kinetics.relays.BeltTileEntityRenderer;
import com.simibubi.create.modules.kinetics.relays.GearboxTileEntity;
import com.simibubi.create.modules.kinetics.relays.GearboxTileEntityRenderer;
import com.simibubi.create.modules.kinetics.relays.GearshifterTileEntity;
@ -46,7 +46,7 @@ public enum AllTileEntities {
TURNTABLE(TurntableTileEntity::new, AllBlocks.TURNTABLE),
AXIS_TUNNEL(AxisTunnelTileEntity::new, AllBlocks.AXIS_TUNNEL),
GEARSHIFTER(GearshifterTileEntity::new, AllBlocks.GEARSHIFTER),
BELT_PULLEY(BeltPulleyTileEntity::new, AllBlocks.BELT_PULLEY),
BELT(BeltTileEntity::new, AllBlocks.BELT),
;
@ -83,7 +83,7 @@ public enum AllTileEntities {
bind(AxisTunnelTileEntity.class, new AxisTunnelTileEntityRenderer());
bind(GearboxTileEntity.class, new GearboxTileEntityRenderer());
bind(GearshifterTileEntity.class, new GearshifterTileEntityRenderer());
bind(BeltPulleyTileEntity.class, new BeltPulleyTileEntityRenderer());
bind(BeltTileEntity.class, new BeltTileEntityRenderer());
}
@OnlyIn(Dist.CLIENT)

View file

@ -3,6 +3,6 @@ package com.simibubi.create.foundation.block;
/**
* Blocks only registered for use in other blocks' renderers.
*/
public interface IRenderUtilityBlock {
public interface IRenderUtilityBlock extends IWithoutBlockItem {
}

View file

@ -0,0 +1,8 @@
package com.simibubi.create.foundation.block;
/**
* Blocks only registered for use outside of the inventory
*/
public interface IWithoutBlockItem {
}

View file

@ -0,0 +1,65 @@
package com.simibubi.create.foundation.utility;
import java.nio.ByteBuffer;
import java.util.function.Consumer;
import net.minecraft.client.renderer.GLAllocation;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.util.Direction.Axis;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Vec3d;
public abstract class BufferManipulator {
protected ByteBuffer original;
protected ByteBuffer mutable;
public BufferManipulator(ByteBuffer original) {
original.rewind();
this.original = original;
this.mutable = GLAllocation.createDirectByteBuffer(original.capacity());
this.mutable.order(original.order());
this.mutable.limit(original.limit());
mutable.put(this.original);
mutable.rewind();
}
protected void forEachVertex(ByteBuffer buffer, Consumer<Integer> consumer) {
final int formatLength = DefaultVertexFormats.BLOCK.getSize();
for (int i = 0; i < buffer.limit() / formatLength; i++) {
final int position = i * formatLength;
consumer.accept(position);
}
}
protected Vec3d getPos(ByteBuffer buffer, int vertex) {
return new Vec3d(buffer.getFloat(vertex), buffer.getFloat(vertex + 4), buffer.getFloat(vertex + 8));
}
protected void putPos(ByteBuffer buffer, int vertex, Vec3d pos) {
buffer.putFloat(vertex, (float) pos.x);
buffer.putFloat(vertex + 4, (float) pos.y);
buffer.putFloat(vertex + 8, (float) pos.z);
}
protected Vec3d rotatePos(Vec3d pos, float angle, Axis axis) {
return rotatePos(pos, MathHelper.sin(angle), MathHelper.cos(angle), axis);
}
protected Vec3d rotatePos(Vec3d pos, float sin, float cos, Axis axis) {
final float x = (float) pos.x;
final float y = (float) pos.y;
final float z = (float) pos.z;
if (axis == Axis.X)
return new Vec3d(x, y * cos - z * sin, z * cos + y * sin);
if (axis == Axis.Y)
return new Vec3d(x * cos + z * sin, y, z * cos - x * sin);
if (axis == Axis.Z)
return new Vec3d(x * cos - y * sin, y * cos + x * sin, z);
return pos;
}
}

View file

@ -6,6 +6,7 @@ import java.util.List;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.modules.kinetics.base.IRotate;
import com.simibubi.create.modules.kinetics.base.KineticTileEntity;
import com.simibubi.create.modules.kinetics.relays.BeltTileEntity;
import com.simibubi.create.modules.kinetics.relays.GearboxTileEntity;
import com.simibubi.create.modules.kinetics.relays.GearshifterTileEntity;
@ -43,6 +44,11 @@ public class RotationPropagator {
boolean connectedByGears = definitionFrom.isGearTowards(world, from.getPos(), stateFrom, direction)
&& definitionTo.isGearTowards(world, to.getPos(), stateTo, direction.getOpposite());
// Belt <-> Belt
if (from instanceof BeltTileEntity && to instanceof BeltTileEntity && !connectedByAxis) {
return ((BeltTileEntity) from).getController().equals(((BeltTileEntity) to).getController()) ? 1 : 0;
}
// Gearbox <-> Gearbox
if (from instanceof GearboxTileEntity && to instanceof GearboxTileEntity)
return 0;
@ -273,14 +279,15 @@ public class RotationPropagator {
if (!te.getWorld().isAreaLoaded(te.getPos(), 1))
return neighbours;
for (Direction facing : Direction.values()) {
for (Direction facing : Direction.values())
neighbours.add(te.getPos().offset(facing));
}
// gears can interface diagonally
// Some Blocks can interface diagonally
BlockState blockState = te.getBlockState();
if (AllBlocks.GEAR.typeOf(blockState) || AllBlocks.LARGE_GEAR.typeOf(blockState)) {
Axis axis = blockState.get(BlockStateProperties.AXIS);
if (AllBlocks.GEAR.typeOf(blockState) || AllBlocks.LARGE_GEAR.typeOf(blockState)
|| AllBlocks.BELT.typeOf(blockState)) {
Axis axis = ((IRotate) blockState.getBlock()).getRotationAxis(blockState);
BlockPos.getAllInBox(new BlockPos(-1, -1, -1), new BlockPos(1, 1, 1)).forEach(offset -> {
if (axis.getCoordinate(offset.getX(), offset.getY(), offset.getZ()) != 0)
return;

View file

@ -59,7 +59,10 @@ public abstract class KineticBlock extends Block implements IRotate {
@Override
public void updateNeighbors(BlockState stateIn, IWorld worldIn, BlockPos pos, int flags) {
RotationPropagator.handleAdded(worldIn.getWorld(), pos, (KineticTileEntity) worldIn.getTileEntity(pos));
KineticTileEntity tileEntity = (KineticTileEntity) worldIn.getTileEntity(pos);
if (tileEntity == null)
return;
RotationPropagator.handleAdded(worldIn.getWorld(), pos, tileEntity);
}
@Override

View file

@ -21,8 +21,8 @@ public abstract class KineticTileEntity extends SyncedTileEntity {
public KineticTileEntity(TileEntityType<?> typeIn) {
super(typeIn);
setSpeed(0);
setForce(0);
speed = 0;
force = 0;
source = Optional.empty();
}
@ -86,15 +86,8 @@ public abstract class KineticTileEntity extends SyncedTileEntity {
}
public void setSpeed(float speed) {
// if (hasWorld())
// Minecraft.getInstance().player.sendStatusMessage(
// new StringTextComponent((getWorld().isRemote ? TextFormatting.RED : TextFormatting.GREEN)
// + "" + getClass().getSimpleName() + getPos().toString() + " to " + speed),
// false);
this.speed = speed;
if (hasWorld() && speed != 0) {
if (hasWorld() && speed != 0 && world.isRemote) {
Random r = getWorld().rand;
for (int i = 0; i < 10; i++) {
float x = getPos().getX() + (r.nextFloat() - .5f) / 2f + .5f;

View file

@ -4,44 +4,39 @@ import java.nio.ByteBuffer;
import java.util.HashMap;
import java.util.Map;
import java.util.Random;
import java.util.function.Function;
import org.lwjgl.opengl.GL11;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.foundation.utility.BufferManipulator;
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.GLAllocation;
import net.minecraft.client.renderer.model.IBakedModel;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.util.Direction.Axis;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Vec3d;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.client.model.animation.Animation;
import net.minecraftforge.client.model.animation.TileEntityRendererFast;
import net.minecraftforge.client.model.data.EmptyModelData;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
@EventBusSubscriber(value = Dist.CLIENT)
public class KineticTileEntityRenderer extends TileEntityRendererFast<KineticTileEntity> {
protected static Map<BlockState, CachedByteBuffer> cachedBuffers;
protected static Map<BlockState, BufferManipulator> cachedBuffers;
protected class CachedByteBuffer {
ByteBuffer original;
ByteBuffer mutable;
protected class BlockModelSpinner extends BufferManipulator {
public CachedByteBuffer(ByteBuffer original) {
original.rewind();
this.original = original;
this.mutable = GLAllocation.createDirectByteBuffer(original.capacity());
this.mutable.order(original.order());
this.mutable.limit(original.limit());
mutable.put(this.original);
mutable.rewind();
public BlockModelSpinner(ByteBuffer original) {
super(original);
}
public ByteBuffer getTransformed(Vec3d translation, float angle, Axis axis, int packedLightCoords) {
@ -49,38 +44,14 @@ public class KineticTileEntityRenderer extends TileEntityRendererFast<KineticTil
mutable.rewind();
final float cos = MathHelper.cos(angle);
final float sin = MathHelper.sin(angle);
final int formatLength = DefaultVertexFormats.BLOCK.getSize();
final Vec3d half = new Vec3d(.5f, .5f, .5f);
for (int i = 0; i < original.limit() / formatLength; i++) {
final int position = i * formatLength;
final float x = original.getFloat(position) - .5f;
final float y = original.getFloat(position + 4) - .5f;
final float z = original.getFloat(position + 8) - .5f;
forEachVertex(original, index -> {
final Vec3d vertex = getPos(original, index).subtract(half);
putPos(mutable, index, rotatePos(vertex, sin, cos, axis).add(translation).add(half));
mutable.putInt(index + 24, packedLightCoords);
});
float xr = x;
float yr = y;
float zr = z;
if (axis == Axis.X) {
yr = y * cos - z * sin;
zr = z * cos + y * sin;
}
if (axis == Axis.Y) {
xr = x * cos + z * sin;
zr = z * cos - x * sin;
}
if (axis == Axis.Z) {
yr = y * cos + x * sin;
xr = x * cos - y * sin;
}
mutable.putFloat(position, (float) (xr + translation.x + .5f));
mutable.putFloat(position + 4, (float) (yr + translation.y + .5f));
mutable.putFloat(position + 8, (float) (zr + translation.z + .5f));
mutable.putInt(position + 24, packedLightCoords);
}
return mutable;
}
}
@ -94,7 +65,7 @@ public class KineticTileEntityRenderer extends TileEntityRendererFast<KineticTil
int destroyStage, BufferBuilder buffer) {
final BlockState state = getRenderedBlockState(te);
cacheIfMissing(state);
cacheIfMissing(state, BlockModelSpinner::new);
final Vec3d translation = new Vec3d(x, y, z);
final BlockPos pos = te.getPos();
@ -102,17 +73,18 @@ public class KineticTileEntityRenderer extends TileEntityRendererFast<KineticTil
float time = Animation.getWorldTime(Minecraft.getInstance().world, partialTicks);
float offset = getRotationOffsetForPosition(te, pos, axis);
float angle = (float) (((time * te.getSpeed() + offset) % 360) / 180 * (float) Math.PI);
renderFromCache(buffer, state, translation, pos, axis, angle);
}
protected void renderFromCache(BufferBuilder buffer, final BlockState state, final Vec3d translation,
final BlockPos pos, final Axis axis, float angle) {
int packedLightmapCoords = state.getPackedLightmapCoords(getWorld(), pos);
buffer.putBulkData(cachedBuffers.get(state).getTransformed(translation, angle, axis, packedLightmapCoords));
buffer.putBulkData(((BlockModelSpinner) cachedBuffers.get(state)).getTransformed(translation, angle, axis,
packedLightmapCoords));
}
protected void cacheIfMissing(final BlockState state) {
protected void cacheIfMissing(final BlockState state, Function<ByteBuffer, BufferManipulator> factory) {
if (!cachedBuffers.containsKey(state)) {
BlockRendererDispatcher dispatcher = Minecraft.getInstance().getBlockRendererDispatcher();
BlockModelRenderer blockRenderer = dispatcher.getBlockModelRenderer();
@ -125,7 +97,7 @@ public class KineticTileEntityRenderer extends TileEntityRendererFast<KineticTil
EmptyModelData.INSTANCE);
builder.finishDrawing();
cachedBuffers.put(state, new CachedByteBuffer(builder.getByteBuffer()));
cachedBuffers.put(state, factory.apply(builder.getByteBuffer()));
}
}
@ -142,5 +114,5 @@ public class KineticTileEntityRenderer extends TileEntityRendererFast<KineticTil
protected BlockState getRenderedBlockState(KineticTileEntity te) {
return te.getBlockState();
}
}

View file

@ -0,0 +1,176 @@
package com.simibubi.create.modules.kinetics.relays;
import java.util.LinkedList;
import java.util.List;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.foundation.block.IWithoutBlockItem;
import com.simibubi.create.modules.kinetics.base.HorizontalKineticBlock;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
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.Direction;
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.world.IBlockReader;
import net.minecraft.world.World;
public class BeltBlock extends HorizontalKineticBlock implements IWithoutBlockItem {
public static final IProperty<Slope> SLOPE = EnumProperty.create("slope", Slope.class);
public static final IProperty<Part> PART = EnumProperty.create("part", Part.class);
public BeltBlock() {
super(Properties.from(Blocks.BROWN_WOOL));
setDefaultState(getDefaultState().with(SLOPE, Slope.HORIZONTAL).with(PART, Part.START));
}
@Override
protected void fillStateContainer(Builder<Block, BlockState> builder) {
builder.add(SLOPE, PART);
super.fillStateContainer(builder);
}
@Override
public boolean hasTileEntity(BlockState state) {
return true;
}
@Override
public TileEntity createTileEntity(BlockState state, IBlockReader world) {
return new BeltTileEntity();
}
@Override
protected boolean hasStaticPart() {
return false;
}
@Override
public void onReplaced(BlockState state, World worldIn, BlockPos pos, BlockState newState, boolean isMoving) {
if (worldIn.isRemote)
return;
TileEntity tileEntity = worldIn.getTileEntity(pos);
if (tileEntity == null)
return;
if (!(tileEntity instanceof BeltTileEntity))
return;
BeltTileEntity beltEntity = (BeltTileEntity) tileEntity;
BlockPos controller = beltEntity.getController();
beltEntity.setSource(null);
beltEntity.remove();
int limit = 1000;
BlockPos toDestroy = controller;
BlockState destroyedBlock = null;
do {
if (!toDestroy.equals(pos)) {
destroyedBlock = worldIn.getBlockState(toDestroy);
if (!AllBlocks.BELT.typeOf(destroyedBlock))
break;
BeltTileEntity te = (BeltTileEntity) worldIn.getTileEntity(toDestroy);
boolean hasPulley = te.hasPulley();
te.setSource(null);
te.remove();
if (hasPulley) {
worldIn.setBlockState(toDestroy, AllBlocks.AXIS.get().getDefaultState()
.with(BlockStateProperties.AXIS, getRotationAxis(destroyedBlock)), 3);
} else {
worldIn.destroyBlock(toDestroy, false);
}
if (destroyedBlock.get(PART) == Part.END)
break;
}
Slope slope = state.get(SLOPE);
Direction direction = state.get(HORIZONTAL_FACING);
if (slope == Slope.VERTICAL) {
toDestroy = toDestroy.up(direction.getAxisDirection() == AxisDirection.POSITIVE ? 1 : -1);
continue;
}
toDestroy = toDestroy.offset(direction);
if (slope != Slope.HORIZONTAL)
toDestroy = toDestroy.up(slope == Slope.UPWARD ? 1 : -1);
} while (limit-- > 0);
}
@Override
public boolean isAxisTowards(World world, BlockPos pos, BlockState state, Direction face) {
if (face.getAxis() != getRotationAxis(state))
return false;
BeltTileEntity beltEntity = (BeltTileEntity) world.getTileEntity(pos);
return beltEntity != null && beltEntity.hasPulley();
}
@Override
public Axis getRotationAxis(BlockState state) {
return state.get(HORIZONTAL_FACING).getAxis() == Axis.X ? Axis.Z : Axis.X;
}
public enum Slope implements IStringSerializable {
HORIZONTAL, UPWARD, DOWNWARD, VERTICAL;
@Override
public String getName() {
return name().toLowerCase();
}
}
public enum Part implements IStringSerializable {
START, MIDDLE, END;
@Override
public String getName() {
return name().toLowerCase();
}
}
public static List<BlockPos> getBeltChain(World world, BlockPos controllerPos) {
List<BlockPos> positions = new LinkedList<>();
BlockState blockState = world.getBlockState(controllerPos);
if (!AllBlocks.BELT.typeOf(blockState))
return positions;
Slope slope = blockState.get(SLOPE);
Direction direction = blockState.get(HORIZONTAL_FACING);
int limit = 1000;
BlockPos current = controllerPos;
do {
positions.add(current);
if (!AllBlocks.BELT.typeOf(world.getBlockState(current)))
break;
if (world.getBlockState(current).get(PART) == Part.END)
break;
if (slope == Slope.VERTICAL) {
current = current.up(direction.getAxisDirection() == AxisDirection.POSITIVE ? 1 : -1);
continue;
}
current = current.offset(direction);
if (slope != Slope.HORIZONTAL)
current = current.up(slope == Slope.UPWARD ? 1 : -1);
} while (limit-- > 0);
return positions;
}
}

View file

@ -1,14 +1,23 @@
package com.simibubi.create.modules.kinetics.relays;
import com.simibubi.create.AllBlocks;
import java.util.LinkedList;
import java.util.List;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.modules.kinetics.base.KineticTileEntity;
import com.simibubi.create.modules.kinetics.relays.BeltBlock.Part;
import com.simibubi.create.modules.kinetics.relays.BeltBlock.Slope;
import net.minecraft.block.BlockState;
import net.minecraft.item.Item;
import net.minecraft.item.ItemUseContext;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.nbt.NBTUtil;
import net.minecraft.state.properties.BlockStateProperties;
import net.minecraft.util.ActionResultType;
import net.minecraft.util.Direction;
import net.minecraft.util.Direction.Axis;
import net.minecraft.util.Direction.AxisDirection;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
@ -50,11 +59,8 @@ public class BeltItem extends Item {
return ActionResultType.FAIL;
if (!firstPulley.equals(pos)) {
makePulley(world, firstPulley);
makePulley(world, pos);
connectPulley(world, firstPulley, pos, true);
connectPulley(world, pos, firstPulley, false);
createBelts(world, firstPulley, pos);
if (!context.getPlayer().isCreative())
context.getItem().shrink(1);
}
@ -73,19 +79,81 @@ public class BeltItem extends Item {
return ActionResultType.SUCCESS;
}
private void makePulley(World world, BlockPos pos) {
world.setBlockState(pos, AllBlocks.BELT_PULLEY.get().getDefaultState().with(BlockStateProperties.AXIS,
world.getBlockState(pos).get(BlockStateProperties.AXIS)));
}
private void connectPulley(World world, BlockPos pos, BlockPos target, boolean controller) {
BeltPulleyTileEntity te = (BeltPulleyTileEntity) world.getTileEntity(pos);
if (te != null) {
te.setController(controller);
te.setTarget(target);
private void createBelts(World world, BlockPos start, BlockPos end) {
BeltBlock.Slope slope = getSlopeBetween(start, end);
Direction facing = getFacingFromTo(start, end);
BlockPos diff = end.subtract(start);
if (diff.getX() == diff.getZ())
facing = Direction.getFacingFromAxis(facing.getAxisDirection(),
world.getBlockState(start).get(BlockStateProperties.AXIS) == Axis.X ? Axis.Z : Axis.X);
List<BlockPos> beltsToCreate = getBeltChainBetween(start, end, slope, facing);
BlockState beltBlock = AllBlocks.BELT.get().getDefaultState();
for (BlockPos pos : beltsToCreate) {
BeltBlock.Part part = pos.equals(start) ? Part.START : pos.equals(end) ? Part.END : Part.MIDDLE;
world.setBlockState(pos, beltBlock.with(BeltBlock.SLOPE, slope).with(BeltBlock.PART, part)
.with(BeltBlock.HORIZONTAL_FACING, facing), 3);
connectBelt(world, pos, start);
}
}
private Direction getFacingFromTo(BlockPos start, BlockPos end) {
Axis beltAxis = start.getX() == end.getX() ? Axis.Z : Axis.X;
BlockPos diff = end.subtract(start);
AxisDirection axisDirection = AxisDirection.POSITIVE;
if (diff.getX() == 0 && diff.getZ() == 0)
axisDirection = diff.getY() > 0 ? AxisDirection.POSITIVE : AxisDirection.NEGATIVE;
else
axisDirection = beltAxis.getCoordinate(diff.getX(), 0, diff.getZ()) > 0 ? AxisDirection.POSITIVE
: AxisDirection.NEGATIVE;
return Direction.getFacingFromAxis(axisDirection, beltAxis);
}
private Slope getSlopeBetween(BlockPos start, BlockPos end) {
BlockPos diff = end.subtract(start);
if (diff.getY() != 0) {
if (diff.getZ() != 0 || diff.getX() != 0)
return diff.getY() > 0 ? Slope.UPWARD : Slope.DOWNWARD;
return Slope.VERTICAL;
}
return Slope.HORIZONTAL;
}
private List<BlockPos> getBeltChainBetween(BlockPos start, BlockPos end, Slope slope, Direction direction) {
List<BlockPos> positions = new LinkedList<>();
int limit = 1000;
BlockPos current = start;
do {
positions.add(current);
if (slope == Slope.VERTICAL) {
current = current.up(direction.getAxisDirection() == AxisDirection.POSITIVE ? 1 : -1);
continue;
}
current = current.offset(direction);
if (slope != Slope.HORIZONTAL)
current = current.up(slope == Slope.UPWARD ? 1 : -1);
} while (!current.equals(end) && limit-- > 0);
positions.add(end);
return positions;
}
private void connectBelt(World world, BlockPos pos, BlockPos target) {
BeltTileEntity te = (BeltTileEntity) world.getTileEntity(pos);
if (te != null)
te.setController(target);
}
private boolean canConnect(World world, BlockPos first, BlockPos second) {
if (!world.isAreaLoaded(first, 1))
return false;
@ -96,12 +164,25 @@ public class BeltItem extends Item {
BlockPos diff = second.subtract(first);
Axis axis = world.getBlockState(first).get(BlockStateProperties.AXIS);
if (axis.getCoordinate(diff.getX(), diff.getY(), diff.getZ()) != 0)
int x = diff.getX();
int y = diff.getY();
int z = diff.getZ();
int sames = ((Math.abs(x) == Math.abs(y)) ? 1 : 0) + ((Math.abs(y) == Math.abs(z)) ? 1 : 0)
+ ((Math.abs(z) == Math.abs(x)) ? 1 : 0);
if (axis.getCoordinate(x, y, z) != 0)
return false;
if (sames != 1)
return false;
if (axis != world.getBlockState(second).get(BlockStateProperties.AXIS))
return false;
float speed1 = ((KineticTileEntity) world.getTileEntity(first)).getSpeed();
float speed2 = ((KineticTileEntity) world.getTileEntity(second)).getSpeed();
if (speed1 != speed2 && speed1 != 0 && speed2 != 0)
return false;
return true;
}
@ -110,6 +191,8 @@ public class BeltItem extends Item {
return false;
if (!AllBlocks.AXIS.typeOf(world.getBlockState(pos)))
return false;
if (world.getBlockState(pos).get(BlockStateProperties.AXIS) == Axis.Y)
return false;
return true;
}

View file

@ -1,32 +0,0 @@
package com.simibubi.create.modules.kinetics.relays;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.tileentity.TileEntity;
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;
public class BeltPulleyBlock extends AxisBlock {
public BeltPulleyBlock() {
super(Properties.from(Blocks.ANDESITE));
}
@Override
public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) {
return makeCuboidShape(-16, -16, -16, 32, 32, 32);
}
@Override
public TileEntity createTileEntity(BlockState state, IBlockReader world) {
return new BeltPulleyTileEntity();
}
@Override
protected boolean hasStaticPart() {
return false; // static addons like chutes
}
}

View file

@ -1,51 +0,0 @@
package com.simibubi.create.modules.kinetics.relays;
import com.simibubi.create.AllTileEntities;
import com.simibubi.create.modules.kinetics.base.KineticTileEntity;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.nbt.NBTUtil;
import net.minecraft.util.math.BlockPos;
public class BeltPulleyTileEntity extends KineticTileEntity {
protected boolean controller;
protected BlockPos target;
public BeltPulleyTileEntity() {
super(AllTileEntities.BELT_PULLEY.type);
controller = false;
target = BlockPos.ZERO;
}
@Override
public CompoundNBT write(CompoundNBT compound) {
compound.putBoolean("Controller", isController());
compound.put("Target", NBTUtil.writeBlockPos(target));
return super.write(compound);
}
@Override
public void read(CompoundNBT compound) {
controller = compound.getBoolean("Controller");
target = NBTUtil.readBlockPos(compound.getCompound("Target"));
super.read(compound);
}
public void setController(boolean controller) {
this.controller = controller;
}
public boolean isController() {
return controller;
}
public void setTarget(BlockPos target) {
this.target = target;
}
public BlockPos getTarget() {
return target;
}
}

View file

@ -1,235 +0,0 @@
package com.simibubi.create.modules.kinetics.relays;
import java.nio.ByteBuffer;
import java.util.Random;
import java.util.concurrent.TimeUnit;
import org.lwjgl.opengl.GL11;
import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.modules.kinetics.base.KineticTileEntity;
import com.simibubi.create.modules.kinetics.base.KineticTileEntityRenderer;
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.GLAllocation;
import net.minecraft.client.renderer.model.IBakedModel;
import net.minecraft.client.renderer.texture.AtlasTexture;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.state.properties.BlockStateProperties;
import net.minecraft.util.Direction;
import net.minecraft.util.Direction.Axis;
import net.minecraft.util.Direction.AxisDirection;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Vec3d;
import net.minecraftforge.client.model.animation.Animation;
import net.minecraftforge.client.model.data.EmptyModelData;
public class BeltPulleyTileEntityRenderer extends KineticTileEntityRenderer {
protected static Cache<BeltPulleyTileEntity, CachedBeltBuffer> cachedBelts;
public static IBakedModel beltModel;
protected class CachedBeltBuffer {
ByteBuffer original;
ByteBuffer mutable;
public CachedBeltBuffer(ByteBuffer original, float beltLength, float angle, Axis axis) {
original.rewind();
this.original = original;
this.mutable = GLAllocation.createDirectByteBuffer(original.capacity());
this.mutable.order(original.order());
int limitBefore = this.original.limit();
int integerSize = DefaultVertexFormats.BLOCK.getIntegerSize();
int amtBytesCopied = 0; // 2/*Blocks*/ * 6/*Quads*/ * 4/*Vertices*/ * integerSize;
this.original.limit(limitBefore + amtBytesCopied);
this.mutable.limit(limitBefore + amtBytesCopied);
// for (int i = 0; i < amtBytesCopied; i++)
// this.original.put(i + limitBefore, this.original.get(i));
// int vertex = limitBefore / integerSize;
// putPos(this.original, vertex, getPos(this.original, vertex).add(0,1,0));
mutable.put(this.original);
this.original.rewind();
mutable.rewind();
}
private Vec3d getPos(ByteBuffer buffer, int vertex) {
return new Vec3d(buffer.getFloat(vertex), buffer.getFloat(vertex + 4), buffer.getFloat(vertex + 8));
}
private void putPos(ByteBuffer buffer, int vertex, Vec3d pos) {
buffer.putFloat(vertex, (float) pos.x);
buffer.putFloat(vertex + 4, (float) pos.y);
buffer.putFloat(vertex + 8, (float) pos.z);
}
private Vec3d rotatePos(Vec3d pos, float angle, Axis axis) {
return rotatePos(pos, MathHelper.sin(angle), MathHelper.cos(angle), axis);
}
private Vec3d rotatePos(Vec3d pos, float sin, float cos, Axis axis) {
final float x = (float) pos.x;
final float y = (float) pos.y;
final float z = (float) pos.z;
if (axis == Axis.X)
return new Vec3d(x, y * cos - z * sin, z * cos + y * sin);
if (axis == Axis.Y)
return new Vec3d(x * cos + z * sin, y, z * cos - x * sin);
if (axis == Axis.Z)
return new Vec3d(x * cos - y * sin, y * cos + x * sin, z);
return pos;
}
public ByteBuffer getTransformed(Vec3d translation, BeltPulleyTileEntity te, boolean flipped) {
original.rewind();
mutable.rewind();
final Axis axis = te.getBlockState().get(BlockStateProperties.AXIS);
final BlockPos diff = te.getTarget().subtract(te.getPos());
float angle = 0;
if (axis == Axis.X)
angle = (float) MathHelper.atan2(-diff.getY(), diff.getZ());
if (axis == Axis.Y)
angle = (float) MathHelper.atan2(diff.getX(), diff.getZ());
if (axis == Axis.Z)
angle = (float) MathHelper.atan2(diff.getY(), diff.getX());
final float time = Animation.getWorldTime(Minecraft.getInstance().world,
Minecraft.getInstance().getRenderPartialTicks());
final float progress = ((te.getSpeed() * time / 16) % 16) / 16f;
float beltLength = (float) new Vec3d(te.getPos()).distanceTo(new Vec3d(te.getTarget())) + .5f;
final BlockState blockState = te.getBlockState();
final int packedLightCoords = blockState.getPackedLightmapCoords(getWorld(), te.getPos());
final int formatLength = DefaultVertexFormats.BLOCK.getSize();
final Vec3d half = new Vec3d(.5f, .5f, .5f);
final float cos = MathHelper.cos(angle);
final float sin = MathHelper.sin(angle);
final Vec3d offset = new Vec3d(0, .25f, -.25f + progress + (te.getSpeed() < 0 ? 0 : -1));
Vec3d trans = new Vec3d(Direction.getFacingFromAxis(AxisDirection.NEGATIVE, axis).getDirectionVec())
.scale(.5f);
TextureAtlasSprite sprite = Minecraft.getInstance().getTextureMap()
.getSprite(AtlasTexture.LOCATION_BLOCKS_TEXTURE);
final int texHeight = sprite.getHeight();
for (int i = 0; i < original.limit() / formatLength; i++) {
final int position = i * formatLength;
// Cut-off
mutable.putFloat(position + 20, original.getFloat(position + 20));
Vec3d localPos = getPos(this.original, position).add(offset);
if (localPos.z < -.25f) {
mutable.putFloat(position + 20, (float) (original.getFloat(position + 20)
- (Math.min(localPos.z + .25f, 0)) * .5f / texHeight));
localPos = new Vec3d(localPos.x, localPos.y, -.25f);
}
if (localPos.z > beltLength - .25f) {
mutable.putFloat(position + 20, (float) (original.getFloat(position + 20)
- (Math.min(localPos.z - beltLength + .25f, 1f)) * .5f / texHeight));
localPos = new Vec3d(localPos.x, localPos.y, beltLength - .25f);
}
// Transform Vertex
Vec3d pos = localPos;
if (axis == Axis.Z)
pos = rotatePos(pos.subtract(half), (float) (Math.PI / 2f), Axis.Y).add(half);
if (axis == Axis.Y)
pos = rotatePos(pos, (float) (Math.PI / 2f), Axis.Z);
pos = rotatePos(pos, sin, cos, axis).add(trans).add(half);
// Flip
if (flipped) {
pos = rotatePos(pos.subtract(half), (float) Math.PI, axis);
pos = pos.add(half).add(new Vec3d(diff));
}
putPos(mutable, position, pos.add(translation));
mutable.putInt(position + 24, packedLightCoords);
}
return mutable;
}
}
public BeltPulleyTileEntityRenderer() {
super();
cachedBelts = CacheBuilder.newBuilder().expireAfterAccess(1, TimeUnit.SECONDS).build();
}
@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);
BeltPulleyTileEntity beltPulleyTE = (BeltPulleyTileEntity) te;
if (!beltPulleyTE.isController())
return;
cacheBeltIfMissing(beltPulleyTE);
renderBeltFromCache(te, new Vec3d(x, y, z), buffer);
}
@Override
protected BlockState getRenderedBlockState(KineticTileEntity te) {
return AllBlocks.AXIS.get().getDefaultState().with(BlockStateProperties.AXIS,
te.getBlockState().get(BlockStateProperties.AXIS));
}
protected void cacheBeltIfMissing(BeltPulleyTileEntity te) {
if (cachedBelts.getIfPresent(te) != null)
return;
BlockRendererDispatcher dispatcher = Minecraft.getInstance().getBlockRendererDispatcher();
BlockModelRenderer blockRenderer = dispatcher.getBlockModelRenderer();
BufferBuilder builder = new BufferBuilder(0);
Random random = new Random();
builder.begin(GL11.GL_QUADS, DefaultVertexFormats.BLOCK);
float beltLength = (float) new Vec3d(te.getPos()).distanceTo(new Vec3d(te.getTarget())) + .5f;
int length = MathHelper.ceil(beltLength) + 1;
for (int segment = 0; segment < length; segment++) {
builder.setTranslation(0, 0, segment);
blockRenderer.renderModelFlat(getWorld(), beltModel, te.getBlockState(), BlockPos.ZERO, builder, true,
random, 42, EmptyModelData.INSTANCE);
}
builder.finishDrawing();
Axis axis = te.getBlockState().get(BlockStateProperties.AXIS);
BlockPos diff = te.getTarget().subtract(te.getPos());
float angle = 0;
if (axis == Axis.X)
angle = (float) MathHelper.atan2(-diff.getY(), diff.getZ());
if (axis == Axis.Y)
angle = (float) MathHelper.atan2(diff.getX(), diff.getZ());
if (axis == Axis.Z)
angle = (float) MathHelper.atan2(diff.getY(), diff.getX());
cachedBelts.put(te, new CachedBeltBuffer(builder.getByteBuffer(), beltLength, angle, axis));
}
public void renderBeltFromCache(KineticTileEntity te, Vec3d translation, BufferBuilder buffer) {
if (buffer == null)
return;
buffer.putBulkData(cachedBelts.getIfPresent(te).getTransformed(translation, (BeltPulleyTileEntity) te, false));
buffer.putBulkData(cachedBelts.getIfPresent(te).getTransformed(translation, (BeltPulleyTileEntity) te, true));
}
}

View file

@ -0,0 +1,51 @@
package com.simibubi.create.modules.kinetics.relays;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllTileEntities;
import com.simibubi.create.modules.kinetics.base.KineticTileEntity;
import com.simibubi.create.modules.kinetics.relays.BeltBlock.Part;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.nbt.NBTUtil;
import net.minecraft.util.math.BlockPos;
public class BeltTileEntity extends KineticTileEntity {
protected BlockPos controller;
public BeltTileEntity() {
super(AllTileEntities.BELT.type);
controller = BlockPos.ZERO;
}
@Override
public CompoundNBT write(CompoundNBT compound) {
compound.put("Controller", NBTUtil.writeBlockPos(controller));
return super.write(compound);
}
@Override
public void read(CompoundNBT compound) {
controller = NBTUtil.readBlockPos(compound.getCompound("Controller"));
super.read(compound);
}
public void setController(BlockPos controller) {
this.controller = controller;
}
public BlockPos getController() {
return controller;
}
public boolean isController() {
return controller.equals(pos);
}
public boolean hasPulley() {
if (!AllBlocks.BELT.typeOf(getBlockState()))
return false;
return getBlockState().get(BeltBlock.PART) == Part.END || getBlockState().get(BeltBlock.PART) == Part.START;
}
}

View file

@ -0,0 +1,102 @@
package com.simibubi.create.modules.kinetics.relays;
import java.nio.ByteBuffer;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.Create;
import com.simibubi.create.foundation.utility.BufferManipulator;
import com.simibubi.create.modules.kinetics.base.IRotate;
import com.simibubi.create.modules.kinetics.base.KineticTileEntity;
import com.simibubi.create.modules.kinetics.base.KineticTileEntityRenderer;
import net.minecraft.block.BlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.BufferBuilder;
import net.minecraft.client.renderer.texture.AtlasTexture;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.state.properties.BlockStateProperties;
import net.minecraft.util.Direction;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.Vec3d;
import net.minecraftforge.client.model.animation.Animation;
public class BeltTileEntityRenderer extends KineticTileEntityRenderer {
protected static class BeltModelAnimator extends BufferManipulator {
protected static TextureAtlasSprite beltTextures;
protected static TextureAtlasSprite originalTexture;
public BeltModelAnimator(ByteBuffer template) {
super(template);
if (beltTextures == null)
initSprites();
}
private void initSprites() {
AtlasTexture textureMap = Minecraft.getInstance().getTextureMap();
originalTexture = textureMap.getSprite(new ResourceLocation(Create.ID, "block/belt"));
beltTextures = textureMap.getSprite(new ResourceLocation(Create.ID, "block/belt_animated"));
}
public ByteBuffer getTransformed(Vec3d translation, BeltTileEntity te) {
original.rewind();
mutable.rewind();
float textureOffsetX = 0;
float textureOffsetY = 0;
if (te.getSpeed() != 0) {
float time = Animation.getWorldTime(Minecraft.getInstance().world,
Minecraft.getInstance().getRenderPartialTicks());
Direction direction = te.getBlockState().get(BlockStateProperties.HORIZONTAL_FACING);
if (direction == Direction.EAST || direction == Direction.NORTH)
time = -time;
int textureIndex = (int) ((te.getSpeed() * time / 8) % 16);
if (textureIndex < 0)
textureIndex += 16;
textureOffsetX = beltTextures.getInterpolatedU((textureIndex % 4) * 4) - originalTexture.getMinU();
textureOffsetY = beltTextures.getInterpolatedV((textureIndex / 4) * 4) - originalTexture.getMinV();
}
final BlockState blockState = te.getBlockState();
final int packedLightCoords = blockState.getPackedLightmapCoords(te.getWorld(), te.getPos());
final float texOffX = textureOffsetX;
final float texOffY = textureOffsetY;
forEachVertex(original, index -> {
Vec3d pos = getPos(original, index);
putPos(mutable, index, pos.add(translation));
mutable.putFloat(index + 16, original.getFloat(index + 16) + texOffX);
mutable.putFloat(index + 20, original.getFloat(index + 20) + texOffY);
mutable.putInt(index + 24, packedLightCoords);
});
return mutable;
}
}
@Override
public void renderTileEntityFast(KineticTileEntity te, double x, double y, double z, float partialTicks,
int destroyStage, BufferBuilder buffer) {
BeltTileEntity beltEntity = (BeltTileEntity) te;
if (beltEntity.hasPulley())
super.renderTileEntityFast(te, x, y, z, partialTicks, destroyStage, buffer);
cacheIfMissing(beltEntity.getBlockState(), BeltModelAnimator::new);
renderBeltFromCache(beltEntity, new Vec3d(x, y, z), buffer);
}
@Override
protected BlockState getRenderedBlockState(KineticTileEntity te) {
return AllBlocks.AXIS.get().getDefaultState().with(BlockStateProperties.AXIS,
((IRotate) AllBlocks.BELT.get()).getRotationAxis(te.getBlockState()));
}
public void renderBeltFromCache(BeltTileEntity te, Vec3d translation, BufferBuilder buffer) {
buffer.putBulkData(((BeltModelAnimator) cachedBuffers.get(te.getBlockState())).getTransformed(translation, te));
}
}

View file

@ -33,7 +33,7 @@ public class GearboxTileEntityRenderer extends KineticTileEntityRenderer {
continue;
BlockState state = defaultState.with(BlockStateProperties.FACING, direction);
cacheIfMissing(state);
cacheIfMissing(state, BlockModelSpinner::new);
float offset = getRotationOffsetForPosition(te, pos, axis);
float angle = (time * te.getSpeed()) % 360;

View file

@ -31,7 +31,7 @@ public class GearshifterTileEntityRenderer extends KineticTileEntityRenderer {
continue;
BlockState state = defaultState.with(BlockStateProperties.FACING, direction);
cacheIfMissing(state);
cacheIfMissing(state, BlockModelSpinner::new);
float offset = getRotationOffsetForPosition(te, pos, axis);
float angle = (time * te.getSpeed()) % 360;

View file

@ -1,9 +1,75 @@
{
"forgemarker": 1,
"defaults": {
"model": "create:block/belt"
"model": "create:block/belt/horizontal_middle"
},
"variants": {
"": { "model": "create:block/belt" }
"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 },
"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 },
"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 },
"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 },
"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 },
"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 },
"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 },
"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 },
"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 }
}
}
}

View file

@ -0,0 +1,9 @@
{
"forgemarker": 1,
"defaults": {
"model": "create:block/belt/belt_textures"
},
"variants": {
"": { "model": "create:block/belt/belt_textures" }
}
}

View file

@ -1,11 +0,0 @@
{
"forgemarker": 1,
"defaults": {
"model": "block/dirt"
},
"variants": {
"axis=y": { "model": "block/dirt" },
"axis=z": { "model": "block/dirt", "x": 90 },
"axis=x": { "model": "block/dirt", "x": 90, "y": 90 }
}
}

View file

@ -8,7 +8,7 @@
"item.create.chorus_chrome_cube": "Chorus Chrome",
"item.create.blueprint_and_quill": "Schematic and Quill",
"item.create.blueprint": "Schematic",
"item.create.belt": "Mechanical Belt",
"item.create.belt_connector": "Mechanical Belt",
"block.create.gear": "Cogwheel",
"block.create.large_gear": "Large Cogwheel",
"block.create.turntable": "Turntable",
@ -17,7 +17,7 @@
"block.create.axis_tunnel": "Encased Axis",
"block.create.axis": "Axis",
"block.create.motor": "Motor",
"block.create.belt_pulley": "Belt Pulley",
"block.create.belt": "Mechanical Belt",
"block.create.schematicannon": "Schematicannon",
"block.create.schematic_table": "Schematic Table",
"block.create.creative_crate": "Schematicannon Creatifier",

View file

@ -0,0 +1,16 @@
{
"parent": "block/cube",
"textures": {
"0": "create:block/belt_animated"
},
"elements": [
{
"name": "Cheese",
"from": [ 0.0, 0.0, 0.0 ],
"to": [ 1.0, 1.0, 1.0 ],
"faces": {
"north": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 16.0 ] }
}
}
]
}

View file

@ -0,0 +1,73 @@
{
"__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)",
"parent": "block/cube",
"textures": {
"particle": "create:block/belt",
"0": "create:block/belt"
},
"elements": [
{
"name": "Top",
"from": [ 1.0, 11.0, 1.0 ],
"to": [ 15.0, 13.0, 6.8 ],
"faces": {
"north": { "texture": "#0", "uv": [ 1.0, 11.0, 15.0, 13.0 ] },
"east": { "texture": "#0", "uv": [ 0.0, 1.0, 2.0, 7.0 ], "rotation": 270 },
"west": { "texture": "#0", "uv": [ 14.0, 1.0, 16.0, 7.0 ], "rotation": 90 },
"up": { "texture": "#0", "uv": [ 1.0, 1.0, 15.0, 6.8 ], "rotation": 180 },
"down": { "texture": "#0", "uv": [ 1.0, 1.0, 15.0, 6.8 ] }
}
},
{
"name": "Bottom",
"from": [ 1.0, 3.0, 1.0 ],
"to": [ 15.0, 5.0, 10.1 ],
"faces": {
"north": { "texture": "#0", "uv": [ 1.0, 3.0, 15.0, 5.0 ] },
"east": { "texture": "#0", "uv": [ 0.0, 1.0, 2.0, 10.0 ], "rotation": 90 },
"west": { "texture": "#0", "uv": [ 14.0, 1.0, 16.0, 10.0 ], "rotation": 270 },
"up": { "texture": "#0", "uv": [ 1.0, 1.0, 15.0, 10.0 ] },
"down": { "texture": "#0", "uv": [ 1.0, 1.0, 15.0, 10.0 ], "rotation": 180 }
}
},
{
"name": "Side",
"from": [ 1.0, 4.0, 0.0 ],
"to": [ 15.0, 12.0, 2.0 ],
"faces": {
"north": { "texture": "#0", "uv": [ 1.0, 4.0, 15.0, 12.0 ] },
"east": { "texture": "#0", "uv": [ 0.0, 4.0, 2.0, 12.0 ] },
"south": { "texture": "#0", "uv": [ 1.0, 4.0, 15.0, 12.0 ] },
"west": { "texture": "#0", "uv": [ 14.0, 4.0, 16.0, 12.0 ] },
"up": { "texture": "#0", "uv": [ 1.0, 3.0, 15.0, 5.0 ], "rotation": 180 },
"down": { "texture": "#0", "uv": [ 1.0, 11.0, 15.0, 13.0 ], "rotation": 180 }
}
},
{
"name": "Top Diagonal",
"from": [ 1.0, 11.0, 9.2 ],
"to": [ 15.0, 13.0, 19.325 ],
"rotation": { "origin": [ 8.0, 8.0, 8.0 ], "axis": "x", "angle": -45.0 },
"faces": {
"north": { "texture": "#0", "uv": [ 1.0, 11.0, 15.0, 13.0 ], "rotation": 180 },
"east": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 10.0 ], "rotation": 270 },
"west": { "texture": "#0", "uv": [ 14.0, 0.0, 16.0, 10.0 ], "rotation": 90 },
"up": { "texture": "#0", "uv": [ 1.0, 0.0, 15.0, 10.2 ], "rotation": 180 },
"down": { "texture": "#0", "uv": [ 1.0, 0.0, 15.0, 10.2 ] }
}
},
{
"name": "Bottom Diagonal",
"from": [ 1.0, 3.0, 5.9 ],
"to": [ 15.0, 5.0, 19.325 ],
"rotation": { "origin": [ 8.0, 8.0, 8.0 ], "axis": "x", "angle": -45.0 },
"faces": {
"north": { "texture": "#0", "uv": [ 1.0, 3.0, 15.0, 5.0 ] },
"east": { "texture": "#0", "uv": [ 0.0, 3.0, 2.0, 16.0 ], "rotation": 90 },
"west": { "texture": "#0", "uv": [ 14.0, 3.0, 16.0, 16.0 ], "rotation": 270 },
"up": { "texture": "#0", "uv": [ 1.0, 3.0, 15.0, 16.0 ] },
"down": { "texture": "#0", "uv": [ 1.0, 3.0, 15.0, 16.0 ], "rotation": 180 }
}
}
]
}

View file

@ -0,0 +1,62 @@
{
"__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)",
"parent": "block/cube",
"textures": {
"particle": "create:block/belt",
"0": "create:block/belt"
},
"elements": [
{
"name": "Bottom Diagonal",
"from": [ 1.0, 3.0, -3.325 ],
"to": [ 15.0, 5.0, 6.6 ],
"rotation": { "origin": [ 8.0, 8.0, 8.0 ], "axis": "x", "angle": -45.0 },
"faces": {
"north": { "texture": "#0", "uv": [ 1.0, 11.0, 15.0, 13.0 ], "rotation": 180 },
"east": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 10.0 ], "rotation": 90 },
"west": { "texture": "#0", "uv": [ 14.0, 0.0, 16.0, 10.0 ], "rotation": 270 },
"up": { "texture": "#0", "uv": [ 1.0, 0.0, 15.0, 10.1 ] },
"down": { "texture": "#0", "uv": [ 1.0, 0.0, 15.0, 10.2 ], "rotation": 180 }
}
},
{
"name": "Top Diagonal",
"from": [ 1.0, 11.0, -3.325 ],
"to": [ 15.0, 13.0, 10.0 ],
"rotation": { "origin": [ 8.0, 8.0, 8.0 ], "axis": "x", "angle": -45.0 },
"faces": {
"north": { "texture": "#0", "uv": [ 1.0, 3.0, 15.0, 5.0 ] },
"east": { "texture": "#0", "uv": [ 0.0, 3.0, 2.0, 16.0 ], "rotation": 270 },
"west": { "texture": "#0", "uv": [ 14.0, 3.0, 16.0, 16.0 ], "rotation": 90 },
"up": { "texture": "#0", "uv": [ 1.0, 3.0, 15.0, 16.0 ], "rotation": 180 },
"down": { "texture": "#0", "uv": [ 1.0, 3.0, 15.0, 16.0 ] }
}
},
{
"name": "Top Diagonal First",
"from": [ 1.0, 11.0, 9.98 ],
"to": [ 15.0, 13.0, 19.3 ],
"rotation": { "origin": [ 8.0, 8.0, 8.0 ], "axis": "x", "angle": -45.0 },
"faces": {
"north": { "texture": "#0", "uv": [ 1.0, 11.0, 15.0, 13.0 ] },
"east": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 10.0 ], "rotation": 270 },
"west": { "texture": "#0", "uv": [ 14.0, 0.0, 16.0, 10.0 ], "rotation": 90 },
"up": { "texture": "#0", "uv": [ 1.0, 0.0, 15.0, 10.2 ], "rotation": 180 },
"down": { "texture": "#0", "uv": [ 1.0, 0.0, 15.0, 10.2 ] }
}
},
{
"name": "Bottom Diagonal First",
"from": [ 1.0, 3.0, 6.58 ],
"to": [ 15.0, 5.0, 19.3 ],
"rotation": { "origin": [ 8.0, 8.0, 8.0 ], "axis": "x", "angle": -45.0 },
"faces": {
"north": { "texture": "#0", "uv": [ 1.0, 3.0, 15.0, 5.0 ] },
"east": { "texture": "#0", "uv": [ 0.0, 3.0, 2.0, 16.0 ], "rotation": 90 },
"west": { "texture": "#0", "uv": [ 14.0, 3.0, 16.0, 16.0 ], "rotation": 270 },
"up": { "texture": "#0", "uv": [ 1.0, 3.0, 15.0, 16.0 ] },
"down": { "texture": "#0", "uv": [ 1.0, 3.0, 15.0, 16.0 ], "rotation": 180 }
}
}
]
}

View file

@ -0,0 +1,73 @@
{
"__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)",
"parent": "block/cube",
"textures": {
"particle": "create:block/belt",
"0": "create:block/belt"
},
"elements": [
{
"name": "Bottom",
"from": [ 1.0, 3.0, 9.2 ],
"to": [ 15.0, 5.0, 15.0 ],
"faces": {
"east": { "texture": "#0", "uv": [ 0.0, 9.0, 2.0, 15.0 ], "rotation": 90 },
"south": { "texture": "#0", "uv": [ 1.0, 3.0, 15.0, 5.0 ], "rotation": 180 },
"west": { "texture": "#0", "uv": [ 14.0, 9.0, 16.0, 15.0 ], "rotation": 270 },
"up": { "texture": "#0", "uv": [ 1.0, 9.0, 15.0, 14.8 ] },
"down": { "texture": "#0", "uv": [ 1.0, 9.0, 15.0, 14.8 ], "rotation": 180 }
}
},
{
"name": "Top",
"from": [ 1.0, 11.0, 5.9 ],
"to": [ 15.0, 13.0, 15.0 ],
"faces": {
"east": { "texture": "#0", "uv": [ 0.0, 1.0, 2.0, 10.0 ], "rotation": 270 },
"south": { "texture": "#0", "uv": [ 1.0, 13.0, 15.0, 11.0 ], "rotation": 180 },
"west": { "texture": "#0", "uv": [ 14.0, 1.0, 16.0, 10.0 ], "rotation": 90 },
"up": { "texture": "#0", "uv": [ 1.0, 1.0, 15.0, 10.0 ], "rotation": 180 },
"down": { "texture": "#0", "uv": [ 1.0, 1.0, 15.0, 10.0 ] }
}
},
{
"name": "Side",
"from": [ 1.0, 4.0, 14.0 ],
"to": [ 15.0, 12.0, 16.0 ],
"faces": {
"north": { "texture": "#0", "uv": [ 1.0, 4.0, 15.0, 12.0 ], "rotation": 180 },
"east": { "texture": "#0", "uv": [ 0.0, 4.0, 2.0, 12.0 ], "rotation": 180 },
"south": { "texture": "#0", "uv": [ 1.0, 4.0, 15.0, 12.0 ], "rotation": 180 },
"west": { "texture": "#0", "uv": [ 14.0, 4.0, 16.0, 12.0 ], "rotation": 180 },
"up": { "texture": "#0", "uv": [ 1.0, 3.0, 15.0, 5.0 ] },
"down": { "texture": "#0", "uv": [ 1.0, 11.0, 15.0, 13.0 ] }
}
},
{
"name": "Bottom Diagonal",
"from": [ 1.0, 3.0, -3.328 ],
"to": [ 15.0, 5.0, 6.75 ],
"rotation": { "origin": [ 8.0, 8.0, 8.0 ], "axis": "x", "angle": -45.0 },
"faces": {
"north": { "texture": "#0", "uv": [ 1.0, 11.0, 15.0, 13.0 ], "rotation": 180 },
"east": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 10.0 ], "rotation": 90 },
"west": { "texture": "#0", "uv": [ 14.0, 0.0, 16.0, 10.0 ], "rotation": 270 },
"up": { "texture": "#0", "uv": [ 1.0, 0.0, 15.0, 10.1 ] },
"down": { "texture": "#0", "uv": [ 1.0, 0.0, 15.0, 10.2 ], "rotation": 180 }
}
},
{
"name": "Top Diagonal",
"from": [ 1.0, 11.0, -3.328 ],
"to": [ 15.0, 13.0, 10.1 ],
"rotation": { "origin": [ 8.0, 8.0, 8.0 ], "axis": "x", "angle": -45.0 },
"faces": {
"north": { "texture": "#0", "uv": [ 1.0, 3.0, 15.0, 5.0 ] },
"east": { "texture": "#0", "uv": [ 0.0, 3.0, 2.0, 16.0 ], "rotation": 270 },
"west": { "texture": "#0", "uv": [ 14.0, 3.0, 16.0, 16.0 ], "rotation": 90 },
"up": { "texture": "#0", "uv": [ 1.0, 3.0, 15.0, 16.0 ], "rotation": 180 },
"down": { "texture": "#0", "uv": [ 1.0, 3.0, 15.0, 16.0 ] }
}
}
]
}

View file

@ -0,0 +1,47 @@
{
"__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)",
"parent": "block/cube",
"textures": {
"particle": "create:block/belt",
"0": "create:block/belt"
},
"elements": [
{
"name": "Bottom",
"from": [ 1.0, 3.0, 1.0 ],
"to": [ 15.0, 5.0, 16.0 ],
"faces": {
"north": { "texture": "#0", "uv": [ 1.0, 11.0, 15.0, 13.0 ], "rotation": 180 },
"east": { "texture": "#0", "uv": [ 0.0, 1.0, 2.0, 16.0 ], "rotation": 90 },
"west": { "texture": "#0", "uv": [ 14.0, 1.0, 16.0, 16.0 ], "rotation": 270 },
"up": { "texture": "#0", "uv": [ 1.0, 1.0, 15.0, 16.0 ] },
"down": { "texture": "#0", "uv": [ 1.0, 1.0, 15.0, 16.0 ], "rotation": 180 }
}
},
{
"name": "Top",
"from": [ 1.0, 11.0, 1.0 ],
"to": [ 15.0, 13.0, 16.0 ],
"faces": {
"north": { "texture": "#0", "uv": [ 1.0, 3.0, 15.0, 5.0 ] },
"east": { "texture": "#0", "uv": [ 0.0, 1.0, 2.0, 16.0 ], "rotation": 270 },
"west": { "texture": "#0", "uv": [ 14.0, 1.0, 16.0, 16.0 ], "rotation": 90 },
"up": { "texture": "#0", "uv": [ 1.0, 0.0, 15.0, 15.0 ], "rotation": 180 },
"down": { "texture": "#0", "uv": [ 1.0, 1.0, 15.0, 16.0 ] }
}
},
{
"name": "Side",
"from": [ 1.0, 4.0, 0.0 ],
"to": [ 15.0, 12.0, 2.0 ],
"faces": {
"north": { "texture": "#0", "uv": [ 1.0, 4.0, 15.0, 12.0 ] },
"east": { "texture": "#0", "uv": [ 0.0, 4.0, 2.0, 12.0 ] },
"south": { "texture": "#0", "uv": [ 1.0, 4.0, 15.0, 12.0 ] },
"west": { "texture": "#0", "uv": [ 14.0, 4.0, 16.0, 12.0 ] },
"up": { "texture": "#0", "uv": [ 1.0, 3.0, 15.0, 5.0 ], "rotation": 180 },
"down": { "texture": "#0", "uv": [ 1.0, 11.0, 15.0, 13.0 ], "rotation": 180 }
}
}
]
}

View file

@ -0,0 +1,32 @@
{
"__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)",
"parent": "block/cube",
"textures": {
"particle": "create:block/belt",
"0": "create:block/belt"
},
"elements": [
{
"name": "Bottom",
"from": [ 1.0, 3.0, 0.0 ],
"to": [ 15.0, 5.0, 16.0 ],
"faces": {
"east": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 16.0 ], "rotation": 90 },
"west": { "texture": "#0", "uv": [ 14.0, 0.0, 16.0, 16.0 ], "rotation": 270 },
"up": { "texture": "#0", "uv": [ 1.0, 0.0, 15.0, 16.0 ] },
"down": { "texture": "#0", "uv": [ 1.0, 0.0, 15.0, 16.0 ], "rotation": 180 }
}
},
{
"name": "Top",
"from": [ 1.0, 11.0, 0.0 ],
"to": [ 15.0, 13.0, 16.0 ],
"faces": {
"east": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 16.0 ], "rotation": 270 },
"west": { "texture": "#0", "uv": [ 14.0, 0.0, 16.0, 16.0 ], "rotation": 90 },
"up": { "texture": "#0", "uv": [ 1.0, 0.0, 15.0, 16.0 ], "rotation": 180 },
"down": { "texture": "#0", "uv": [ 1.0, 0.0, 15.0, 16.0 ] }
}
}
]
}

View file

@ -0,0 +1,47 @@
{
"__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)",
"parent": "block/cube",
"textures": {
"particle": "create:block/belt",
"0": "create:block/belt"
},
"elements": [
{
"name": "Bottom",
"from": [ 1.0, 3.0, 0.0 ],
"to": [ 15.0, 5.0, 15.0 ],
"faces": {
"east": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 15.0 ], "rotation": 90 },
"south": { "texture": "#0", "uv": [ 1.0, 3.0, 15.0, 5.0 ], "rotation": 180 },
"west": { "texture": "#0", "uv": [ 14.0, 0.0, 16.0, 15.0 ], "rotation": 270 },
"up": { "texture": "#0", "uv": [ 1.0, 0.0, 15.0, 15.0 ] },
"down": { "texture": "#0", "uv": [ 1.0, 0.0, 15.0, 15.0 ], "rotation": 180 }
}
},
{
"name": "Top",
"from": [ 1.0, 11.0, 0.0 ],
"to": [ 15.0, 13.0, 15.0 ],
"faces": {
"east": { "texture": "#0", "uv": [ 0.0, 1.0, 2.0, 16.0 ], "rotation": 270 },
"south": { "texture": "#0", "uv": [ 1.0, 5.0, 15.0, 3.0 ] },
"west": { "texture": "#0", "uv": [ 14.0, 1.0, 16.0, 16.0 ], "rotation": 90 },
"up": { "texture": "#0", "uv": [ 1.0, 1.0, 15.0, 16.0 ], "rotation": 180 },
"down": { "texture": "#0", "uv": [ 1.0, 1.0, 15.0, 16.0 ] }
}
},
{
"name": "Side",
"from": [ 1.0, 4.0, 14.0 ],
"to": [ 15.0, 12.0, 16.0 ],
"faces": {
"north": { "texture": "#0", "uv": [ 1.0, 4.0, 15.0, 12.0 ], "rotation": 180 },
"east": { "texture": "#0", "uv": [ 0.0, 4.0, 2.0, 12.0 ], "rotation": 180 },
"south": { "texture": "#0", "uv": [ 1.0, 4.0, 15.0, 12.0 ], "rotation": 180 },
"west": { "texture": "#0", "uv": [ 14.0, 4.0, 16.0, 12.0 ], "rotation": 180 },
"up": { "texture": "#0", "uv": [ 1.0, 3.0, 15.0, 5.0 ], "rotation": 180 },
"down": { "texture": "#0", "uv": [ 1.0, 11.0, 15.0, 13.0 ], "rotation": 180 }
}
}
]
}

View file

@ -0,0 +1,73 @@
{
"__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)",
"parent": "block/cube",
"textures": {
"particle": "create:block/belt",
"0": "create:block/belt"
},
"elements": [
{
"name": "Bottom",
"from": [ 1.0, 3.0, 1.0 ],
"to": [ 15.0, 5.0, 6.8 ],
"faces": {
"north": { "texture": "#0", "uv": [ 1.0, 11.0, 15.0, 13.0 ], "rotation": 180 },
"east": { "texture": "#0", "uv": [ 0.0, 1.0, 2.0, 7.0 ], "rotation": 90 },
"west": { "texture": "#0", "uv": [ 14.0, 1.0, 16.0, 7.0 ], "rotation": 270 },
"up": { "texture": "#0", "uv": [ 1.0, 1.0, 15.0, 6.8 ] },
"down": { "texture": "#0", "uv": [ 1.0, 1.0, 15.0, 6.8 ], "rotation": 180 }
}
},
{
"name": "Top",
"from": [ 1.0, 11.0, 1.0 ],
"to": [ 15.0, 13.0, 10.1 ],
"faces": {
"north": { "texture": "#0", "uv": [ 1.0, 3.0, 15.0, 5.0 ] },
"east": { "texture": "#0", "uv": [ 0.0, 6.0, 2.0, 15.0 ], "rotation": 270 },
"west": { "texture": "#0", "uv": [ 14.0, 6.0, 16.0, 15.0 ], "rotation": 90 },
"up": { "texture": "#0", "uv": [ 1.0, 6.0, 15.0, 15.0 ], "rotation": 180 },
"down": { "texture": "#0", "uv": [ 1.0, 6.0, 15.0, 15.0 ] }
}
},
{
"name": "Side",
"from": [ 1.0, 4.0, 0.0 ],
"to": [ 15.0, 12.0, 2.0 ],
"faces": {
"north": { "texture": "#0", "uv": [ 1.0, 4.0, 15.0, 12.0 ] },
"east": { "texture": "#0", "uv": [ 0.0, 4.0, 2.0, 12.0 ] },
"south": { "texture": "#0", "uv": [ 1.0, 4.0, 15.0, 12.0 ] },
"west": { "texture": "#0", "uv": [ 14.0, 4.0, 16.0, 12.0 ] },
"up": { "texture": "#0", "uv": [ 1.0, 3.0, 15.0, 5.0 ], "rotation": 180 },
"down": { "texture": "#0", "uv": [ 1.0, 11.0, 15.0, 13.0 ], "rotation": 180 }
}
},
{
"name": "Bottom Diagonal",
"from": [ 1.0, 3.0, 9.2 ],
"to": [ 15.0, 5.0, 19.3 ],
"rotation": { "origin": [ 8.0, 8.0, 8.0 ], "axis": "x", "angle": 45.0 },
"faces": {
"north": { "texture": "#0", "uv": [ 1.0, 11.0, 15.0, 13.0 ], "rotation": 180 },
"east": { "texture": "#0", "uv": [ 0.0, 1.0, 2.0, 11.0 ], "rotation": 90 },
"west": { "texture": "#0", "uv": [ 14.0, 1.0, 16.0, 11.0 ], "rotation": 270 },
"up": { "texture": "#0", "uv": [ 1.0, 1.0, 15.0, 11.1 ] },
"down": { "texture": "#0", "uv": [ 1.0, 1.0, 15.0, 11.1 ], "rotation": 180 }
}
},
{
"name": "Top Diagonal",
"from": [ 1.0, 11.0, 5.9 ],
"to": [ 15.0, 13.0, 19.3 ],
"rotation": { "origin": [ 8.0, 8.0, 8.0 ], "axis": "x", "angle": 45.0 },
"faces": {
"north": { "texture": "#0", "uv": [ 1.0, 3.0, 15.0, 5.0 ] },
"east": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 13.0 ], "rotation": 270 },
"west": { "texture": "#0", "uv": [ 14.0, 0.0, 16.0, 13.0 ], "rotation": 90 },
"up": { "texture": "#0", "uv": [ 1.0, 0.0, 15.0, 13.0 ], "rotation": 180 },
"down": { "texture": "#0", "uv": [ 1.0, 0.0, 15.0, 13.0 ] }
}
}
]
}

View file

@ -0,0 +1,62 @@
{
"__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)",
"parent": "block/cube",
"textures": {
"particle": "create:block/belt",
"0": "create:block/belt"
},
"elements": [
{
"name": "Bottom Diagonal",
"from": [ 1.0, 3.0, -3.325 ],
"to": [ 15.0, 5.0, 6.6 ],
"rotation": { "origin": [ 8.0, 8.0, 8.0 ], "axis": "x", "angle": 45.0 },
"faces": {
"north": { "texture": "#0", "uv": [ 1.0, 11.0, 15.0, 13.0 ], "rotation": 180 },
"east": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 10.0 ], "rotation": 90 },
"west": { "texture": "#0", "uv": [ 14.0, 0.0, 16.0, 10.0 ], "rotation": 270 },
"up": { "texture": "#0", "uv": [ 1.0, 0.0, 15.0, 10.1 ] },
"down": { "texture": "#0", "uv": [ 1.0, 0.0, 15.0, 10.2 ], "rotation": 180 }
}
},
{
"name": "Top Diagonal",
"from": [ 1.0, 11.0, -3.325 ],
"to": [ 15.0, 13.0, 10.0 ],
"rotation": { "origin": [ 8.0, 8.0, 8.0 ], "axis": "x", "angle": 45.0 },
"faces": {
"north": { "texture": "#0", "uv": [ 1.0, 3.0, 15.0, 5.0 ] },
"east": { "texture": "#0", "uv": [ 0.0, 3.0, 2.0, 16.0 ], "rotation": 270 },
"west": { "texture": "#0", "uv": [ 14.0, 3.0, 16.0, 16.0 ], "rotation": 90 },
"up": { "texture": "#0", "uv": [ 1.0, 3.0, 15.0, 16.0 ], "rotation": 180 },
"down": { "texture": "#0", "uv": [ 1.0, 3.0, 15.0, 16.0 ] }
}
},
{
"name": "Top Diagonal First",
"from": [ 1.0, 11.0, 10.0 ],
"to": [ 15.0, 13.0, 19.3 ],
"rotation": { "origin": [ 8.0, 8.0, 8.0 ], "axis": "x", "angle": 45.0 },
"faces": {
"north": { "texture": "#0", "uv": [ 1.0, 11.0, 15.0, 13.0 ] },
"east": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 10.0 ], "rotation": 270 },
"west": { "texture": "#0", "uv": [ 14.0, 0.0, 16.0, 10.0 ], "rotation": 90 },
"up": { "texture": "#0", "uv": [ 1.0, 0.0, 15.0, 10.2 ], "rotation": 180 },
"down": { "texture": "#0", "uv": [ 1.0, 0.0, 15.0, 10.2 ] }
}
},
{
"name": "Bottom Diagonal First",
"from": [ 1.0, 3.0, 6.6 ],
"to": [ 15.0, 5.0, 19.3 ],
"rotation": { "origin": [ 8.0, 8.0, 8.0 ], "axis": "x", "angle": 45.0 },
"faces": {
"north": { "texture": "#0", "uv": [ 1.0, 3.0, 15.0, 5.0 ] },
"east": { "texture": "#0", "uv": [ 0.0, 3.0, 2.0, 16.0 ], "rotation": 90 },
"west": { "texture": "#0", "uv": [ 14.0, 3.0, 16.0, 16.0 ], "rotation": 270 },
"up": { "texture": "#0", "uv": [ 1.0, 3.0, 15.0, 16.0 ] },
"down": { "texture": "#0", "uv": [ 1.0, 3.0, 15.0, 16.0 ], "rotation": 180 }
}
}
]
}

View file

@ -0,0 +1,73 @@
{
"__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)",
"parent": "block/cube",
"textures": {
"particle": "create:block/belt",
"0": "create:block/belt"
},
"elements": [
{
"name": "Top",
"from": [ 1.0, 11.0, 9.2 ],
"to": [ 15.0, 13.0, 15.0 ],
"faces": {
"east": { "texture": "#0", "uv": [ 0.0, 1.0, 2.0, 7.0 ], "rotation": 270 },
"south": { "texture": "#0", "uv": [ 1.0, 11.0, 15.0, 13.0 ], "rotation": 180 },
"west": { "texture": "#0", "uv": [ 14.0, 1.0, 16.0, 7.0 ], "rotation": 90 },
"up": { "texture": "#0", "uv": [ 1.0, 1.0, 15.0, 6.8 ], "rotation": 180 },
"down": { "texture": "#0", "uv": [ 1.0, 1.0, 15.0, 6.8 ] }
}
},
{
"name": "Bottom",
"from": [ 1.0, 3.0, 5.9 ],
"to": [ 15.0, 5.0, 15.0 ],
"faces": {
"east": { "texture": "#0", "uv": [ 0.0, 6.0, 2.0, 15.0 ], "rotation": 90 },
"south": { "texture": "#0", "uv": [ 1.0, 5.0, 15.0, 3.0 ], "rotation": 180 },
"west": { "texture": "#0", "uv": [ 14.0, 6.0, 16.0, 15.0 ], "rotation": 270 },
"up": { "texture": "#0", "uv": [ 1.0, 6.0, 15.0, 15.0 ] },
"down": { "texture": "#0", "uv": [ 1.0, 6.0, 15.0, 15.0 ], "rotation": 180 }
}
},
{
"name": "Side",
"from": [ 1.0, 4.0, 14.0 ],
"to": [ 15.0, 12.0, 16.0 ],
"faces": {
"north": { "texture": "#0", "uv": [ 1.0, 4.0, 15.0, 12.0 ], "rotation": 180 },
"east": { "texture": "#0", "uv": [ 0.0, 4.0, 2.0, 12.0 ], "rotation": 180 },
"south": { "texture": "#0", "uv": [ 1.0, 4.0, 15.0, 12.0 ], "rotation": 180 },
"west": { "texture": "#0", "uv": [ 14.0, 4.0, 16.0, 12.0 ], "rotation": 180 },
"up": { "texture": "#0", "uv": [ 1.0, 3.0, 15.0, 5.0 ] },
"down": { "texture": "#0", "uv": [ 1.0, 11.0, 15.0, 13.0 ] }
}
},
{
"name": "Top Diagonal",
"from": [ 1.0, 11.0, -3.325 ],
"to": [ 15.0, 13.0, 6.7 ],
"rotation": { "origin": [ 8.0, 8.0, 8.0 ], "axis": "x", "angle": 45.0 },
"faces": {
"north": { "texture": "#0", "uv": [ 1.0, 11.0, 15.0, 13.0 ], "rotation": 180 },
"east": { "texture": "#0", "uv": [ 0.0, 6.0, 2.0, 16.0 ], "rotation": 270 },
"west": { "texture": "#0", "uv": [ 14.0, 6.0, 16.0, 16.0 ], "rotation": 90 },
"up": { "texture": "#0", "uv": [ 1.0, 5.8, 15.0, 16.0 ], "rotation": 180 },
"down": { "texture": "#0", "uv": [ 1.0, 5.8, 15.0, 16.0 ] }
}
},
{
"name": "Bottom Diagonal",
"from": [ 1.0, 3.0, -3.325 ],
"to": [ 15.0, 5.0, 10.1 ],
"rotation": { "origin": [ 8.0, 8.0, 8.0 ], "axis": "x", "angle": 45.0 },
"faces": {
"north": { "texture": "#0", "uv": [ 1.0, 3.0, 15.0, 5.0 ] },
"east": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 13.0 ], "rotation": 90 },
"west": { "texture": "#0", "uv": [ 14.0, 0.0, 16.0, 13.0 ], "rotation": 270 },
"up": { "texture": "#0", "uv": [ 1.0, 0.0, 15.0, 13.0 ] },
"down": { "texture": "#0", "uv": [ 1.0, 0.0, 15.0, 13.0 ], "rotation": 180 }
}
}
]
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 197 B

After

Width:  |  Height:  |  Size: 322 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 250 B

View file

@ -1,6 +0,0 @@
{
"animation": {
"interpolate": false,
"frametime": 1
}
}