mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-12-23 21:46:40 +01:00
Added Basic Kinetic Blocks
+ Axis + Gear + Large Gear + Axis Tunnel + Gearshifter + Gearbox - Added related tileentites and renderers - Added related models and textures - Added the Rotation Propagator
This commit is contained in:
parent
488c1a1374
commit
56c879420b
64 changed files with 2457 additions and 10 deletions
|
@ -2,6 +2,14 @@ package com.simibubi.create;
|
|||
|
||||
import com.simibubi.create.foundation.block.IRenderUtilityBlock;
|
||||
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.CogWheelBlock;
|
||||
import com.simibubi.create.modules.kinetics.relays.GearboxBlock;
|
||||
import com.simibubi.create.modules.kinetics.relays.GearshifterBlock;
|
||||
import com.simibubi.create.modules.schematics.block.CreativeCrateBlock;
|
||||
import com.simibubi.create.modules.schematics.block.SchematicTableBlock;
|
||||
import com.simibubi.create.modules.schematics.block.SchematicannonBlock;
|
||||
|
@ -10,23 +18,40 @@ import com.simibubi.create.modules.symmetry.block.PlaneSymmetryBlock;
|
|||
import com.simibubi.create.modules.symmetry.block.TriplePlaneSymmetryBlock;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.Block.Properties;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.item.BlockItem;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraftforge.registries.IForgeRegistry;
|
||||
|
||||
public enum AllBlocks {
|
||||
|
||||
// Schematics
|
||||
SCHEMATICANNON(new SchematicannonBlock()),
|
||||
SCHEMATICANNON_CONNECTOR(new RenderUtilityBlock()),
|
||||
SCHEMATICANNON_PIPE(new RenderUtilityBlock()),
|
||||
CREATIVE_CRATE(new CreativeCrateBlock()),
|
||||
|
||||
SCHEMATIC_TABLE(new SchematicTableBlock()),
|
||||
|
||||
// Kinetics
|
||||
AXIS(new AxisBlock(Properties.from(Blocks.ANDESITE))),
|
||||
GEAR(new CogWheelBlock(false)),
|
||||
LARGE_GEAR(new CogWheelBlock(true)),
|
||||
AXIS_TUNNEL(new AxisTunnelBlock()),
|
||||
GEARSHIFTER(new GearshifterBlock()),
|
||||
|
||||
TURNTABLE(new TurntableBlock()),
|
||||
HALF_AXIS(new HalfAxisBlock()),
|
||||
GEARBOX(new GearboxBlock()),
|
||||
MOTOR(new MotorBlock()),
|
||||
|
||||
// Symmetry
|
||||
SYMMETRY_PLANE(new PlaneSymmetryBlock()),
|
||||
SYMMETRY_CROSSPLANE(new CrossPlaneSymmetryBlock()),
|
||||
SYMMETRY_TRIPLEPLANE(new TriplePlaneSymmetryBlock());
|
||||
SYMMETRY_TRIPLEPLANE(new TriplePlaneSymmetryBlock()),
|
||||
|
||||
;
|
||||
|
||||
public Block block;
|
||||
|
||||
|
|
|
@ -2,10 +2,22 @@ package com.simibubi.create;
|
|||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import com.simibubi.create.modules.kinetics.base.KineticTileEntityRenderer;
|
||||
import com.simibubi.create.modules.kinetics.generators.MotorTileEntity;
|
||||
import com.simibubi.create.modules.kinetics.generators.MotorTileEntityRenderer;
|
||||
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.GearboxTileEntity;
|
||||
import com.simibubi.create.modules.kinetics.relays.GearboxTileEntityRenderer;
|
||||
import com.simibubi.create.modules.kinetics.relays.GearshifterTileEntity;
|
||||
import com.simibubi.create.modules.kinetics.relays.GearshifterTileEntityRenderer;
|
||||
import com.simibubi.create.modules.schematics.block.SchematicTableTileEntity;
|
||||
import com.simibubi.create.modules.schematics.block.SchematicannonRenderer;
|
||||
import com.simibubi.create.modules.schematics.block.SchematicannonTileEntity;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
|
@ -21,24 +33,39 @@ import net.minecraftforge.fml.common.Mod.EventBusSubscriber.Bus;
|
|||
@Mod.EventBusSubscriber(bus = Bus.MOD)
|
||||
public enum AllTileEntities {
|
||||
|
||||
Schematicannon(SchematicannonTileEntity::new, AllBlocks.SCHEMATICANNON),
|
||||
SchematicTable(SchematicTableTileEntity::new, AllBlocks.SCHEMATIC_TABLE);
|
||||
// Schematics
|
||||
SCHEMATICANNON(SchematicannonTileEntity::new, AllBlocks.SCHEMATICANNON),
|
||||
SCHEMATICTABLE(SchematicTableTileEntity::new, AllBlocks.SCHEMATIC_TABLE),
|
||||
|
||||
// Kinetics
|
||||
AXIS(AxisTileEntity::new, AllBlocks.AXIS, AllBlocks.GEAR, AllBlocks.LARGE_GEAR, AllBlocks.AXIS_TUNNEL),
|
||||
MOTOR(MotorTileEntity::new, AllBlocks.MOTOR),
|
||||
GEARBOX(GearboxTileEntity::new, AllBlocks.GEARBOX),
|
||||
TURNTABLE(TurntableTileEntity::new, AllBlocks.TURNTABLE),
|
||||
AXIS_TUNNEL(AxisTunnelTileEntity::new, AllBlocks.AXIS_TUNNEL),
|
||||
GEARSHIFTER(GearshifterTileEntity::new, AllBlocks.GEARSHIFTER),
|
||||
|
||||
;
|
||||
|
||||
private Supplier<? extends TileEntity> supplier;
|
||||
public TileEntityType<?> type;
|
||||
private AllBlocks block;
|
||||
private AllBlocks[] blocks;
|
||||
|
||||
private AllTileEntities(Supplier<? extends TileEntity> supplier, AllBlocks block) {
|
||||
private AllTileEntities(Supplier<? extends TileEntity> supplier, AllBlocks... blocks) {
|
||||
this.supplier = supplier;
|
||||
this.block = block;
|
||||
this.blocks = blocks;
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public static void onTileEntityRegistry(final RegistryEvent.Register<TileEntityType<?>> event) {
|
||||
|
||||
for (AllTileEntities tileEntity : values()) {
|
||||
Block[] blocks = new Block[tileEntity.blocks.length];
|
||||
for (int i = 0; i < blocks.length; i++)
|
||||
blocks[i] = tileEntity.blocks[i].block;
|
||||
|
||||
ResourceLocation resourceLocation = new ResourceLocation(Create.ID, tileEntity.name().toLowerCase());
|
||||
tileEntity.type = TileEntityType.Builder.create(tileEntity.supplier, tileEntity.block.get()).build(null)
|
||||
tileEntity.type = TileEntityType.Builder.create(tileEntity.supplier, blocks).build(null)
|
||||
.setRegistryName(resourceLocation);
|
||||
event.getRegistry().register(tileEntity.type);
|
||||
}
|
||||
|
@ -47,6 +74,12 @@ public enum AllTileEntities {
|
|||
@OnlyIn(Dist.CLIENT)
|
||||
public static void registerRenderers() {
|
||||
bind(SchematicannonTileEntity.class, new SchematicannonRenderer());
|
||||
bind(AxisTileEntity.class, new KineticTileEntityRenderer());
|
||||
bind(TurntableTileEntity.class, new KineticTileEntityRenderer());
|
||||
bind(MotorTileEntity.class, new MotorTileEntityRenderer());
|
||||
bind(AxisTunnelTileEntity.class, new AxisTunnelTileEntityRenderer());
|
||||
bind(GearboxTileEntity.class, new GearboxTileEntityRenderer());
|
||||
bind(GearshifterTileEntity.class, new GearshifterTileEntityRenderer());
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
|
|
|
@ -0,0 +1,347 @@
|
|||
package com.simibubi.create.modules.kinetics;
|
||||
|
||||
import java.util.LinkedList;
|
||||
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.GearboxTileEntity;
|
||||
import com.simibubi.create.modules.kinetics.relays.GearshifterTileEntity;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.state.IProperty;
|
||||
import net.minecraft.state.properties.BlockStateProperties;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Direction.Axis;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class RotationPropagator {
|
||||
|
||||
/**
|
||||
* Determines the change in rotation between two attached kinetic entities. For
|
||||
* instance, an axis connection returns 1 while a 1-to-1 gear connection
|
||||
* reverses the rotation and therefore returns -1.
|
||||
*
|
||||
* @param from
|
||||
* @param to
|
||||
* @return
|
||||
*/
|
||||
private static float getRotationSpeedModifier(KineticTileEntity from, KineticTileEntity to) {
|
||||
final BlockState stateFrom = from.getBlockState();
|
||||
final BlockState stateTo = to.getBlockState();
|
||||
final IRotate definitionFrom = (IRotate) stateFrom.getBlock();
|
||||
final IRotate definitionTo = (IRotate) stateTo.getBlock();
|
||||
final BlockPos diff = to.getPos().subtract(from.getPos());
|
||||
final Direction facingFromTo = Direction.getFacingFromVector(diff.getX(), diff.getY(), diff.getZ());
|
||||
final World world = from.getWorld();
|
||||
IProperty<Axis> axisProperty = BlockStateProperties.AXIS;
|
||||
boolean connectedByAxis = definitionFrom.isAxisTowards(world, from.getPos(), stateFrom, facingFromTo)
|
||||
&& definitionTo.isAxisTowards(world, to.getPos(), stateTo, facingFromTo.getOpposite());
|
||||
|
||||
// Gearbox <-> Gearbox
|
||||
if (from instanceof GearboxTileEntity && to instanceof GearboxTileEntity)
|
||||
return 0;
|
||||
|
||||
// Gearbox -> Axis
|
||||
if (from instanceof GearboxTileEntity) {
|
||||
if (!connectedByAxis)
|
||||
return 0;
|
||||
if (!from.hasSource())
|
||||
return 1;
|
||||
|
||||
Direction sourceFacing = from.getSourceFacing();
|
||||
if (facingFromTo.getAxis() == sourceFacing.getAxis())
|
||||
return facingFromTo == sourceFacing ? 1 : -1;
|
||||
else
|
||||
return facingFromTo.getAxisDirection() == sourceFacing.getAxisDirection() ? -1 : 1;
|
||||
}
|
||||
|
||||
// Axis -> Gearbox
|
||||
if (to instanceof GearboxTileEntity) {
|
||||
if (!connectedByAxis)
|
||||
return 0;
|
||||
if (!to.hasSource())
|
||||
return 1;
|
||||
|
||||
Direction sourceFacing = to.getSourceFacing();
|
||||
if (facingFromTo.getAxis() == sourceFacing.getAxis())
|
||||
return facingFromTo.getOpposite() == sourceFacing ? 1 : -1;
|
||||
else
|
||||
return facingFromTo.getAxisDirection() == sourceFacing.getAxisDirection() ? 1 : -1;
|
||||
}
|
||||
|
||||
if (from instanceof GearshifterTileEntity) {
|
||||
if (!connectedByAxis)
|
||||
return 0;
|
||||
|
||||
// Gearshifter -> Gearshifter
|
||||
if (to instanceof GearshifterTileEntity) {
|
||||
int fromReversed = from.hasSource() && from.getSourceFacing() != facingFromTo
|
||||
&& stateFrom.get(BlockStateProperties.POWERED) ? -1 : 1;
|
||||
int toReversed = to.hasSource() && to.getSourceFacing() != facingFromTo.getOpposite()
|
||||
&& stateTo.get(BlockStateProperties.POWERED) ? -1 : 1;
|
||||
return fromReversed * toReversed;
|
||||
}
|
||||
|
||||
// Gearshifter -> Axis
|
||||
if (!from.hasSource())
|
||||
return 1;
|
||||
|
||||
Direction sourceFacing = from.getSourceFacing();
|
||||
return sourceFacing == facingFromTo ? 1 : stateFrom.get(BlockStateProperties.POWERED) ? -1 : 1;
|
||||
}
|
||||
|
||||
// Axis -> Gearshifter
|
||||
if (to instanceof GearshifterTileEntity) {
|
||||
if (!connectedByAxis)
|
||||
return 0;
|
||||
if (!to.hasSource())
|
||||
return 1;
|
||||
|
||||
Direction sourceFacing = to.getSourceFacing();
|
||||
return sourceFacing == facingFromTo.getOpposite() ? 1 : stateTo.get(BlockStateProperties.POWERED) ? -1 : 1;
|
||||
}
|
||||
|
||||
// Axis <-> Axis
|
||||
if (connectedByAxis)
|
||||
return 1;
|
||||
|
||||
// Large Gear -> Gear
|
||||
if (AllBlocks.LARGE_GEAR.typeOf(from.getBlockState()) && AllBlocks.GEAR.typeOf(to.getBlockState())) {
|
||||
Axis axisFrom = stateFrom.get(axisProperty);
|
||||
if (axisFrom == stateTo.get(axisProperty)) {
|
||||
if (axisFrom.getCoordinate(diff.getX(), diff.getY(), diff.getZ()) == 0) {
|
||||
for (Axis axis : Axis.values()) {
|
||||
if (axis == axisFrom)
|
||||
continue;
|
||||
if (Math.abs(axis.getCoordinate(diff.getX(), diff.getY(), diff.getZ())) != 1)
|
||||
return 0;
|
||||
}
|
||||
return -2f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Gear -> Large Gear
|
||||
if (AllBlocks.GEAR.typeOf(from.getBlockState()) && AllBlocks.LARGE_GEAR.typeOf(to.getBlockState())) {
|
||||
Axis axisFrom = stateFrom.get(axisProperty);
|
||||
if (axisFrom == stateTo.get(axisProperty)) {
|
||||
if (axisFrom.getCoordinate(diff.getX(), diff.getY(), diff.getZ()) == 0) {
|
||||
for (Axis axis : Axis.values()) {
|
||||
if (axis == axisFrom)
|
||||
continue;
|
||||
if (Math.abs(axis.getCoordinate(diff.getX(), diff.getY(), diff.getZ())) != 1)
|
||||
return 0;
|
||||
}
|
||||
return -.5f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Gear <-> Gear
|
||||
if (definitionFrom.isGearTowards(world, from.getPos(), stateFrom, facingFromTo)
|
||||
&& definitionTo.isGearTowards(world, to.getPos(), stateTo, facingFromTo.getOpposite())) {
|
||||
if (diff.manhattanDistance(BlockPos.ZERO) != 1)
|
||||
return 0;
|
||||
if (AllBlocks.LARGE_GEAR.typeOf(to.getBlockState()))
|
||||
return 0;
|
||||
if (stateFrom.get(axisProperty) == stateTo.get(axisProperty))
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Insert the added position to the kinetic network.
|
||||
*
|
||||
* @param worldIn
|
||||
* @param pos
|
||||
*/
|
||||
public static void handleAdded(World worldIn, BlockPos pos, KineticTileEntity addedTE) {
|
||||
if (worldIn.isRemote)
|
||||
return;
|
||||
if (!worldIn.isAreaLoaded(pos, 1))
|
||||
return;
|
||||
|
||||
if (addedTE.getSpeed() != 0) {
|
||||
propagateNewSource(addedTE);
|
||||
return;
|
||||
}
|
||||
|
||||
for (KineticTileEntity neighbourTE : getConnectedNeighbours(addedTE)) {
|
||||
final float speedModifier = getRotationSpeedModifier(neighbourTE, addedTE);
|
||||
|
||||
if (neighbourTE.getSpeed() == 0)
|
||||
continue;
|
||||
if (neighbourTE.hasSource() && neighbourTE.getSource().equals(addedTE.getPos())) {
|
||||
addedTE.setSpeed(neighbourTE.getSpeed() * speedModifier);
|
||||
addedTE.notifyBlockUpdate();
|
||||
continue;
|
||||
}
|
||||
|
||||
addedTE.setSpeed(neighbourTE.getSpeed() * speedModifier);
|
||||
addedTE.setSource(neighbourTE.getPos());
|
||||
addedTE.notifyBlockUpdate();
|
||||
propagateNewSource(addedTE);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Search for sourceless networks attached to the given entity and update them.
|
||||
*
|
||||
* @param updateTE
|
||||
*/
|
||||
private static void propagateNewSource(KineticTileEntity updateTE) {
|
||||
BlockPos pos = updateTE.getPos();
|
||||
World world = updateTE.getWorld();
|
||||
|
||||
for (KineticTileEntity neighbourTE : getConnectedNeighbours(updateTE)) {
|
||||
final float newSpeed = updateTE.getSpeed() * getRotationSpeedModifier(updateTE, neighbourTE);
|
||||
|
||||
if ((neighbourTE.isSource())
|
||||
|| neighbourTE.hasSource() && !neighbourTE.getSource().equals(updateTE.getPos())) {
|
||||
if (neighbourTE.getSpeed() != newSpeed) {
|
||||
world.destroyBlock(pos, true);
|
||||
return;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (neighbourTE.getSpeed() == newSpeed)
|
||||
continue;
|
||||
|
||||
neighbourTE.setSpeed(newSpeed);
|
||||
neighbourTE.setSource(updateTE.getPos());
|
||||
neighbourTE.notifyBlockUpdate();
|
||||
propagateNewSource(neighbourTE);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the given entity from the network.
|
||||
*
|
||||
* @param worldIn
|
||||
* @param pos
|
||||
* @param removedTE
|
||||
*/
|
||||
public static void handleRemoved(World worldIn, BlockPos pos, KineticTileEntity removedTE) {
|
||||
if (worldIn.isRemote)
|
||||
return;
|
||||
if (removedTE.getSpeed() == 0)
|
||||
return;
|
||||
|
||||
for (BlockPos neighbourPos : getPotentialNeighbourLocations(removedTE)) {
|
||||
BlockState neighbourState = worldIn.getBlockState(neighbourPos);
|
||||
if (!(neighbourState.getBlock() instanceof IRotate))
|
||||
continue;
|
||||
|
||||
final KineticTileEntity neighbourTE = (KineticTileEntity) worldIn.getTileEntity(neighbourPos);
|
||||
if (!neighbourTE.hasSource() || !neighbourTE.getSource().equals(pos) || neighbourTE.isSource())
|
||||
continue;
|
||||
|
||||
propagateMissingSource(neighbourTE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear the entire subnetwork depending on the given entity and find a new
|
||||
* source
|
||||
*
|
||||
* @param updateTE
|
||||
*/
|
||||
private static void propagateMissingSource(KineticTileEntity updateTE) {
|
||||
final World world = updateTE.getWorld();
|
||||
|
||||
List<KineticTileEntity> potentialNewSources = new LinkedList<>();
|
||||
List<BlockPos> frontier = new LinkedList<>();
|
||||
frontier.add(updateTE.getPos());
|
||||
|
||||
while (!frontier.isEmpty()) {
|
||||
final BlockPos pos = frontier.remove(0);
|
||||
final KineticTileEntity currentTE = (KineticTileEntity) world.getTileEntity(pos);
|
||||
|
||||
currentTE.removeSource();
|
||||
currentTE.notifyBlockUpdate();
|
||||
|
||||
for (KineticTileEntity neighbourTE : getConnectedNeighbours(currentTE)) {
|
||||
if (neighbourTE.isSource()) {
|
||||
potentialNewSources.add(neighbourTE);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!neighbourTE.hasSource())
|
||||
continue;
|
||||
|
||||
if (!neighbourTE.getSource().equals(pos)) {
|
||||
potentialNewSources.add(neighbourTE);
|
||||
continue;
|
||||
}
|
||||
|
||||
frontier.add(neighbourTE.getPos());
|
||||
}
|
||||
}
|
||||
|
||||
for (KineticTileEntity newSource : potentialNewSources) {
|
||||
if (newSource.hasSource() || newSource.isSource()) {
|
||||
propagateNewSource(newSource);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static KineticTileEntity findConnectedNeighbour(KineticTileEntity te, BlockPos neighbourPos) {
|
||||
BlockState neighbourState = te.getWorld().getBlockState(neighbourPos);
|
||||
if (!(neighbourState.getBlock() instanceof IRotate))
|
||||
return null;
|
||||
|
||||
KineticTileEntity neighbour = (KineticTileEntity) te.getWorld().getTileEntity(neighbourPos);
|
||||
if (getRotationSpeedModifier(te, neighbour) == 0)
|
||||
return null;
|
||||
return neighbour;
|
||||
}
|
||||
|
||||
private static List<KineticTileEntity> getConnectedNeighbours(KineticTileEntity te) {
|
||||
List<KineticTileEntity> neighbours = new LinkedList<>();
|
||||
for (BlockPos neighbourPos : getPotentialNeighbourLocations(te)) {
|
||||
final KineticTileEntity neighbourTE = findConnectedNeighbour(te, neighbourPos);
|
||||
if (neighbourTE == null)
|
||||
continue;
|
||||
|
||||
neighbours.add(neighbourTE);
|
||||
}
|
||||
return neighbours;
|
||||
}
|
||||
|
||||
private static List<BlockPos> getPotentialNeighbourLocations(KineticTileEntity te) {
|
||||
List<BlockPos> neighbours = new LinkedList<>();
|
||||
|
||||
if (!te.getWorld().isAreaLoaded(te.getPos(), 1))
|
||||
return neighbours;
|
||||
|
||||
for (Direction facing : Direction.values()) {
|
||||
neighbours.add(te.getPos().offset(facing));
|
||||
}
|
||||
|
||||
// gears can interface diagonally
|
||||
BlockState blockState = te.getBlockState();
|
||||
if (AllBlocks.GEAR.typeOf(blockState) || AllBlocks.LARGE_GEAR.typeOf(blockState)) {
|
||||
Axis axis = blockState.get(BlockStateProperties.AXIS);
|
||||
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;
|
||||
if (offset.distanceSq(0, 0, 0, false) != BlockPos.ZERO.distanceSq(1, 1, 0, false))
|
||||
return;
|
||||
neighbours.add(te.getPos().add(offset));
|
||||
});
|
||||
}
|
||||
|
||||
return neighbours;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package com.simibubi.create.modules.kinetics.base;
|
||||
|
||||
import com.simibubi.create.foundation.block.IRenderUtilityBlock;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.DirectionalBlock;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.state.StateContainer.Builder;
|
||||
|
||||
public class HalfAxisBlock extends DirectionalBlock implements IRenderUtilityBlock {
|
||||
|
||||
public HalfAxisBlock() {
|
||||
super(Properties.create(Material.ROCK));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void fillStateContainer(Builder<Block, BlockState> builder) {
|
||||
builder.add(FACING);
|
||||
super.fillStateContainer(builder);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
package com.simibubi.create.modules.kinetics.base;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.item.BlockItemUseContext;
|
||||
import net.minecraft.state.IProperty;
|
||||
import net.minecraft.state.StateContainer.Builder;
|
||||
import net.minecraft.state.properties.BlockStateProperties;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Mirror;
|
||||
import net.minecraft.util.Rotation;
|
||||
|
||||
public abstract class HorizontalKineticBlock extends KineticBlock {
|
||||
|
||||
public static final IProperty<Direction> HORIZONTAL_FACING = BlockStateProperties.HORIZONTAL_FACING;
|
||||
|
||||
public HorizontalKineticBlock(Properties properties) {
|
||||
super(properties);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void fillStateContainer(Builder<Block, BlockState> builder) {
|
||||
builder.add(HORIZONTAL_FACING);
|
||||
super.fillStateContainer(builder);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState getStateForPlacement(BlockItemUseContext context) {
|
||||
return this.getDefaultState().with(HORIZONTAL_FACING, context.getPlacementHorizontalFacing().getOpposite());
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState rotate(BlockState state, Rotation rot) {
|
||||
return state.with(HORIZONTAL_FACING, rot.rotate(state.get(HORIZONTAL_FACING)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState mirror(BlockState state, Mirror mirrorIn) {
|
||||
return state.rotate(mirrorIn.toRotation(state.get(HORIZONTAL_FACING)));
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package com.simibubi.create.modules.kinetics.base;
|
||||
|
||||
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.world.World;
|
||||
|
||||
public interface IRotate {
|
||||
|
||||
public boolean isAxisTowards(World world, BlockPos pos, BlockState state, Direction face);
|
||||
public boolean isGearTowards(World world, BlockPos pos, BlockState state, Direction face);
|
||||
|
||||
public Axis getRotationAxis(BlockState state);
|
||||
|
||||
}
|
|
@ -0,0 +1,77 @@
|
|||
package com.simibubi.create.modules.kinetics.base;
|
||||
|
||||
import com.simibubi.create.modules.kinetics.RotationPropagator;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.material.PushReaction;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockRenderLayer;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Direction.Axis;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.IWorld;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public abstract class KineticBlock extends Block implements IRotate {
|
||||
|
||||
public KineticBlock(Properties properties) {
|
||||
super(properties);
|
||||
}
|
||||
|
||||
// IRotate
|
||||
|
||||
@Override
|
||||
public boolean isAxisTowards(World world, BlockPos pos, BlockState state, Direction face) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isGearTowards(World world, BlockPos pos, BlockState state, Direction face) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Axis getRotationAxis(BlockState state) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Block
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(BlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PushReaction getPushReaction(BlockState state) {
|
||||
return PushReaction.BLOCK;
|
||||
}
|
||||
|
||||
@Override
|
||||
public abstract TileEntity createTileEntity(BlockState state, IBlockReader world);
|
||||
|
||||
@Override
|
||||
public void onBlockAdded(BlockState state, World worldIn, BlockPos pos, BlockState oldState, boolean isMoving) {
|
||||
// RotationPropagator.handleAdded(worldIn, pos);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateNeighbors(BlockState stateIn, IWorld worldIn, BlockPos pos, int flags) {
|
||||
RotationPropagator.handleAdded(worldIn.getWorld(), pos, (KineticTileEntity) worldIn.getTileEntity(pos));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canRenderInLayer(BlockState state, BlockRenderLayer layer) {
|
||||
return hasStaticPart() && layer == BlockRenderLayer.SOLID;
|
||||
}
|
||||
|
||||
protected abstract boolean hasStaticPart();
|
||||
|
||||
@Override
|
||||
public boolean isSolid(BlockState state) {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,133 @@
|
|||
package com.simibubi.create.modules.kinetics.base;
|
||||
|
||||
import java.util.Optional;
|
||||
import java.util.Random;
|
||||
|
||||
import com.simibubi.create.foundation.block.SyncedTileEntity;
|
||||
import com.simibubi.create.modules.kinetics.RotationPropagator;
|
||||
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.nbt.NBTUtil;
|
||||
import net.minecraft.particles.RedstoneParticleData;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
public abstract class KineticTileEntity extends SyncedTileEntity {
|
||||
|
||||
protected float speed;
|
||||
protected float force;
|
||||
protected Optional<BlockPos> source;
|
||||
|
||||
public KineticTileEntity(TileEntityType<?> typeIn) {
|
||||
super(typeIn);
|
||||
setSpeed(0);
|
||||
setForce(0);
|
||||
source = Optional.empty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
if (!hasWorld())
|
||||
return;
|
||||
super.onLoad();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remove() {
|
||||
if (world.isRemote) {
|
||||
super.remove();
|
||||
return;
|
||||
}
|
||||
RotationPropagator.handleRemoved(getWorld(), getPos(), this);
|
||||
super.remove();
|
||||
}
|
||||
|
||||
public void notifyBlockUpdate() {
|
||||
this.world.notifyBlockUpdate(getPos(), getBlockState(), getBlockState(), 2 | 16);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompoundNBT write(CompoundNBT compound) {
|
||||
compound.putFloat("Speed", getSpeed());
|
||||
compound.putFloat("Force", getForce());
|
||||
|
||||
if (hasSource())
|
||||
compound.put("Source", NBTUtil.writeBlockPos(getSource()));
|
||||
|
||||
return super.write(compound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(CompoundNBT compound) {
|
||||
setSpeed(compound.getFloat("Speed"));
|
||||
setForce(compound.getFloat("Force"));
|
||||
|
||||
setSource(null);
|
||||
if (compound.contains("Source")) {
|
||||
CompoundNBT tagSource = compound.getCompound("Source");
|
||||
setSource(NBTUtil.readBlockPos(tagSource));
|
||||
}
|
||||
|
||||
super.read(compound);
|
||||
}
|
||||
|
||||
public boolean isSource() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public float getSpeed() {
|
||||
return speed;
|
||||
}
|
||||
|
||||
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) {
|
||||
Random r = getWorld().rand;
|
||||
for (int i = 0; i < 10; i++) {
|
||||
float x = getPos().getX() + (r.nextFloat() - .5f) / 2f + .5f;
|
||||
float y = getPos().getY() + (r.nextFloat() - .5f) / 2f + .5f;
|
||||
float z = getPos().getZ() + (r.nextFloat() - .5f) / 2f + .5f;
|
||||
this.getWorld().addParticle(new RedstoneParticleData(1, 1, 1, 1), x, y, z, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public float getForce() {
|
||||
return force;
|
||||
}
|
||||
|
||||
public void setForce(float force) {
|
||||
this.force = force;
|
||||
}
|
||||
|
||||
public boolean hasSource() {
|
||||
return source.isPresent();
|
||||
}
|
||||
|
||||
public BlockPos getSource() {
|
||||
return source.get();
|
||||
}
|
||||
|
||||
public Direction getSourceFacing() {
|
||||
BlockPos source = getSource().subtract(getPos());
|
||||
return Direction.getFacingFromVector(source.getX(), source.getY(), source.getZ());
|
||||
}
|
||||
|
||||
public void setSource(BlockPos source) {
|
||||
this.source = Optional.ofNullable(source);
|
||||
}
|
||||
|
||||
public void removeSource() {
|
||||
this.source = Optional.empty();
|
||||
setSpeed(0);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,146 @@
|
|||
package com.simibubi.create.modules.kinetics.base;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.simibubi.create.AllBlocks;
|
||||
|
||||
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.client.model.animation.Animation;
|
||||
import net.minecraftforge.client.model.animation.TileEntityRendererFast;
|
||||
import net.minecraftforge.client.model.data.EmptyModelData;
|
||||
|
||||
public class KineticTileEntityRenderer extends TileEntityRendererFast<KineticTileEntity> {
|
||||
|
||||
protected static Map<BlockState, CachedByteBuffer> cachedBuffers;
|
||||
|
||||
protected class CachedByteBuffer {
|
||||
ByteBuffer original;
|
||||
ByteBuffer mutable;
|
||||
|
||||
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 ByteBuffer getTransformed(Vec3d translation, float angle, Axis axis, int packedLightCoords) {
|
||||
original.rewind();
|
||||
mutable.rewind();
|
||||
final float cos = MathHelper.cos(angle);
|
||||
final float sin = MathHelper.sin(angle);
|
||||
final int formatLength = DefaultVertexFormats.BLOCK.getSize();
|
||||
|
||||
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;
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
public KineticTileEntityRenderer() {
|
||||
cachedBuffers = new HashMap<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderTileEntityFast(KineticTileEntity te, double x, double y, double z, float partialTicks,
|
||||
int destroyStage, BufferBuilder buffer) {
|
||||
|
||||
final BlockState state = getRenderedBlockState(te);
|
||||
cacheIfMissing(state);
|
||||
|
||||
final Vec3d translation = new Vec3d(x, y, z);
|
||||
final BlockPos pos = te.getPos();
|
||||
final Axis axis = ((IRotate) te.getBlockState().getBlock()).getRotationAxis(te.getBlockState());
|
||||
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));
|
||||
}
|
||||
|
||||
protected void cacheIfMissing(final BlockState state) {
|
||||
if (!cachedBuffers.containsKey(state)) {
|
||||
BlockRendererDispatcher dispatcher = Minecraft.getInstance().getBlockRendererDispatcher();
|
||||
BlockModelRenderer blockRenderer = dispatcher.getBlockModelRenderer();
|
||||
IBakedModel originalModel = dispatcher.getModelForState(state);
|
||||
BufferBuilder builder = new BufferBuilder(0);
|
||||
Random random = new Random();
|
||||
|
||||
builder.begin(GL11.GL_QUADS, DefaultVertexFormats.BLOCK);
|
||||
blockRenderer.renderModelFlat(getWorld(), originalModel, state, BlockPos.ZERO, builder, true, random, 42,
|
||||
EmptyModelData.INSTANCE);
|
||||
builder.finishDrawing();
|
||||
|
||||
cachedBuffers.put(state, new CachedByteBuffer(builder.getByteBuffer()));
|
||||
}
|
||||
}
|
||||
|
||||
protected float getRotationOffsetForPosition(KineticTileEntity te, final BlockPos pos, final Axis axis) {
|
||||
float offset = AllBlocks.LARGE_GEAR.typeOf(te.getBlockState()) ? 11.25f : 0;
|
||||
double d = (((axis == Axis.X) ? 0 : pos.getX()) + ((axis == Axis.Y) ? 0 : pos.getY())
|
||||
+ ((axis == Axis.Z) ? 0 : pos.getZ())) % 2;
|
||||
if (d == 0) {
|
||||
offset = 22.5f;
|
||||
}
|
||||
return offset;
|
||||
}
|
||||
|
||||
protected BlockState getRenderedBlockState(KineticTileEntity te) {
|
||||
return te.getBlockState();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
package com.simibubi.create.modules.kinetics.base;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.item.BlockItemUseContext;
|
||||
import net.minecraft.state.EnumProperty;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.state.properties.BlockStateProperties;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Rotation;
|
||||
|
||||
public abstract class RotatedPillarKineticBlock extends KineticBlock {
|
||||
|
||||
public static final EnumProperty<Direction.Axis> AXIS = BlockStateProperties.AXIS;
|
||||
|
||||
public RotatedPillarKineticBlock(Properties properties) {
|
||||
super(properties);
|
||||
this.setDefaultState(this.getDefaultState().with(AXIS, Direction.Axis.Y));
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState rotate(BlockState state, Rotation rot) {
|
||||
switch (rot) {
|
||||
case COUNTERCLOCKWISE_90:
|
||||
case CLOCKWISE_90:
|
||||
switch ((Direction.Axis) state.get(AXIS)) {
|
||||
case X:
|
||||
return state.with(AXIS, Direction.Axis.Z);
|
||||
case Z:
|
||||
return state.with(AXIS, Direction.Axis.X);
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) {
|
||||
builder.add(AXIS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState getStateForPlacement(BlockItemUseContext context) {
|
||||
return this.getDefaultState().with(AXIS, context.getFace().getAxis());
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,51 @@
|
|||
package com.simibubi.create.modules.kinetics.generators;
|
||||
|
||||
import com.simibubi.create.modules.kinetics.base.HorizontalKineticBlock;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Direction.Axis;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.shapes.ISelectionContext;
|
||||
import net.minecraft.util.math.shapes.VoxelShape;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class MotorBlock extends HorizontalKineticBlock {
|
||||
|
||||
protected static final VoxelShape MOTOR_X = makeCuboidShape(0, 3, 3, 16, 13, 13);
|
||||
protected static final VoxelShape MOTOR_Z = makeCuboidShape(3, 3, 0, 13, 13, 16);
|
||||
|
||||
public MotorBlock() {
|
||||
super(Properties.create(Material.IRON));
|
||||
}
|
||||
|
||||
@Override
|
||||
public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) {
|
||||
return state.get(HORIZONTAL_FACING).getAxis() == Axis.X ? MOTOR_X : MOTOR_Z;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity(BlockState state, IBlockReader world) {
|
||||
return new MotorTileEntity();
|
||||
}
|
||||
|
||||
// IRotate:
|
||||
|
||||
@Override
|
||||
public boolean isAxisTowards(World world, BlockPos pos, BlockState state, Direction face) {
|
||||
return face == state.get(HORIZONTAL_FACING);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Axis getRotationAxis(BlockState state) {
|
||||
return state.get(HORIZONTAL_FACING).getAxis();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean hasStaticPart() {
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package com.simibubi.create.modules.kinetics.generators;
|
||||
|
||||
import com.simibubi.create.AllTileEntities;
|
||||
import com.simibubi.create.modules.kinetics.base.KineticTileEntity;
|
||||
|
||||
public class MotorTileEntity extends KineticTileEntity {
|
||||
|
||||
public MotorTileEntity() {
|
||||
super(AllTileEntities.MOTOR.type);
|
||||
setSpeed(50);
|
||||
setForce(10);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasFastRenderer() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSource() {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package com.simibubi.create.modules.kinetics.generators;
|
||||
|
||||
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.state.properties.BlockStateProperties;
|
||||
|
||||
public class MotorTileEntityRenderer extends KineticTileEntityRenderer {
|
||||
|
||||
@Override
|
||||
protected BlockState getRenderedBlockState(KineticTileEntity te) {
|
||||
return AllBlocks.HALF_AXIS.get().getDefaultState().with(BlockStateProperties.FACING,
|
||||
te.getBlockState().get(BlockStateProperties.HORIZONTAL_FACING));
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,93 @@
|
|||
package com.simibubi.create.modules.kinetics.receivers;
|
||||
|
||||
import com.simibubi.create.modules.kinetics.base.KineticBlock;
|
||||
import com.simibubi.create.modules.kinetics.base.KineticTileEntity;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Direction.Axis;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.shapes.ISelectionContext;
|
||||
import net.minecraft.util.math.shapes.VoxelShape;
|
||||
import net.minecraft.util.math.shapes.VoxelShapes;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class TurntableBlock extends KineticBlock {
|
||||
|
||||
protected static final VoxelShape SHAPE = VoxelShapes.or(
|
||||
Block.makeCuboidShape(1.0D, 6.0D, 1.0D, 15.0D, 8.0D, 15.0D),
|
||||
Block.makeCuboidShape(5.0D, 0.0D, 5.0D, 11.0D, 6.0D, 11.0D));
|
||||
|
||||
public TurntableBlock() {
|
||||
super(Properties.create(Material.ROCK));
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity(BlockState state, IBlockReader world) {
|
||||
return new TurntableTileEntity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) {
|
||||
return SHAPE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLanded(IBlockReader worldIn, Entity e) {
|
||||
TileEntity te = worldIn.getTileEntity(e.getPosition());
|
||||
if (!(te instanceof KineticTileEntity))
|
||||
return;
|
||||
|
||||
float speed = ((KineticTileEntity) te).getSpeed() / 20;
|
||||
World world = e.getEntityWorld();
|
||||
|
||||
if (speed == 0) {
|
||||
super.onLanded(worldIn, e);
|
||||
return;
|
||||
}
|
||||
if (world.isRemote) {
|
||||
super.onLanded(worldIn, e);
|
||||
return;
|
||||
}
|
||||
if ((e instanceof PlayerEntity)) {
|
||||
super.onLanded(worldIn, e);
|
||||
return;
|
||||
}
|
||||
if ((e instanceof LivingEntity)) {
|
||||
float offset = e.getRotationYawHead() - speed;
|
||||
e.setRenderYawOffset(offset);
|
||||
e.setRotationYawHead(offset);
|
||||
super.onLanded(worldIn, e);
|
||||
return;
|
||||
}
|
||||
|
||||
e.rotationYaw -= speed;
|
||||
|
||||
super.onLanded(worldIn, e);
|
||||
}
|
||||
|
||||
// IRotate:
|
||||
|
||||
@Override
|
||||
public boolean isAxisTowards(World world, BlockPos pos, BlockState state, Direction face) {
|
||||
return face == Direction.DOWN;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Axis getRotationAxis(BlockState state) {
|
||||
return Axis.Y;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean hasStaticPart() {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
package com.simibubi.create.modules.kinetics.receivers;
|
||||
|
||||
import com.simibubi.create.AllBlocks;
|
||||
import com.simibubi.create.modules.kinetics.base.KineticTileEntity;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.event.TickEvent.RenderTickEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
|
||||
|
||||
@EventBusSubscriber(value = Dist.CLIENT)
|
||||
public class TurntableHandler {
|
||||
|
||||
@SubscribeEvent
|
||||
public static void onRenderTick(RenderTickEvent event) {
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
|
||||
if (mc.world == null || mc.player == null)
|
||||
return;
|
||||
|
||||
if (!AllBlocks.TURNTABLE.typeOf(mc.world.getBlockState(mc.player.getPosition())))
|
||||
return;
|
||||
|
||||
if (!mc.player.onGround)
|
||||
return;
|
||||
|
||||
if (mc.isGamePaused())
|
||||
return;
|
||||
|
||||
KineticTileEntity te = (KineticTileEntity) mc.world.getTileEntity(mc.player.getPosition());
|
||||
float speed = te.getSpeed() / 19;
|
||||
mc.player.rotationYaw = mc.player.prevRotationYaw - speed * mc.getRenderPartialTicks();
|
||||
mc.player.renderYawOffset = mc.player.rotationYaw;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
package com.simibubi.create.modules.kinetics.receivers;
|
||||
|
||||
import com.simibubi.create.AllTileEntities;
|
||||
import com.simibubi.create.modules.kinetics.base.KineticTileEntity;
|
||||
|
||||
public class TurntableTileEntity extends KineticTileEntity {
|
||||
|
||||
public TurntableTileEntity() {
|
||||
super(AllTileEntities.TURNTABLE.type);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,64 @@
|
|||
package com.simibubi.create.modules.kinetics.relays;
|
||||
|
||||
import com.simibubi.create.modules.kinetics.base.RotatedPillarKineticBlock;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.item.BlockItemUseContext;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Direction.Axis;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.shapes.ISelectionContext;
|
||||
import net.minecraft.util.math.shapes.VoxelShape;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class AxisBlock extends RotatedPillarKineticBlock {
|
||||
|
||||
protected static final VoxelShape AXIS_X = makeCuboidShape(0, 5, 5, 16, 11, 11);
|
||||
protected static final VoxelShape AXIS_Y = makeCuboidShape(5, 0, 5, 11, 16, 11);
|
||||
protected static final VoxelShape AXIS_Z = makeCuboidShape(5, 5, 0, 11, 11, 16);
|
||||
|
||||
public AxisBlock(Properties properties) {
|
||||
super(properties);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity(BlockState state, IBlockReader world) {
|
||||
return new AxisTileEntity();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean hasStaticPart() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) {
|
||||
return state.get(AXIS) == Axis.X ? AXIS_X : state.get(AXIS) == Axis.Z ? AXIS_Z : AXIS_Y;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState getStateForPlacement(BlockItemUseContext context) {
|
||||
BlockState placedAgainst = context.getWorld()
|
||||
.getBlockState(context.getPos().offset(context.getFace().getOpposite()));
|
||||
|
||||
if (!(placedAgainst.getBlock() instanceof AxisBlock))
|
||||
return super.getStateForPlacement(context);
|
||||
|
||||
return getDefaultState().with(AXIS, placedAgainst.get(AXIS));
|
||||
}
|
||||
|
||||
// IRotate:
|
||||
|
||||
@Override
|
||||
public boolean isAxisTowards(World world, BlockPos pos, BlockState state, Direction face) {
|
||||
return face.getAxis() == state.get(AXIS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Axis getRotationAxis(BlockState state) {
|
||||
return state.get(AXIS);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package com.simibubi.create.modules.kinetics.relays;
|
||||
|
||||
import com.simibubi.create.AllTileEntities;
|
||||
import com.simibubi.create.modules.kinetics.base.KineticTileEntity;
|
||||
|
||||
public class AxisTileEntity extends KineticTileEntity {
|
||||
|
||||
public AxisTileEntity() {
|
||||
super(AllTileEntities.AXIS.type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasFastRenderer() {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,54 @@
|
|||
package com.simibubi.create.modules.kinetics.relays;
|
||||
|
||||
import com.simibubi.create.modules.kinetics.base.RotatedPillarKineticBlock;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.block.material.PushReaction;
|
||||
import net.minecraft.item.BlockItemUseContext;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Direction.Axis;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class AxisTunnelBlock extends RotatedPillarKineticBlock {
|
||||
|
||||
public AxisTunnelBlock() {
|
||||
super(Properties.from(Blocks.ANDESITE));
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity(BlockState state, IBlockReader world) {
|
||||
return new AxisTunnelTileEntity();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean hasStaticPart() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PushReaction getPushReaction(BlockState state) {
|
||||
return PushReaction.PUSH_ONLY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState getStateForPlacement(BlockItemUseContext context) {
|
||||
if (context.isPlacerSneaking())
|
||||
return super.getStateForPlacement(context);
|
||||
return this.getDefaultState().with(AXIS, context.getNearestLookingDirection().getAxis());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAxisTowards(World world, BlockPos pos, BlockState state, Direction face) {
|
||||
return face.getAxis() == state.get(AXIS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Axis getRotationAxis(BlockState state) {
|
||||
return state.get(AXIS);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package com.simibubi.create.modules.kinetics.relays;
|
||||
|
||||
import com.simibubi.create.AllTileEntities;
|
||||
import com.simibubi.create.modules.kinetics.base.KineticTileEntity;
|
||||
|
||||
public class AxisTunnelTileEntity extends KineticTileEntity {
|
||||
|
||||
public AxisTunnelTileEntity() {
|
||||
super(AllTileEntities.AXIS_TUNNEL.type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasFastRenderer() {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package com.simibubi.create.modules.kinetics.relays;
|
||||
|
||||
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.state.properties.BlockStateProperties;
|
||||
|
||||
public class AxisTunnelTileEntityRenderer extends KineticTileEntityRenderer {
|
||||
|
||||
@Override
|
||||
protected BlockState getRenderedBlockState(KineticTileEntity te) {
|
||||
return AllBlocks.AXIS.get().getDefaultState().with(BlockStateProperties.AXIS,
|
||||
te.getBlockState().get(BlockStateProperties.AXIS));
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,68 @@
|
|||
package com.simibubi.create.modules.kinetics.relays;
|
||||
|
||||
import com.simibubi.create.AllBlocks;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Direction.Axis;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.shapes.ISelectionContext;
|
||||
import net.minecraft.util.math.shapes.VoxelShape;
|
||||
import net.minecraft.util.math.shapes.VoxelShapes;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.IWorldReader;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class CogWheelBlock extends AxisBlock {
|
||||
|
||||
private boolean isLarge;
|
||||
|
||||
protected static final VoxelShape GEAR_X = makeCuboidShape(6, 2, 2, 10, 14, 14);
|
||||
protected static final VoxelShape GEAR_Y = makeCuboidShape(2, 6, 2, 14, 10, 14);
|
||||
protected static final VoxelShape GEAR_Z = makeCuboidShape(2, 2, 6, 14, 14, 10);
|
||||
|
||||
protected static final VoxelShape LARGE_GEAR_X = makeCuboidShape(6, 0, 0, 10, 16, 16);
|
||||
protected static final VoxelShape LARGE_GEAR_Y = makeCuboidShape(0, 6, 0, 16, 10, 16);
|
||||
protected static final VoxelShape LARGE_GEAR_Z = makeCuboidShape(0, 0, 6, 16, 16, 10);
|
||||
|
||||
public CogWheelBlock(boolean large) {
|
||||
super(Properties.from(Blocks.STRIPPED_SPRUCE_LOG));
|
||||
isLarge = large;
|
||||
}
|
||||
|
||||
@Override
|
||||
public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) {
|
||||
return VoxelShapes.or(super.getShape(state, worldIn, pos, context), getGearShape(state));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValidPosition(BlockState state, IWorldReader worldIn, BlockPos pos) {
|
||||
for (Direction facing : Direction.values()) {
|
||||
if (facing.getAxis() == state.get(AXIS))
|
||||
continue;
|
||||
|
||||
BlockState blockState = worldIn.getBlockState(pos.offset(facing));
|
||||
if (AllBlocks.LARGE_GEAR.typeOf(blockState) || isLarge && AllBlocks.GEAR.typeOf(blockState))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private VoxelShape getGearShape(BlockState state) {
|
||||
if (state.get(AXIS) == Axis.X)
|
||||
return isLarge ? LARGE_GEAR_X : GEAR_X;
|
||||
if (state.get(AXIS) == Axis.Z)
|
||||
return isLarge ? LARGE_GEAR_Z : GEAR_Z;
|
||||
|
||||
return isLarge ? LARGE_GEAR_Y : GEAR_Y;
|
||||
}
|
||||
|
||||
// IRotate
|
||||
|
||||
@Override
|
||||
public boolean isGearTowards(World world, BlockPos pos, BlockState state, Direction face) {
|
||||
return !isLarge && face.getAxis() != state.get(AXIS);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
package com.simibubi.create.modules.kinetics.relays;
|
||||
|
||||
import com.simibubi.create.modules.kinetics.base.RotatedPillarKineticBlock;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.block.material.PushReaction;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class GearboxBlock extends RotatedPillarKineticBlock {
|
||||
|
||||
public GearboxBlock() {
|
||||
super(Properties.from(Blocks.ANDESITE));
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity(BlockState state, IBlockReader world) {
|
||||
return new GearboxTileEntity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public PushReaction getPushReaction(BlockState state) {
|
||||
return PushReaction.PUSH_ONLY;
|
||||
}
|
||||
|
||||
// IRotate:
|
||||
|
||||
@Override
|
||||
public boolean isAxisTowards(World world, BlockPos pos, BlockState state, Direction face) {
|
||||
return face.getAxis() != state.get(AXIS);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean hasStaticPart() {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
package com.simibubi.create.modules.kinetics.relays;
|
||||
|
||||
import com.simibubi.create.AllTileEntities;
|
||||
import com.simibubi.create.modules.kinetics.base.KineticTileEntity;
|
||||
|
||||
public class GearboxTileEntity extends KineticTileEntity {
|
||||
|
||||
public GearboxTileEntity() {
|
||||
super(AllTileEntities.GEARBOX.type);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,57 @@
|
|||
package com.simibubi.create.modules.kinetics.relays;
|
||||
|
||||
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.BufferBuilder;
|
||||
import net.minecraft.state.properties.BlockStateProperties;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Direction.Axis;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraftforge.client.model.animation.Animation;
|
||||
|
||||
public class GearboxTileEntityRenderer extends KineticTileEntityRenderer {
|
||||
|
||||
@Override
|
||||
public void renderTileEntityFast(KineticTileEntity te, double x, double y, double z, float partialTicks,
|
||||
int destroyStage, BufferBuilder buffer) {
|
||||
final Axis boxAxis = te.getBlockState().get(BlockStateProperties.AXIS);
|
||||
final BlockPos pos = te.getPos();
|
||||
float time = Animation.getWorldTime(Minecraft.getInstance().world, partialTicks);
|
||||
final Vec3d translation = new Vec3d(x, y, z);
|
||||
final BlockState defaultState = AllBlocks.HALF_AXIS.get().getDefaultState();
|
||||
|
||||
for (Direction direction : Direction.values()) {
|
||||
final Axis axis = direction.getAxis();
|
||||
if (boxAxis == axis)
|
||||
continue;
|
||||
if (AllBlocks.GEARBOX.typeOf(getWorld().getBlockState(pos.offset(direction))))
|
||||
continue;
|
||||
|
||||
BlockState state = defaultState.with(BlockStateProperties.FACING, direction);
|
||||
cacheIfMissing(state);
|
||||
|
||||
float offset = getRotationOffsetForPosition(te, pos, axis);
|
||||
float angle = (time * te.getSpeed()) % 360;
|
||||
|
||||
if (te.getSpeed() != 0) {
|
||||
BlockPos source = te.getSource().subtract(te.getPos());
|
||||
Direction sourceFacing = Direction.getFacingFromVector(source.getX(), source.getY(), source.getZ());
|
||||
if (sourceFacing.getAxis() == direction.getAxis())
|
||||
angle *= sourceFacing == direction ? 1 : -1;
|
||||
else if (sourceFacing.getAxisDirection() == direction.getAxisDirection())
|
||||
angle *= -1;
|
||||
}
|
||||
|
||||
angle += offset;
|
||||
angle = angle / 180f * (float) Math.PI;
|
||||
|
||||
renderFromCache(buffer, state, translation, pos, axis, angle);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,57 @@
|
|||
package com.simibubi.create.modules.kinetics.relays;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.item.BlockItemUseContext;
|
||||
import net.minecraft.state.BooleanProperty;
|
||||
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.math.BlockPos;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class GearshifterBlock extends AxisTunnelBlock {
|
||||
|
||||
public static final BooleanProperty POWERED = BlockStateProperties.POWERED;
|
||||
|
||||
public GearshifterBlock() {
|
||||
super();
|
||||
setDefaultState(getDefaultState().with(POWERED, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity(BlockState state, IBlockReader world) {
|
||||
return new GearshifterTileEntity();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void fillStateContainer(Builder<Block, BlockState> builder) {
|
||||
builder.add(POWERED);
|
||||
super.fillStateContainer(builder);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState getStateForPlacement(BlockItemUseContext context) {
|
||||
return super.getStateForPlacement(context).with(POWERED,
|
||||
Boolean.valueOf(context.getWorld().isBlockPowered(context.getPos())));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void neighborChanged(BlockState state, World worldIn, BlockPos pos, Block blockIn, BlockPos fromPos,
|
||||
boolean isMoving) {
|
||||
if (worldIn.isRemote)
|
||||
return;
|
||||
|
||||
boolean previouslyPowered = state.get(POWERED);
|
||||
if (previouslyPowered != worldIn.isBlockPowered(pos)) {
|
||||
worldIn.setBlockState(pos, state.cycle(POWERED), 2);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isAxisTowards(World world, BlockPos pos, BlockState state, Direction face) {
|
||||
return super.isAxisTowards(world, pos, state, face);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
package com.simibubi.create.modules.kinetics.relays;
|
||||
|
||||
import com.simibubi.create.AllTileEntities;
|
||||
import com.simibubi.create.modules.kinetics.base.KineticTileEntity;
|
||||
|
||||
public class GearshifterTileEntity extends KineticTileEntity {
|
||||
|
||||
public GearshifterTileEntity() {
|
||||
super(AllTileEntities.GEARSHIFTER.type);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,51 @@
|
|||
package com.simibubi.create.modules.kinetics.relays;
|
||||
|
||||
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.BufferBuilder;
|
||||
import net.minecraft.state.properties.BlockStateProperties;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Direction.Axis;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraftforge.client.model.animation.Animation;
|
||||
|
||||
public class GearshifterTileEntityRenderer extends KineticTileEntityRenderer {
|
||||
|
||||
@Override
|
||||
public void renderTileEntityFast(KineticTileEntity te, double x, double y, double z, float partialTicks,
|
||||
int destroyStage, BufferBuilder buffer) {
|
||||
final Axis boxAxis = te.getBlockState().get(BlockStateProperties.AXIS);
|
||||
final BlockPos pos = te.getPos();
|
||||
float time = Animation.getWorldTime(Minecraft.getInstance().world, partialTicks);
|
||||
final Vec3d translation = new Vec3d(x, y, z);
|
||||
final BlockState defaultState = AllBlocks.HALF_AXIS.get().getDefaultState();
|
||||
|
||||
for (Direction direction : Direction.values()) {
|
||||
final Axis axis = direction.getAxis();
|
||||
if (boxAxis != axis)
|
||||
continue;
|
||||
|
||||
BlockState state = defaultState.with(BlockStateProperties.FACING, direction);
|
||||
cacheIfMissing(state);
|
||||
|
||||
float offset = getRotationOffsetForPosition(te, pos, axis);
|
||||
float angle = (time * te.getSpeed()) % 360;
|
||||
|
||||
if (te.hasSource()) {
|
||||
if (direction != te.getSourceFacing() && te.getBlockState().get(BlockStateProperties.POWERED))
|
||||
angle = -angle;
|
||||
}
|
||||
|
||||
angle += offset;
|
||||
angle = angle / 180f * (float) Math.PI;
|
||||
|
||||
renderFromCache(buffer, state, translation, pos, axis, angle);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -36,7 +36,7 @@ public class SchematicTableTileEntity extends SyncedTileEntity implements ITicka
|
|||
}
|
||||
|
||||
public SchematicTableTileEntity() {
|
||||
this(AllTileEntities.SchematicTable.type);
|
||||
this(AllTileEntities.SCHEMATICTABLE.type);
|
||||
}
|
||||
|
||||
public SchematicTableTileEntity(TileEntityType<?> tileEntityTypeIn) {
|
||||
|
|
|
@ -163,7 +163,7 @@ public class SchematicannonTileEntity extends SyncedTileEntity implements ITicka
|
|||
}
|
||||
|
||||
public SchematicannonTileEntity() {
|
||||
this(AllTileEntities.Schematicannon.type);
|
||||
this(AllTileEntities.SCHEMATICANNON.type);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
11
src/main/resources/assets/create/blockstates/axis.json
Normal file
11
src/main/resources/assets/create/blockstates/axis.json
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"forgemarker": 1,
|
||||
"defaults": {
|
||||
"model": "create:block/axis"
|
||||
},
|
||||
"variants": {
|
||||
"axis=y": { "model": "create:block/axis" },
|
||||
"axis=z": { "model": "create:block/axis", "x": 90 },
|
||||
"axis=x": { "model": "create:block/axis", "x": 90, "y": 90 }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"forgemarker": 1,
|
||||
"defaults": {
|
||||
"model": "create:block/axis_tunnel"
|
||||
},
|
||||
"variants": {
|
||||
"axis=y": { "model": "create:block/axis_tunnel", "x": 90 },
|
||||
"axis=z": { "model": "create:block/axis_tunnel" },
|
||||
"axis=x": { "model": "create:block/axis_tunnel", "y": 90 }
|
||||
}
|
||||
}
|
11
src/main/resources/assets/create/blockstates/gear.json
Normal file
11
src/main/resources/assets/create/blockstates/gear.json
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"forgemarker": 1,
|
||||
"defaults": {
|
||||
"model": "create:block/gear"
|
||||
},
|
||||
"variants": {
|
||||
"axis=y": { "model": "create:block/gear" },
|
||||
"axis=z": { "model": "create:block/gear", "x": 90 },
|
||||
"axis=x": { "model": "create:block/gear", "x": 90, "y": 90 }
|
||||
}
|
||||
}
|
11
src/main/resources/assets/create/blockstates/gearbox.json
Normal file
11
src/main/resources/assets/create/blockstates/gearbox.json
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"forgemarker": 1,
|
||||
"defaults": {
|
||||
"model": "create:block/gearbox"
|
||||
},
|
||||
"variants": {
|
||||
"axis=y": { "model": "create:block/gearbox" },
|
||||
"axis=z": { "model": "create:block/gearbox", "x": 90 },
|
||||
"axis=x": { "model": "create:block/gearbox", "x": 90, "y": 90 }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"forgemarker": 1,
|
||||
"defaults": {
|
||||
"model": "create:block/gearshifter_off"
|
||||
},
|
||||
"variants": {
|
||||
"powered=false,axis=y": { "model": "create:block/gearshifter_off", "x": 90 },
|
||||
"powered=false,axis=z": { "model": "create:block/gearshifter_off" },
|
||||
"powered=false,axis=x": { "model": "create:block/gearshifter_off", "y": 90 },
|
||||
|
||||
"powered=true,axis=y": { "model": "create:block/gearshifter_on", "x": 90 },
|
||||
"powered=true,axis=z": { "model": "create:block/gearshifter_on" },
|
||||
"powered=true,axis=x": { "model": "create:block/gearshifter_on", "y": 90 }
|
||||
}
|
||||
}
|
14
src/main/resources/assets/create/blockstates/half_axis.json
Normal file
14
src/main/resources/assets/create/blockstates/half_axis.json
Normal file
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"forgemarker": 1,
|
||||
"defaults": {
|
||||
"model": "create:block/axis_half"
|
||||
},
|
||||
"variants": {
|
||||
"facing=up": { "model": "create:block/axis_half" },
|
||||
"facing=down": { "model": "create:block/axis_half", "x": 180 },
|
||||
"facing=north": { "model": "create:block/axis_half", "x": 90 },
|
||||
"facing=south": { "model": "create:block/axis_half", "x": 90, "y": 180 },
|
||||
"facing=east": { "model": "create:block/axis_half", "x": 90, "y": 90 },
|
||||
"facing=west": { "model": "create:block/axis_half", "x": 90, "y": 270 }
|
||||
}
|
||||
}
|
11
src/main/resources/assets/create/blockstates/large_gear.json
Normal file
11
src/main/resources/assets/create/blockstates/large_gear.json
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"forgemarker": 1,
|
||||
"defaults": {
|
||||
"model": "create:block/large_gear"
|
||||
},
|
||||
"variants": {
|
||||
"axis=y": { "model": "create:block/large_gear" },
|
||||
"axis=z": { "model": "create:block/large_gear", "x": 90 },
|
||||
"axis=x": { "model": "create:block/large_gear", "x": 90, "y": 90 }
|
||||
}
|
||||
}
|
12
src/main/resources/assets/create/blockstates/motor.json
Normal file
12
src/main/resources/assets/create/blockstates/motor.json
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"forgemarker": 1,
|
||||
"defaults": {
|
||||
"model": "create:block/motor"
|
||||
},
|
||||
"variants": {
|
||||
"facing=north": { "model": "create:block/motor", "y": 180 },
|
||||
"facing=south": { "model": "create:block/motor" },
|
||||
"facing=east": { "model": "create:block/motor", "y": 270 },
|
||||
"facing=west": { "model": "create:block/motor", "y": 90 }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"forgemarker": 1,
|
||||
"defaults": {
|
||||
"model": "create:block/turntable"
|
||||
},
|
||||
"variants": {
|
||||
"": { "model": "create:block/turntable" }
|
||||
}
|
||||
}
|
|
@ -8,6 +8,14 @@
|
|||
"item.create.chorus_chrome_cube": "Chorus Chrome",
|
||||
"item.create.blueprint_and_quill": "Schematic and Quill",
|
||||
"item.create.blueprint": "Schematic",
|
||||
"block.create.gear": "Cogwheel",
|
||||
"block.create.large_gear": "Large Cogwheel",
|
||||
"block.create.turntable": "Turntable",
|
||||
"block.create.gearbox": "Gearbox",
|
||||
"block.create.gearshifter": "Gearshifter",
|
||||
"block.create.axis_tunnel": "Encased Axis",
|
||||
"block.create.axis": "Axis",
|
||||
"block.create.motor": "Motor",
|
||||
"block.create.schematicannon": "Schematicannon",
|
||||
"block.create.schematic_table": "Schematic Table",
|
||||
"block.create.creative_crate": "Schematicannon Creatifier",
|
||||
|
|
24
src/main/resources/assets/create/models/block/axis.json
Normal file
24
src/main/resources/assets/create/models/block/axis.json
Normal file
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
"__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)",
|
||||
"parent": "block/cube",
|
||||
"textures": {
|
||||
"particle": "create:block/axis",
|
||||
"0": "create:block/axis",
|
||||
"1": "create:block/axis_top"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"name": "Axis",
|
||||
"from": [ 6.0, 0.0, 6.0 ],
|
||||
"to": [ 10.0, 16.0, 10.0 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#0", "uv": [ 6.0, 0.0, 10.0, 16.0 ] },
|
||||
"east": { "texture": "#0", "uv": [ 6.0, 0.0, 10.0, 16.0 ] },
|
||||
"south": { "texture": "#0", "uv": [ 6.0, 0.0, 10.0, 16.0 ] },
|
||||
"west": { "texture": "#0", "uv": [ 6.0, 0.0, 10.0, 16.0 ] },
|
||||
"up": { "texture": "#1", "uv": [ 6.0, 6.0, 10.0, 10.0 ] },
|
||||
"down": { "texture": "#1", "uv": [ 6.0, 6.0, 10.0, 10.0 ] }
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
24
src/main/resources/assets/create/models/block/axis_half.json
Normal file
24
src/main/resources/assets/create/models/block/axis_half.json
Normal file
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
"__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)",
|
||||
"parent": "block/cube",
|
||||
"textures": {
|
||||
"particle": "create:block/axis",
|
||||
"0": "create:block/axis",
|
||||
"1": "create:block/axis_top"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"name": "Axis",
|
||||
"from": [ 6.0, 8.0, 6.0 ],
|
||||
"to": [ 10.0, 16.0, 10.0 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#0", "uv": [ 6.0, 0.0, 10.0, 8.0 ] },
|
||||
"east": { "texture": "#0", "uv": [ 6.0, 0.0, 10.0, 8.0 ] },
|
||||
"south": { "texture": "#0", "uv": [ 6.0, 0.0, 10.0, 8.0 ] },
|
||||
"west": { "texture": "#0", "uv": [ 6.0, 0.0, 10.0, 8.0 ] },
|
||||
"up": { "texture": "#1", "uv": [ 6.0, 6.0, 10.0, 10.0 ] },
|
||||
"down": { "texture": "#1", "uv": [ 6.0, 6.0, 10.0, 10.0 ] }
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,68 @@
|
|||
{
|
||||
"__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)",
|
||||
"parent": "block/cube",
|
||||
"textures": {
|
||||
"0": "create:block/gearbox_top",
|
||||
"1": "create:block/gearbox",
|
||||
"particle": "create:block/gearbox_top"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"name": "Bottom",
|
||||
"from": [ 0.0, 0.0, 0.0 ],
|
||||
"to": [ 16.0, 2.0, 16.0 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#0", "uv": [ 0.0, 14.0, 16.0, 16.0 ] },
|
||||
"east": { "texture": "#0", "uv": [ 0.0, 14.0, 16.0, 16.0 ] },
|
||||
"south": { "texture": "#0", "uv": [ 0.0, 14.0, 16.0, 16.0 ] },
|
||||
"west": { "texture": "#0", "uv": [ 0.0, 14.0, 16.0, 16.0 ] },
|
||||
"up": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 16.0 ] },
|
||||
"down": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 16.0 ] }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Core",
|
||||
"from": [ 1.0, 2.0, 1.0 ],
|
||||
"to": [ 15.0, 14.0, 15.0 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#1", "uv": [ 1.0, 2.0, 15.0, 14.0 ] },
|
||||
"south": { "texture": "#1", "uv": [ 1.0, 2.0, 15.0, 14.0 ] }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Top",
|
||||
"from": [ 0.0, 14.0, 0.0 ],
|
||||
"to": [ 16.0, 16.0, 16.0 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 2.0 ] },
|
||||
"east": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 2.0 ] },
|
||||
"south": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 2.0 ] },
|
||||
"west": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 2.0 ] },
|
||||
"up": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 16.0 ] },
|
||||
"down": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 16.0 ] }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "SideWest",
|
||||
"from": [ 0.0, 2.0, 0.0 ],
|
||||
"to": [ 2.0, 14.0, 16.0 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#0", "uv": [ 14.0, 2.0, 16.0, 14.0 ] },
|
||||
"east": { "texture": "#0", "uv": [ 0.0, 2.0, 16.0, 14.0 ] },
|
||||
"south": { "texture": "#0", "uv": [ 0.0, 2.0, 2.0, 14.0 ] },
|
||||
"west": { "texture": "#0", "uv": [ 0.0, 2.0, 16.0, 14.0 ] }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "SideEast",
|
||||
"from": [ 14.0, 2.0, 0.0 ],
|
||||
"to": [ 16.0, 14.0, 16.0 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#0", "uv": [ 0.0, 2.0, 2.0, 14.0 ] },
|
||||
"east": { "texture": "#0", "uv": [ 0.0, 2.0, 16.0, 14.0 ] },
|
||||
"south": { "texture": "#0", "uv": [ 14.0, 2.0, 16.0, 14.0 ] },
|
||||
"west": { "texture": "#0", "uv": [ 0.0, 2.0, 16.0, 14.0 ] }
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
106
src/main/resources/assets/create/models/block/gear.json
Normal file
106
src/main/resources/assets/create/models/block/gear.json
Normal file
|
@ -0,0 +1,106 @@
|
|||
{
|
||||
"__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)",
|
||||
"parent": "block/cube",
|
||||
"textures": {
|
||||
"particle": "block/stripped_spruce_log",
|
||||
"0": "create:block/axis",
|
||||
"1": "block/stripped_spruce_log",
|
||||
"2": "block/stripped_spruce_log_top",
|
||||
"3": "create:block/axis_top"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"name": "Axis",
|
||||
"from": [ 6.0, 0.0, 6.0 ],
|
||||
"to": [ 10.0, 16.0, 10.0 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#0", "uv": [ 6.0, 0.0, 10.0, 16.0 ] },
|
||||
"east": { "texture": "#0", "uv": [ 6.0, 0.0, 10.0, 16.0 ] },
|
||||
"south": { "texture": "#0", "uv": [ 6.0, 0.0, 10.0, 16.0 ] },
|
||||
"west": { "texture": "#0", "uv": [ 6.0, 0.0, 10.0, 16.0 ] },
|
||||
"up": { "texture": "#3", "uv": [ 6.0, 6.0, 10.0, 10.0 ] },
|
||||
"down": { "texture": "#3", "uv": [ 6.0, 6.0, 10.0, 10.0 ] }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Gear",
|
||||
"from": [ -1.0, 6.5, 6.5 ],
|
||||
"to": [ 17.0, 9.5, 9.5 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#1", "uv": [ 6.0, 0.0, 9.0, 16.0 ], "rotation": 90 },
|
||||
"east": { "texture": "#1", "uv": [ 1.0, 3.0, 4.0, 6.0 ] },
|
||||
"south": { "texture": "#1", "uv": [ 0.0, 0.0, 16.0, 3.0 ] },
|
||||
"west": { "texture": "#1", "uv": [ 5.0, 10.0, 8.0, 13.0 ] },
|
||||
"up": { "texture": "#1", "uv": [ 0.0, 0.0, 16.0, 3.0 ] },
|
||||
"down": { "texture": "#1", "uv": [ 0.0, 0.0, 16.0, 3.0 ] }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Gear2",
|
||||
"from": [ -1.0, 6.5, 6.5 ],
|
||||
"to": [ 17.0, 9.5, 9.5 ],
|
||||
"rotation": { "origin": [ 8.0, 8.0, 8.0 ], "axis": "y", "angle": 45.0 },
|
||||
"faces": {
|
||||
"north": { "texture": "#1", "uv": [ 0.0, 0.0, 16.0, 3.0 ] },
|
||||
"east": { "texture": "#1", "uv": [ 0.0, 0.0, 3.0, 3.0 ] },
|
||||
"south": { "texture": "#1", "uv": [ 0.0, 0.0, 16.0, 3.0 ] },
|
||||
"west": { "texture": "#1", "uv": [ 0.0, 0.0, 3.0, 3.0 ] },
|
||||
"up": { "texture": "#1", "uv": [ 0.0, 0.0, 16.0, 3.0 ] },
|
||||
"down": { "texture": "#1", "uv": [ 0.0, 0.0, 16.0, 3.0 ] }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Gear3",
|
||||
"from": [ -1.0, 6.5, 6.5 ],
|
||||
"to": [ 17.0, 9.5, 9.5 ],
|
||||
"rotation": { "origin": [ 8.0, 8.0, 8.0 ], "axis": "y", "angle": -45.0 },
|
||||
"faces": {
|
||||
"north": { "texture": "#1", "uv": [ 0.0, 0.0, 16.0, 3.0 ] },
|
||||
"east": { "texture": "#1", "uv": [ 0.0, 0.0, 3.0, 3.0 ] },
|
||||
"south": { "texture": "#1", "uv": [ 0.0, 0.0, 16.0, 3.0 ] },
|
||||
"west": { "texture": "#1", "uv": [ 0.0, 0.0, 3.0, 3.0 ] },
|
||||
"up": { "texture": "#1", "uv": [ 0.0, 0.0, 16.0, 3.0 ] },
|
||||
"down": { "texture": "#1", "uv": [ 0.0, 0.0, 16.0, 3.0 ] }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Gear4",
|
||||
"from": [ 6.5, 6.5, -1.0 ],
|
||||
"to": [ 9.5, 9.5, 17.0 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#1", "uv": [ 0.0, 0.0, 3.0, 3.0 ] },
|
||||
"east": { "texture": "#1", "uv": [ 0.0, 0.0, 16.0, 3.0 ] },
|
||||
"south": { "texture": "#1", "uv": [ 0.0, 0.0, 3.0, 3.0 ] },
|
||||
"west": { "texture": "#1", "uv": [ 0.0, 0.0, 16.0, 3.0 ] },
|
||||
"up": { "texture": "#1", "uv": [ 0.0, 0.0, 3.0, 16.0 ] },
|
||||
"down": { "texture": "#1", "uv": [ 0.0, 0.0, 3.0, 16.0 ] }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "GearCaseInner",
|
||||
"from": [ 2.0, 7.0, 2.0 ],
|
||||
"to": [ 14.0, 9.0, 14.0 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#1", "uv": [ 0.0, 0.0, 12.0, 2.0 ] },
|
||||
"east": { "texture": "#1", "uv": [ 0.0, 0.0, 12.0, 2.0 ] },
|
||||
"south": { "texture": "#1", "uv": [ 0.0, 0.0, 12.0, 2.0 ] },
|
||||
"west": { "texture": "#1", "uv": [ 0.0, 0.0, 12.0, 2.0 ] },
|
||||
"up": { "texture": "#2", "uv": [ 2.0, 2.0, 14.0, 14.0 ] },
|
||||
"down": { "texture": "#2", "uv": [ 2.0, 2.0, 14.0, 14.0 ] }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "GearCaseOuter",
|
||||
"from": [ 4.0, 6.0, 4.0 ],
|
||||
"to": [ 12.0, 10.0, 12.0 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#1", "uv": [ 0.0, 0.0, 8.0, 4.0 ] },
|
||||
"east": { "texture": "#1", "uv": [ 0.0, 0.0, 8.0, 4.0 ] },
|
||||
"south": { "texture": "#1", "uv": [ 0.0, 0.0, 8.0, 4.0 ] },
|
||||
"west": { "texture": "#1", "uv": [ 0.0, 0.0, 8.0, 4.0 ] },
|
||||
"up": { "texture": "#2", "uv": [ 4.0, 4.0, 12.0, 12.0 ] },
|
||||
"down": { "texture": "#2", "uv": [ 4.0, 4.0, 12.0, 12.0 ] }
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
48
src/main/resources/assets/create/models/block/gearbox.json
Normal file
48
src/main/resources/assets/create/models/block/gearbox.json
Normal file
|
@ -0,0 +1,48 @@
|
|||
{
|
||||
"__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)",
|
||||
"parent": "block/cube",
|
||||
"textures": {
|
||||
"0": "create:block/gearbox_top",
|
||||
"1": "create:block/gearbox",
|
||||
"particle": "create:block/gearbox_top"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"name": "Bottom",
|
||||
"from": [ 0.0, 0.0, 0.0 ],
|
||||
"to": [ 16.0, 2.0, 16.0 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#0", "uv": [ 0.0, 14.0, 16.0, 16.0 ] },
|
||||
"east": { "texture": "#0", "uv": [ 0.0, 14.0, 16.0, 16.0 ] },
|
||||
"south": { "texture": "#0", "uv": [ 0.0, 14.0, 16.0, 16.0 ] },
|
||||
"west": { "texture": "#0", "uv": [ 0.0, 14.0, 16.0, 16.0 ] },
|
||||
"up": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 16.0 ] },
|
||||
"down": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 16.0 ] }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Core",
|
||||
"from": [ 1.0, 2.0, 1.0 ],
|
||||
"to": [ 15.0, 14.0, 15.0 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#1", "uv": [ 1.0, 2.0, 15.0, 14.0 ] },
|
||||
"east": { "texture": "#1", "uv": [ 1.0, 2.0, 15.0, 14.0 ] },
|
||||
"south": { "texture": "#1", "uv": [ 1.0, 2.0, 15.0, 14.0 ] },
|
||||
"west": { "texture": "#1", "uv": [ 1.0, 2.0, 15.0, 14.0 ] }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Top",
|
||||
"from": [ 0.0, 14.0, 0.0 ],
|
||||
"to": [ 16.0, 16.0, 16.0 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 2.0 ] },
|
||||
"east": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 2.0 ] },
|
||||
"south": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 2.0 ] },
|
||||
"west": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 2.0 ] },
|
||||
"up": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 16.0 ] },
|
||||
"down": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 16.0 ] }
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,68 @@
|
|||
{
|
||||
"__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)",
|
||||
"parent": "block/cube",
|
||||
"textures": {
|
||||
"0": "create:block/gearshifter_off",
|
||||
"1": "create:block/gearbox",
|
||||
"particle": "create:block/gearshifter_off"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"name": "Bottom",
|
||||
"from": [ 0.0, 0.0, 0.0 ],
|
||||
"to": [ 16.0, 2.0, 16.0 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#0", "uv": [ 0.0, 14.0, 16.0, 16.0 ] },
|
||||
"east": { "texture": "#0", "uv": [ 0.0, 14.0, 16.0, 16.0 ] },
|
||||
"south": { "texture": "#0", "uv": [ 0.0, 14.0, 16.0, 16.0 ] },
|
||||
"west": { "texture": "#0", "uv": [ 0.0, 14.0, 16.0, 16.0 ] },
|
||||
"up": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 16.0 ] },
|
||||
"down": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 16.0 ], "rotation": 270 }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Core",
|
||||
"from": [ 1.0, 2.0, 1.0 ],
|
||||
"to": [ 15.0, 14.0, 15.0 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#1", "uv": [ 1.0, 2.0, 15.0, 14.0 ] },
|
||||
"south": { "texture": "#1", "uv": [ 1.0, 2.0, 15.0, 14.0 ] }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Top",
|
||||
"from": [ 0.0, 14.0, 0.0 ],
|
||||
"to": [ 16.0, 16.0, 16.0 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 2.0 ] },
|
||||
"east": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 2.0 ] },
|
||||
"south": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 2.0 ] },
|
||||
"west": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 2.0 ] },
|
||||
"up": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 16.0 ], "rotation": 90 },
|
||||
"down": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 16.0 ] }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "SideWest",
|
||||
"from": [ 0.0, 2.0, 0.0 ],
|
||||
"to": [ 2.0, 14.0, 16.0 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#0", "uv": [ 14.0, 2.0, 16.0, 14.0 ] },
|
||||
"east": { "texture": "#0", "uv": [ 0.0, 2.0, 16.0, 14.0 ] },
|
||||
"south": { "texture": "#0", "uv": [ 0.0, 2.0, 2.0, 14.0 ] },
|
||||
"west": { "texture": "#0", "uv": [ 0.0, 2.0, 16.0, 14.0 ] }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "SideEast",
|
||||
"from": [ 14.0, 2.0, 0.0 ],
|
||||
"to": [ 16.0, 14.0, 16.0 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#0", "uv": [ 0.0, 2.0, 2.0, 14.0 ] },
|
||||
"east": { "texture": "#0", "uv": [ 0.0, 2.0, 16.0, 14.0 ] },
|
||||
"south": { "texture": "#0", "uv": [ 14.0, 2.0, 16.0, 14.0 ] },
|
||||
"west": { "texture": "#0", "uv": [ 0.0, 2.0, 16.0, 14.0 ] }
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)",
|
||||
"parent": "create:block/gearshifter_off",
|
||||
"textures": {
|
||||
"0": "create:block/gearshifter_on",
|
||||
"particle": "create:block/gearshifter_on"
|
||||
}
|
||||
}
|
176
src/main/resources/assets/create/models/block/large_gear.json
Normal file
176
src/main/resources/assets/create/models/block/large_gear.json
Normal file
|
@ -0,0 +1,176 @@
|
|||
{
|
||||
"__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)",
|
||||
"parent": "block/cube",
|
||||
"textures": {
|
||||
"particle": "block/stripped_spruce_log",
|
||||
"0": "create:block/axis",
|
||||
"1": "block/stripped_spruce_log",
|
||||
"2": "block/stripped_spruce_log_top",
|
||||
"3": "create:block/axis_top"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"name": "Axis",
|
||||
"from": [ 6.0, 0.0, 6.0 ],
|
||||
"to": [ 10.0, 16.0, 10.0 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#0", "uv": [ 6.0, 0.0, 10.0, 16.0 ] },
|
||||
"east": { "texture": "#0", "uv": [ 6.0, 0.0, 10.0, 16.0 ] },
|
||||
"south": { "texture": "#0", "uv": [ 6.0, 0.0, 10.0, 16.0 ] },
|
||||
"west": { "texture": "#0", "uv": [ 6.0, 0.0, 10.0, 16.0 ] },
|
||||
"up": { "texture": "#3", "uv": [ 6.0, 6.0, 10.0, 10.0 ] },
|
||||
"down": { "texture": "#3", "uv": [ 6.0, 6.0, 10.0, 10.0 ] }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Gear2",
|
||||
"from": [ -7.0, 6.5, 6.5 ],
|
||||
"to": [ 23.0, 9.5, 9.5 ],
|
||||
"rotation": { "origin": [ 8.0, 8.0, 8.0 ], "axis": "y", "angle": 22.5 },
|
||||
"faces": {
|
||||
"north": { "texture": "#1", "uv": [ 0.0, 2.0, 16.0, 5.0 ] },
|
||||
"east": { "texture": "#1", "uv": [ 0.0, 0.0, 3.0, 3.0 ] },
|
||||
"south": { "texture": "#1", "uv": [ 0.0, 5.0, 16.0, 8.0 ] },
|
||||
"west": { "texture": "#1", "uv": [ 0.0, 0.0, 3.0, 3.0 ] },
|
||||
"up": { "texture": "#1", "uv": [ 0.0, 6.0, 16.0, 9.0 ] },
|
||||
"down": { "texture": "#1", "uv": [ 0.0, 7.0, 16.0, 10.0 ] }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Gear3",
|
||||
"from": [ -7.0, 6.5, 6.5 ],
|
||||
"to": [ 23.0, 9.5, 9.5 ],
|
||||
"rotation": { "origin": [ 8.0, 8.0, 8.0 ], "axis": "y", "angle": -22.5 },
|
||||
"faces": {
|
||||
"north": { "texture": "#1", "uv": [ 0.0, 7.0, 16.0, 10.0 ] },
|
||||
"east": { "texture": "#1", "uv": [ 0.0, 0.0, 3.0, 3.0 ] },
|
||||
"south": { "texture": "#1", "uv": [ 0.0, 5.0, 16.0, 8.0 ] },
|
||||
"west": { "texture": "#1", "uv": [ 0.0, 0.0, 3.0, 3.0 ] },
|
||||
"up": { "texture": "#1", "uv": [ 0.0, 3.0, 16.0, 6.0 ] },
|
||||
"down": { "texture": "#1", "uv": [ 0.0, 2.0, 16.0, 5.0 ] }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Gear4",
|
||||
"from": [ 6.5, 6.5, -7.0 ],
|
||||
"to": [ 9.5, 9.5, 23.0 ],
|
||||
"rotation": { "origin": [ 8.0, 8.0, 8.0 ], "axis": "y", "angle": 22.5 },
|
||||
"faces": {
|
||||
"north": { "texture": "#1", "uv": [ 0.0, 0.0, 3.0, 3.0 ] },
|
||||
"east": { "texture": "#1", "uv": [ 0.0, 7.0, 16.0, 10.0 ] },
|
||||
"south": { "texture": "#1", "uv": [ 0.0, 0.0, 3.0, 3.0 ] },
|
||||
"west": { "texture": "#1", "uv": [ 0.0, 7.0, 16.0, 10.0 ] },
|
||||
"up": { "texture": "#1", "uv": [ 0.0, 3.0, 16.0, 6.0 ], "rotation": 90 },
|
||||
"down": { "texture": "#1", "uv": [ 0.0, 5.0, 16.0, 8.0 ], "rotation": 90 }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "GearCaseInner",
|
||||
"from": [ -2.0, 7.0, -2.0 ],
|
||||
"to": [ 18.0, 9.0, 18.0 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#1", "uv": [ 0.0, 0.0, 12.0, 2.0 ] },
|
||||
"east": { "texture": "#1", "uv": [ 0.0, 0.0, 12.0, 2.0 ] },
|
||||
"south": { "texture": "#1", "uv": [ 0.0, 0.0, 12.0, 2.0 ] },
|
||||
"west": { "texture": "#1", "uv": [ 0.0, 0.0, 12.0, 2.0 ] },
|
||||
"up": { "texture": "#2", "uv": [ 0.0, 0.0, 16.0, 16.0 ] },
|
||||
"down": { "texture": "#2", "uv": [ 0.0, 0.0, 16.0, 16.0 ] }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "GearCaseOuter",
|
||||
"from": [ 1.0, 5.5, 1.0 ],
|
||||
"to": [ 15.0, 10.5, 15.0 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#1", "uv": [ 1.0, 0.0, 15.0, 5.0 ] },
|
||||
"east": { "texture": "#1", "uv": [ 1.0, 0.0, 15.0, 5.0 ] },
|
||||
"south": { "texture": "#1", "uv": [ 1.0, 0.0, 15.0, 5.0 ] },
|
||||
"west": { "texture": "#1", "uv": [ 1.0, 0.0, 15.0, 5.0 ] },
|
||||
"up": { "texture": "#2", "uv": [ 1.0, 1.0, 15.0, 15.0 ] },
|
||||
"down": { "texture": "#2", "uv": [ 1.0, 1.0, 15.0, 15.0 ] }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Gear",
|
||||
"from": [ 6.5, 6.5, -7.0 ],
|
||||
"to": [ 9.5, 9.5, 23.0 ],
|
||||
"rotation": { "origin": [ 8.0, 8.0, 8.0 ], "axis": "y", "angle": -22.5 },
|
||||
"faces": {
|
||||
"north": { "texture": "#1", "uv": [ 0.0, 0.0, 3.0, 3.0 ] },
|
||||
"east": { "texture": "#1", "uv": [ 0.0, 6.0, 16.0, 9.0 ] },
|
||||
"south": { "texture": "#1", "uv": [ 0.0, 0.0, 3.0, 3.0 ] },
|
||||
"west": { "texture": "#1", "uv": [ 0.0, 8.0, 16.0, 11.0 ] },
|
||||
"up": { "texture": "#1", "uv": [ 0.0, 7.0, 16.0, 10.0 ], "rotation": 90 },
|
||||
"down": { "texture": "#1", "uv": [ 0.0, 5.0, 16.0, 8.0 ], "rotation": 90 }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Gear5",
|
||||
"from": [ -7.0, 6.5, 6.5 ],
|
||||
"to": [ 23.0, 9.5, 9.5 ],
|
||||
"rotation": { "origin": [ 8.0, 8.0, 8.0 ], "axis": "y", "angle": 45.0 },
|
||||
"faces": {
|
||||
"north": { "texture": "#1", "uv": [ 0.0, 4.0, 16.0, 7.0 ] },
|
||||
"east": { "texture": "#1", "uv": [ 0.0, 0.0, 3.0, 3.0 ] },
|
||||
"south": { "texture": "#1", "uv": [ 0.0, 6.0, 16.0, 9.0 ] },
|
||||
"west": { "texture": "#1", "uv": [ 0.0, 0.0, 3.0, 3.0 ] },
|
||||
"up": { "texture": "#1", "uv": [ 0.0, 6.0, 16.0, 9.0 ] },
|
||||
"down": { "texture": "#1", "uv": [ 0.0, 4.0, 16.0, 7.0 ] }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Gear6",
|
||||
"from": [ 6.5, 6.5, -7.0 ],
|
||||
"to": [ 9.5, 9.5, 23.0 ],
|
||||
"rotation": { "origin": [ 8.0, 8.0, 8.0 ], "axis": "y", "angle": 45.0 },
|
||||
"faces": {
|
||||
"north": { "texture": "#1", "uv": [ 0.0, 0.0, 3.0, 3.0 ] },
|
||||
"east": { "texture": "#1", "uv": [ 0.0, 7.0, 16.0, 10.0 ] },
|
||||
"south": { "texture": "#1", "uv": [ 0.0, 0.0, 3.0, 3.0 ] },
|
||||
"west": { "texture": "#1", "uv": [ 0.0, 6.0, 16.0, 9.0 ] },
|
||||
"up": { "texture": "#1", "uv": [ 0.0, 7.0, 16.0, 10.0 ], "rotation": 90 },
|
||||
"down": { "texture": "#1", "uv": [ 0.0, 5.0, 16.0, 8.0 ], "rotation": 90 }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Gear7",
|
||||
"from": [ -7.0, 6.5, 6.500000007450581 ],
|
||||
"to": [ 23.0, 9.5, 9.50000000745058 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#1", "uv": [ 0.0, 7.0, 16.0, 10.0 ] },
|
||||
"east": { "texture": "#1", "uv": [ 0.0, 0.0, 3.0, 3.0 ] },
|
||||
"south": { "texture": "#1", "uv": [ 0.0, 6.0, 16.0, 9.0 ] },
|
||||
"west": { "texture": "#1", "uv": [ 0.0, 0.0, 3.0, 3.0 ] },
|
||||
"up": { "texture": "#1", "uv": [ 0.0, 4.0, 16.0, 7.0 ] },
|
||||
"down": { "texture": "#1", "uv": [ 0.0, 3.0, 16.0, 6.0 ] }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Gear8",
|
||||
"from": [ 6.5, 6.5, -7.0 ],
|
||||
"to": [ 9.5, 9.5, 23.0 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#1", "uv": [ 0.0, 0.0, 3.0, 3.0 ] },
|
||||
"east": { "texture": "#1", "uv": [ 0.0, 9.0, 16.0, 12.0 ] },
|
||||
"south": { "texture": "#1", "uv": [ 0.0, 0.0, 3.0, 3.0 ] },
|
||||
"west": { "texture": "#1", "uv": [ 0.0, 6.0, 16.0, 9.0 ] },
|
||||
"up": { "texture": "#1", "uv": [ 0.0, 8.0, 16.0, 11.0 ], "rotation": 90 },
|
||||
"down": { "texture": "#1", "uv": [ 0.0, 7.0, 16.0, 10.0 ], "rotation": 90 }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "GearCaseInnerRotated",
|
||||
"from": [ -2.0, 6.9, -2.0 ],
|
||||
"to": [ 18.0, 8.9, 18.0 ],
|
||||
"rotation": { "origin": [ 8.0, 8.0, 8.0 ], "axis": "y", "angle": 45.0 },
|
||||
"faces": {
|
||||
"north": { "texture": "#1", "uv": [ 0.0, 0.0, 12.0, 2.0 ] },
|
||||
"east": { "texture": "#1", "uv": [ 0.0, 0.0, 12.0, 2.0 ] },
|
||||
"south": { "texture": "#1", "uv": [ 0.0, 0.0, 12.0, 2.0 ] },
|
||||
"west": { "texture": "#1", "uv": [ 0.0, 0.0, 12.0, 2.0 ] },
|
||||
"up": { "texture": "#2", "uv": [ 0.0, 0.0, 16.0, 16.0 ] },
|
||||
"down": { "texture": "#2", "uv": [ 0.0, 0.0, 16.0, 16.0 ] }
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
142
src/main/resources/assets/create/models/block/motor.json
Normal file
142
src/main/resources/assets/create/models/block/motor.json
Normal file
|
@ -0,0 +1,142 @@
|
|||
{
|
||||
"__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)",
|
||||
"parent": "block/cube",
|
||||
"textures": {
|
||||
"particle": "block/iron_block",
|
||||
"0": "block/chiseled_stone_bricks",
|
||||
"1": "block/stone_bricks",
|
||||
"2": "block/anvil",
|
||||
"3": "block/iron_block",
|
||||
"4": "block/stone"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"name": "Base",
|
||||
"from": [ 1.0, 0.0, 2.0 ],
|
||||
"to": [ 15.0, 1.0, 10.0 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#0", "uv": [ 0.0, 4.0, 14.0, 5.0 ] },
|
||||
"east": { "texture": "#0", "uv": [ 4.0, 12.0, 12.0, 13.0 ] },
|
||||
"south": { "texture": "#0", "uv": [ 1.0, 10.0, 15.0, 11.0 ] },
|
||||
"west": { "texture": "#0", "uv": [ 3.0, 15.0, 11.0, 16.0 ] },
|
||||
"up": { "texture": "#0", "uv": [ 1.0, 3.0, 15.0, 11.0 ] },
|
||||
"down": { "texture": "#1", "uv": [ 1.0, 0.0, 15.0, 8.0 ], "rotation": 180 }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "BaseTop",
|
||||
"from": [ 4.0, 1.0, 2.0 ],
|
||||
"to": [ 12.0, 4.0, 10.0 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#0", "uv": [ 4.0, 0.0, 12.0, 3.0 ] },
|
||||
"east": { "texture": "#0", "uv": [ 4.0, 0.0, 12.0, 3.0 ] },
|
||||
"south": { "texture": "#0", "uv": [ 4.0, 0.0, 12.0, 3.0 ] },
|
||||
"west": { "texture": "#0", "uv": [ 4.0, 0.0, 12.0, 3.0 ] }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Back",
|
||||
"from": [ 3.0, 3.0, 0.0 ],
|
||||
"to": [ 13.0, 13.0, 2.0 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#2", "uv": [ 3.0, 3.0, 13.0, 13.0 ] },
|
||||
"east": { "texture": "#2", "uv": [ 1.0, 3.0, 3.0, 13.0 ] },
|
||||
"south": { "texture": "#2", "uv": [ 3.0, 3.0, 13.0, 13.0 ] },
|
||||
"west": { "texture": "#2", "uv": [ 13.0, 3.0, 15.0, 13.0 ] },
|
||||
"up": { "texture": "#2", "uv": [ 3.0, 1.0, 13.0, 3.0 ] },
|
||||
"down": { "texture": "#2", "uv": [ 3.0, 13.0, 13.0, 15.0 ] }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Front Rim",
|
||||
"from": [ 3.0, 3.0, 13.0 ],
|
||||
"to": [ 13.0, 13.0, 14.0 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#0", "uv": [ 3.0, 3.0, 13.0, 13.0 ] },
|
||||
"east": { "texture": "#0", "uv": [ 12.0, 3.0, 13.0, 13.0 ] },
|
||||
"south": { "texture": "#0", "uv": [ 3.0, 3.0, 13.0, 13.0 ] },
|
||||
"west": { "texture": "#0", "uv": [ 3.0, 3.0, 4.0, 13.0 ] },
|
||||
"up": { "texture": "#0", "uv": [ 3.0, 3.0, 13.0, 4.0 ] },
|
||||
"down": { "texture": "#0", "uv": [ 3.0, 12.0, 13.0, 13.0 ] }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Back Rim",
|
||||
"from": [ 3.0, 3.0, 10.0 ],
|
||||
"to": [ 13.0, 13.0, 11.0 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#0", "uv": [ 3.0, 3.0, 13.0, 13.0 ] },
|
||||
"east": { "texture": "#0", "uv": [ 12.0, 3.0, 13.0, 13.0 ] },
|
||||
"south": { "texture": "#0", "uv": [ 3.0, 3.0, 13.0, 13.0 ] },
|
||||
"west": { "texture": "#0", "uv": [ 3.0, 3.0, 4.0, 13.0 ] },
|
||||
"up": { "texture": "#0", "uv": [ 3.0, 3.0, 13.0, 4.0 ] },
|
||||
"down": { "texture": "#0", "uv": [ 3.0, 12.0, 13.0, 13.0 ] }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Between Rims",
|
||||
"from": [ 5.0, 5.0, 11.0 ],
|
||||
"to": [ 11.0, 11.0, 13.0 ],
|
||||
"faces": {
|
||||
"east": { "texture": "#2", "uv": [ 0.0, 4.0, 2.0, 10.0 ] },
|
||||
"west": { "texture": "#2", "uv": [ 14.0, 4.0, 16.0, 10.0 ] },
|
||||
"up": { "texture": "#2", "uv": [ 4.0, 0.0, 10.0, 2.0 ] },
|
||||
"down": { "texture": "#2", "uv": [ 4.0, 14.0, 10.0, 16.0 ] }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Body",
|
||||
"from": [ 4.0, 4.0, 2.0 ],
|
||||
"to": [ 12.0, 12.0, 10.0 ],
|
||||
"faces": {
|
||||
"east": { "texture": "#3", "uv": [ 0.0, 4.0, 8.0, 12.0 ] },
|
||||
"west": { "texture": "#3", "uv": [ 0.0, 4.0, 8.0, 12.0 ], "rotation": 180 },
|
||||
"up": { "texture": "#3", "uv": [ 0.0, 4.0, 8.0, 12.0 ], "rotation": 270 }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Corner Top Left",
|
||||
"from": [ 3.5, 11.5, 2.0 ],
|
||||
"to": [ 4.5, 12.5, 13.0 ],
|
||||
"rotation": { "origin": [ 4.0, 12.0, 8.0 ], "axis": "z", "angle": 45.0 },
|
||||
"faces": {
|
||||
"east": { "texture": "#4", "uv": [ 2.0, 3.0, 13.0, 4.0 ] },
|
||||
"west": { "texture": "#4", "uv": [ 2.0, 2.0, 9.0, 1.0 ] },
|
||||
"up": { "texture": "#4", "uv": [ 2.0, 8.0, 13.0, 9.0 ], "rotation": 90 }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Corner Top Right",
|
||||
"from": [ 11.5, 11.5, 2.0 ],
|
||||
"to": [ 12.5, 12.5, 13.0 ],
|
||||
"rotation": { "origin": [ 12.0, 12.0, 8.0 ], "axis": "z", "angle": 45.0 },
|
||||
"faces": {
|
||||
"east": { "texture": "#4", "uv": [ 2.0, 8.0, 13.0, 9.0 ] },
|
||||
"up": { "texture": "#4", "uv": [ 3.0, 3.0, 14.0, 4.0 ], "rotation": 90 },
|
||||
"down": { "texture": "#4", "uv": [ 3.0, 6.0, 14.0, 7.0 ], "rotation": 90 }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Corner Bottom Right",
|
||||
"from": [ 11.5, 3.5, 2.0 ],
|
||||
"to": [ 12.5, 4.5, 13.0 ],
|
||||
"rotation": { "origin": [ 12.0, 4.0, 8.0 ], "axis": "z", "angle": 45.0 },
|
||||
"faces": {
|
||||
"east": { "texture": "#4", "uv": [ 3.0, 6.0, 14.0, 7.0 ] },
|
||||
"west": { "texture": "#4", "uv": [ 3.0, 4.0, 14.0, 5.0 ] },
|
||||
"down": { "texture": "#4", "uv": [ 3.0, 5.0, 14.0, 6.0 ], "rotation": 90 }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Corner Bottom Left",
|
||||
"from": [ 3.5, 3.5, 2.0 ],
|
||||
"to": [ 4.5, 4.5, 13.0 ],
|
||||
"rotation": { "origin": [ 4.0, 4.0, 8.0 ], "axis": "z", "angle": 45.0 },
|
||||
"faces": {
|
||||
"west": { "texture": "#4", "uv": [ 2.0, 5.0, 13.0, 6.0 ] },
|
||||
"up": { "texture": "#4", "uv": [ 2.0, 3.0, 13.0, 4.0 ], "rotation": 90 },
|
||||
"down": { "texture": "#4", "uv": [ 2.0, 7.0, 13.0, 8.0 ], "rotation": 90 }
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
51
src/main/resources/assets/create/models/block/turntable.json
Normal file
51
src/main/resources/assets/create/models/block/turntable.json
Normal file
|
@ -0,0 +1,51 @@
|
|||
{
|
||||
"__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)",
|
||||
"parent": "block/cube",
|
||||
"textures": {
|
||||
"particle": "block/stripped_spruce_log",
|
||||
"0": "create:block/axis",
|
||||
"1": "block/stripped_spruce_log",
|
||||
"2": "block/stripped_spruce_log_top",
|
||||
"3": "create:block/axis_top"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"name": "Axis",
|
||||
"from": [ 6.0, 0.0, 6.0 ],
|
||||
"to": [ 10.0, 7.0, 10.0 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#0", "uv": [ 6.0, 0.0, 10.0, 7.0 ] },
|
||||
"east": { "texture": "#0", "uv": [ 6.0, 0.0, 10.0, 7.0 ] },
|
||||
"south": { "texture": "#0", "uv": [ 6.0, 0.0, 10.0, 7.0 ] },
|
||||
"west": { "texture": "#0", "uv": [ 6.0, 0.0, 10.0, 7.0 ] },
|
||||
"down": { "texture": "#3", "uv": [ 6.0, 6.0, 10.0, 10.0 ] }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "GearCaseInner",
|
||||
"from": [ 1.0, 6.0, 1.0 ],
|
||||
"to": [ 15.0, 8.0, 15.0 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#1", "uv": [ 1.0, 0.0, 15.0, 2.0 ] },
|
||||
"east": { "texture": "#1", "uv": [ 1.0, 0.0, 15.0, 2.0 ] },
|
||||
"south": { "texture": "#1", "uv": [ 1.0, 0.0, 15.0, 2.0 ] },
|
||||
"west": { "texture": "#1", "uv": [ 1.0, 0.0, 15.0, 2.0 ] },
|
||||
"up": { "texture": "#2", "uv": [ 1.0, 1.0, 15.0, 15.0 ] },
|
||||
"down": { "texture": "#2", "uv": [ 1.0, 1.0, 15.0, 15.0 ] }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "GearCaseOuter",
|
||||
"from": [ 4.0, 5.0, 4.0 ],
|
||||
"to": [ 12.0, 6.0, 12.0 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#1", "uv": [ 4.0, 0.0, 12.0, 1.0 ] },
|
||||
"east": { "texture": "#1", "uv": [ 4.0, 0.0, 12.0, 1.0 ] },
|
||||
"south": { "texture": "#1", "uv": [ 4.0, 0.0, 12.0, 1.0 ] },
|
||||
"west": { "texture": "#1", "uv": [ 4.0, 0.0, 12.0, 1.0 ] },
|
||||
"up": { "texture": "#2", "uv": [ 4.0, 4.0, 12.0, 12.0 ] },
|
||||
"down": { "texture": "#2", "uv": [ 4.0, 4.0, 12.0, 12.0 ] }
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
3
src/main/resources/assets/create/models/item/axis.json
Normal file
3
src/main/resources/assets/create/models/item/axis.json
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"parent": "create:block/axis"
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"parent": "create:block/axis_tunnel"
|
||||
}
|
3
src/main/resources/assets/create/models/item/gear.json
Normal file
3
src/main/resources/assets/create/models/item/gear.json
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"parent": "create:block/gear"
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"parent": "create:block/gearbox"
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"parent": "create:block/gearshifter_off"
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"parent": "create:block/large_gear"
|
||||
}
|
3
src/main/resources/assets/create/models/item/motor.json
Normal file
3
src/main/resources/assets/create/models/item/motor.json
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"parent": "create:block/motor"
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"parent": "create:block/turntable"
|
||||
}
|
BIN
src/main/resources/assets/create/textures/block/axis.png
Normal file
BIN
src/main/resources/assets/create/textures/block/axis.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 261 B |
BIN
src/main/resources/assets/create/textures/block/axis_top.png
Normal file
BIN
src/main/resources/assets/create/textures/block/axis_top.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 247 B |
BIN
src/main/resources/assets/create/textures/block/gearbox.png
Normal file
BIN
src/main/resources/assets/create/textures/block/gearbox.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 426 B |
BIN
src/main/resources/assets/create/textures/block/gearbox_top.png
Normal file
BIN
src/main/resources/assets/create/textures/block/gearbox_top.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 361 B |
Binary file not shown.
After Width: | Height: | Size: 410 B |
Binary file not shown.
After Width: | Height: | Size: 421 B |
Loading…
Reference in a new issue