Registrate Progress

- Started moving over a few kinetic blocks from AllBlocks to registrate
- Changed runData to only run client data tasks for now
- Added missing bind to the ContraptionRenderer for Stationary Contraptions
This commit is contained in:
simibubi 2020-05-04 19:57:16 +02:00
parent e27927de15
commit 0c2a33861e
53 changed files with 398 additions and 215 deletions

View file

@ -53,7 +53,7 @@ minecraft {
property 'forge.logging.markers', 'REGISTRIES,REGISTRYDUMP'
property 'forge.logging.console.level', 'debug'
property 'fml.earlyprogresswindow', 'false'
args '--mod', 'create', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources')
args '--mod', 'create', '--client', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources')
mods {
create {
source sourceSets.main

View file

@ -0,0 +1,16 @@
{
"variants": {
"axis=x": {
"model": "create:block/cogwheel",
"x": 90,
"y": 90
},
"axis=y": {
"model": "create:block/cogwheel"
},
"axis=z": {
"model": "create:block/cogwheel",
"x": 90
}
}
}

View file

@ -0,0 +1,16 @@
{
"variants": {
"axis=x": {
"model": "create:block/encased_shaft/block",
"x": 90,
"y": 90
},
"axis=y": {
"model": "create:block/encased_shaft/block"
},
"axis=z": {
"model": "create:block/encased_shaft/block",
"x": 90
}
}
}

View file

@ -0,0 +1,16 @@
{
"variants": {
"axis=x": {
"model": "create:block/large_cogwheel",
"x": 90,
"y": 90
},
"axis=y": {
"model": "create:block/large_cogwheel"
},
"axis=z": {
"model": "create:block/large_cogwheel",
"x": 90
}
}
}

View file

@ -1,7 +1,7 @@
{
"variants": {
"": {
"model": "create:block/schematicannon/base"
"model": "create:block/schematicannon/block"
}
}
}

View file

@ -0,0 +1,16 @@
{
"variants": {
"axis=x": {
"model": "create:block/shaft",
"x": 90,
"y": 90
},
"axis=y": {
"model": "create:block/shaft"
},
"axis=z": {
"model": "create:block/shaft",
"x": 90
}
}
}

View file

@ -1,4 +1,5 @@
{
"block.create.cogwheel": "\u05DF\u01DD\u01DD\u0265\u028Dbo\u0186",
"block.create.creative_crate": "\u01DD\u0287\u0250\u0279\u0186 \u01DD\u028C\u0131\u0287\u0250\u01DD\u0279\u0186",
"block.create.dark_scoria_bricks_slab": "q\u0250\u05DFS s\u029E\u0254\u0131\u0279\u15FA \u0250\u0131\u0279o\u0254S \u029E\u0279\u0250\u15E1",
"block.create.dark_scoria_bricks_stairs": "s\u0279\u0131\u0250\u0287S s\u029E\u0254\u0131\u0279\u15FA \u0250\u0131\u0279o\u0254S \u029E\u0279\u0250\u15E1",
@ -8,12 +9,14 @@
"block.create.dolomite_slab": "q\u0250\u05DFS \u01DD\u0287\u0131\u026Fo\u05DFo\u15E1",
"block.create.dolomite_stairs": "s\u0279\u0131\u0250\u0287S \u01DD\u0287\u0131\u026Fo\u05DFo\u15E1",
"block.create.dolomite_wall": "\u05DF\u05DF\u0250M \u01DD\u0287\u0131\u026Fo\u05DFo\u15E1",
"block.create.encased_shaft": "\u0287\u025F\u0250\u0265S p\u01DDs\u0250\u0254u\u018E",
"block.create.gabbro_bricks_stairs": "s\u0279\u0131\u0250\u0287S s\u029E\u0254\u0131\u0279\u15FA o\u0279qq\u0250\u2141",
"block.create.gabbro_bricks_wall": "\u05DF\u05DF\u0250M s\u029E\u0254\u0131\u0279\u15FA o\u0279qq\u0250\u2141",
"block.create.gabbro_slab": "q\u0250\u05DFS o\u0279qq\u0250\u2141",
"block.create.gabbro_stairs": "s\u0279\u0131\u0250\u0287S o\u0279qq\u0250\u2141",
"block.create.gabbro_wall": "\u05DF\u05DF\u0250M o\u0279qq\u0250\u2141",
"block.create.indented_gabbro_slab": "q\u0250\u05DFS o\u0279qq\u0250\u2141 p\u01DD\u0287u\u01DDpuI",
"block.create.large_cogwheel": "\u05DF\u01DD\u01DD\u0265\u028Dbo\u0186 \u01DDb\u0279\u0250\uA780",
"block.create.limestone_bricks_slab": "q\u0250\u05DFS s\u029E\u0254\u0131\u0279\u15FA \u01DDuo\u0287s\u01DD\u026F\u0131\uA780",
"block.create.limestone_bricks_stairs": "s\u0279\u0131\u0250\u0287S s\u029E\u0254\u0131\u0279\u15FA \u01DDuo\u0287s\u01DD\u026F\u0131\uA780",
"block.create.limestone_bricks_wall": "\u05DF\u05DF\u0250M s\u029E\u0254\u0131\u0279\u15FA \u01DDuo\u0287s\u01DD\u026F\u0131\uA780",
@ -29,6 +32,7 @@
"block.create.scoria_slab": "q\u0250\u05DFS \u0250\u0131\u0279o\u0254S",
"block.create.scoria_stairs": "s\u0279\u0131\u0250\u0287S \u0250\u0131\u0279o\u0254S",
"block.create.scoria_wall": "\u05DF\u05DF\u0250M \u0250\u0131\u0279o\u0254S",
"block.create.shaft": "\u0287\u025F\u0250\u0265S",
"block.create.weathered_limestone_bricks_slab": "q\u0250\u05DFS s\u029E\u0254\u0131\u0279\u15FA \u01DDuo\u0287s\u01DD\u026F\u0131\uA780 p\u01DD\u0279\u01DD\u0265\u0287\u0250\u01DDM",
"block.create.weathered_limestone_bricks_stairs": "s\u0279\u0131\u0250\u0287S s\u029E\u0254\u0131\u0279\u15FA \u01DDuo\u0287s\u01DD\u026F\u0131\uA780 p\u01DD\u0279\u01DD\u0265\u0287\u0250\u01DDM",
"block.create.weathered_limestone_bricks_wall": "\u05DF\u05DF\u0250M s\u029E\u0254\u0131\u0279\u15FA \u01DDuo\u0287s\u01DD\u026F\u0131\uA780 p\u01DD\u0279\u01DD\u0265\u0287\u0250\u01DDM",

View file

@ -1,4 +1,5 @@
{
"block.create.cogwheel": "Cogwheel",
"block.create.creative_crate": "Creative Crate",
"block.create.dark_scoria_bricks_slab": "Dark Scoria Bricks Slab",
"block.create.dark_scoria_bricks_stairs": "Dark Scoria Bricks Stairs",
@ -8,12 +9,14 @@
"block.create.dolomite_slab": "Dolomite Slab",
"block.create.dolomite_stairs": "Dolomite Stairs",
"block.create.dolomite_wall": "Dolomite Wall",
"block.create.encased_shaft": "Encased Shaft",
"block.create.gabbro_bricks_stairs": "Gabbro Bricks Stairs",
"block.create.gabbro_bricks_wall": "Gabbro Bricks Wall",
"block.create.gabbro_slab": "Gabbro Slab",
"block.create.gabbro_stairs": "Gabbro Stairs",
"block.create.gabbro_wall": "Gabbro Wall",
"block.create.indented_gabbro_slab": "Indented Gabbro Slab",
"block.create.large_cogwheel": "Large Cogwheel",
"block.create.limestone_bricks_slab": "Limestone Bricks Slab",
"block.create.limestone_bricks_stairs": "Limestone Bricks Stairs",
"block.create.limestone_bricks_wall": "Limestone Bricks Wall",
@ -29,6 +32,7 @@
"block.create.scoria_slab": "Scoria Slab",
"block.create.scoria_stairs": "Scoria Stairs",
"block.create.scoria_wall": "Scoria Wall",
"block.create.shaft": "Shaft",
"block.create.weathered_limestone_bricks_slab": "Weathered Limestone Bricks Slab",
"block.create.weathered_limestone_bricks_stairs": "Weathered Limestone Bricks Stairs",
"block.create.weathered_limestone_bricks_wall": "Weathered Limestone Bricks Wall",

View file

@ -0,0 +1,3 @@
{
"parent": "create:block/cogwheel"
}

View file

@ -0,0 +1,3 @@
{
"parent": "create:block/encased_shaft/item"
}

View file

@ -0,0 +1,3 @@
{
"parent": "create:block/large_cogwheel"
}

View file

@ -1,3 +1,3 @@
{
"parent": "create:block/schematicannon/base"
"parent": "create:block/schematicannon/item"
}

View file

@ -0,0 +1,3 @@
{
"parent": "create:block/shaft"
}

View file

@ -50,13 +50,9 @@ import com.simibubi.create.modules.contraptions.redstone.ContactBlock;
import com.simibubi.create.modules.contraptions.relays.advanced.SpeedControllerBlock;
import com.simibubi.create.modules.contraptions.relays.advanced.sequencer.SequencedGearshiftBlock;
import com.simibubi.create.modules.contraptions.relays.belt.BeltBlock;
import com.simibubi.create.modules.contraptions.relays.elementary.CogWheelBlock;
import com.simibubi.create.modules.contraptions.relays.elementary.CogwheelBlockItem;
import com.simibubi.create.modules.contraptions.relays.elementary.ShaftBlock;
import com.simibubi.create.modules.contraptions.relays.encased.AdjustablePulleyBlock;
import com.simibubi.create.modules.contraptions.relays.encased.ClutchBlock;
import com.simibubi.create.modules.contraptions.relays.encased.EncasedBeltBlock;
import com.simibubi.create.modules.contraptions.relays.encased.EncasedShaftBlock;
import com.simibubi.create.modules.contraptions.relays.encased.GearshiftBlock;
import com.simibubi.create.modules.contraptions.relays.gauge.GaugeBlock;
import com.simibubi.create.modules.contraptions.relays.gearbox.GearboxBlock;
@ -122,13 +118,14 @@ public enum AllBlocks implements NonNullSupplier<Block> {
_1_(Sections.KINETICS),
SHAFT(() -> new ShaftBlock(Properties.from(Blocks.ANDESITE))),
COGWHEEL(() -> new CogWheelBlock(false), (b, p) -> new CogwheelBlockItem(b, p, false)),
LARGE_COGWHEEL(() -> new CogWheelBlock(true), (b, p) -> new CogwheelBlockItem(b, p, true)),
ENCASED_SHAFT(EncasedShaftBlock::new),
// SHAFT(() -> new ShaftBlock(Properties.from(Blocks.ANDESITE))),
// COGWHEEL(() -> new CogWheelBlock(false), (b, p) -> new CogwheelBlockItem(b, p, false)),
// LARGE_COGWHEEL(() -> new CogWheelBlock(true), (b, p) -> new CogwheelBlockItem(b, p, true)),
// ENCASED_SHAFT(EncasedShaftBlock::new),
GEARBOX(GearboxBlock::new),
CLUTCH(ClutchBlock::new),
GEARSHIFT(GearshiftBlock::new),
ENCASED_BELT(EncasedBeltBlock::new),
ADJUSTABLE_PULLEY(AdjustablePulleyBlock::new),
BELT(BeltBlock::new, ComesWith.NO_BLOCKITEM),

View file

@ -2,28 +2,39 @@ package com.simibubi.create;
import static com.simibubi.create.modules.Sections.SCHEMATICS;
import com.simibubi.create.foundation.utility.data.BlockStateGen;
import com.simibubi.create.modules.Sections;
import com.simibubi.create.modules.contraptions.relays.elementary.CogWheelBlock;
import com.simibubi.create.modules.contraptions.relays.elementary.CogwheelBlockItem;
import com.simibubi.create.modules.contraptions.relays.elementary.ShaftBlock;
import com.simibubi.create.modules.contraptions.relays.encased.EncasedShaftBlock;
import com.simibubi.create.modules.schematics.block.CreativeCrateBlock;
import com.simibubi.create.modules.schematics.block.SchematicTableBlock;
import com.simibubi.create.modules.schematics.block.SchematicannonBlock;
import com.tterrag.registrate.util.RegistryEntry;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.block.SoundType;
import net.minecraft.item.ItemStack;
import net.minecraftforge.registries.IForgeRegistryEntry;
public class AllBlocksNew {
private static final CreateRegistrate REGISTRATE = Create.registrate();
// Tools for strucuture movement and replication
static { REGISTRATE.startSection(SCHEMATICS); }
public static final RegistryEntry<SchematicannonBlock> SCHEMATICANNON = REGISTRATE.block("schematicannon", SchematicannonBlock::new)
.initialProperties(() -> Blocks.DISPENSER)
.blockstate((ctx, prov) -> prov.simpleBlock(ctx.getEntry(), prov.models().getExistingFile(prov.modLoc("block/" + ctx.getName() + "/base"))))
.blockstate((ctx, prov) -> prov.simpleBlock(ctx.getEntry(), BlockStateGen.partialBaseModel(ctx, prov)))
.item()
.model((ctx, prov) -> prov.blockItem(ctx.getEntry()::getBlock, "/item"))
.model(BlockStateGen::customItemModel)
.build()
.register();
public static final RegistryEntry<CreativeCrateBlock> CREATIVE_CRATE = REGISTRATE.block("creative_crate", CreativeCrateBlock::new)
.initialProperties(() -> Blocks.CHEST)
.blockstate((ctx, prov) -> prov.simpleBlock(ctx.getEntry(), prov.models().getExistingFile(ctx.getId())))
@ -36,5 +47,50 @@ public class AllBlocksNew {
.simpleItem()
.register();
static { REGISTRATE.startSection(Sections.KINETICS); }
public static final RegistryEntry<ShaftBlock> SHAFT = REGISTRATE.block("shaft", ShaftBlock::new)
.initialProperties(SharedProperties::kinetic)
.blockstate((c, p) -> BlockStateGen.axisKineticBlock(c, p, BlockStateGen.standardModel(c, p)))
.simpleItem()
.register();
public static final RegistryEntry<CogWheelBlock> COGWHEEL = REGISTRATE.block("cogwheel", CogWheelBlock::small)
.initialProperties(SharedProperties::kinetic)
.properties(p -> p.sound(SoundType.WOOD))
.blockstate((c, p) -> BlockStateGen.axisKineticBlock(c, p, BlockStateGen.standardModel(c, p)))
.item(CogwheelBlockItem::new).build()
.register();
public static final RegistryEntry<CogWheelBlock> LARGE_COGWHEEL = REGISTRATE.block("large_cogwheel", CogWheelBlock::large)
.initialProperties(SharedProperties::kinetic)
.properties(p -> p.sound(SoundType.WOOD))
.blockstate((c, p) -> BlockStateGen.axisKineticBlock(c, p, BlockStateGen.standardModel(c, p)))
.item(CogwheelBlockItem::new).build()
.register();
public static final RegistryEntry<EncasedShaftBlock> ENCASED_SHAFT = REGISTRATE.block("encased_shaft", EncasedShaftBlock::new)
.initialProperties(SharedProperties::kinetic)
.blockstate((c, p) -> BlockStateGen.axisKineticBlock(c, p, BlockStateGen.partialBaseModel(c, p)))
.item()
.model(BlockStateGen::customItemModel)
.build()
.register();
public static void register() {}
// Ideally these following three methods would be part of the RegistryEntry instances
public static <T extends Block & IForgeRegistryEntry<Block>> boolean equals(RegistryEntry<T> entry, BlockState state) {
return entry.map(state.getBlock()::equals).get();
}
public static ItemStack asStack(RegistryEntry<? extends Block> entry) {
return new ItemStack(entry.get());
}
public static BlockState getDefault(RegistryEntry<? extends Block> entry) {
return entry.get().getDefaultState();
}
}

View file

@ -67,6 +67,7 @@ public enum AllEntities {
@SuppressWarnings("unchecked") // TODO 1.15 this generic stuff is incompatible with the enum system - need strong types
@OnlyIn(value = Dist.CLIENT)
public static void registerRenderers() {
RenderingRegistry.registerEntityRenderingHandler((EntityType<ContraptionEntity>) STATIONARY_CONTRAPTION.type, ContraptionEntityRenderer::new);
RenderingRegistry.registerEntityRenderingHandler((EntityType<ContraptionEntity>) CONTRAPTION.type, ContraptionEntityRenderer::new);
RenderingRegistry.registerEntityRenderingHandler((EntityType<SuperGlueEntity>) SUPER_GLUE.type, SuperGlueRenderer::new);
}

View file

@ -108,11 +108,11 @@ public enum AllTileEntities {
SCHEMATICTABLE(SchematicTableTileEntity::new, AllBlocksNew.SCHEMATIC_TABLE),
// Kinetics
SHAFT(ShaftTileEntity::new, AllBlocks.SHAFT, AllBlocks.COGWHEEL, AllBlocks.LARGE_COGWHEEL, AllBlocks.ENCASED_SHAFT),
SHAFT(ShaftTileEntity::new, AllBlocksNew.SHAFT, AllBlocksNew.COGWHEEL, AllBlocksNew.LARGE_COGWHEEL, AllBlocksNew.ENCASED_SHAFT),
MOTOR(MotorTileEntity::new, AllBlocks.CREATIVE_MOTOR),
GEARBOX(GearboxTileEntity::new, AllBlocks.GEARBOX),
TURNTABLE(TurntableTileEntity::new, AllBlocks.TURNTABLE),
ENCASED_SHAFT(EncasedShaftTileEntity::new, AllBlocks.ENCASED_SHAFT, AllBlocks.ENCASED_BELT),
ENCASED_SHAFT(EncasedShaftTileEntity::new, AllBlocksNew.ENCASED_SHAFT, AllBlocks.ENCASED_BELT),
ADJUSTABLE_PULLEY(AdjustablePulleyTileEntity::new, AllBlocks.ADJUSTABLE_PULLEY),
ENCASED_FAN(EncasedFanTileEntity::new, AllBlocks.ENCASED_FAN),
NOZZLE(NozzleTileEntity::new, AllBlocks.NOZZLE),

View file

@ -23,7 +23,7 @@ public final class CreateItemGroup extends ItemGroup {
@Override
public ItemStack createIcon() {
return new ItemStack(AllBlocks.COGWHEEL.get());
return AllBlocksNew.asStack(AllBlocksNew.COGWHEEL);
}
@Override

View file

@ -0,0 +1,12 @@
package com.simibubi.create;
import net.minecraft.block.Block;
import net.minecraft.block.Blocks;
public class SharedProperties {
static Block kinetic() {
return Blocks.ANDESITE;
}
}

View file

@ -1,9 +1,13 @@
package com.simibubi.create.compat.jei.category.animations;
import com.simibubi.create.AllBlocksNew;
import com.simibubi.create.foundation.utility.AnimationTickHolder;
import mezz.jei.api.gui.drawable.IDrawable;
import net.minecraft.block.BlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.state.properties.BlockStateProperties;
import net.minecraft.util.Direction.Axis;
public abstract class AnimatedKinetics implements IDrawable {
@ -11,4 +15,8 @@ public abstract class AnimatedKinetics implements IDrawable {
return ((AnimationTickHolder.ticks + Minecraft.getInstance().getRenderPartialTicks()) * 4f) % 360;
}
protected BlockState shaft(Axis axis) {
return AllBlocksNew.getDefault(AllBlocksNew.SHAFT).with(BlockStateProperties.AXIS, axis);
}
}

View file

@ -5,6 +5,7 @@ import static com.simibubi.create.foundation.utility.AnimationTickHolder.ticks;
import com.mojang.blaze3d.systems.RenderSystem;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllBlocksNew;
import com.simibubi.create.foundation.gui.ScreenElementRenderer;
import net.minecraft.block.BlockState;
@ -68,7 +69,7 @@ public class AnimatedPress extends AnimatedKinetics {
RenderSystem.translatef(t, -t, -t);
RenderSystem.rotatef(getCurrentAngle() * 2, 1, 0, 0);
RenderSystem.translatef(-t, t, t);
return AllBlocks.SHAFT.get().getDefaultState().with(BlockStateProperties.AXIS, Axis.Z);
return AllBlocksNew.getDefault(AllBlocksNew.SHAFT).with(BlockStateProperties.AXIS, Axis.Z);
}
private BlockState body() {

View file

@ -48,7 +48,7 @@ public class AnimatedSaw extends AnimatedKinetics {
RenderSystem.translatef(t, -t, t);
RenderSystem.rotatef(-getCurrentAngle() * 2, 0, 0, 1);
RenderSystem.translatef(-t, t, -t);
return AllBlocks.SHAFT.get().getDefaultState().with(BlockStateProperties.AXIS, Axis.X);
return shaft(Axis.X);
}
private BlockState block() {

View file

@ -0,0 +1,60 @@
package com.simibubi.create.foundation.utility.data;
import com.simibubi.create.modules.contraptions.base.RotatedPillarKineticBlock;
import com.tterrag.registrate.providers.DataGenContext;
import com.tterrag.registrate.providers.RegistrateBlockstateProvider;
import com.tterrag.registrate.providers.RegistrateItemModelProvider;
import com.tterrag.registrate.util.nullness.NonnullType;
import net.minecraft.block.Block;
import net.minecraft.block.RotatedPillarBlock;
import net.minecraft.item.BlockItem;
import net.minecraft.item.Item;
import net.minecraft.util.Direction.Axis;
import net.minecraftforge.client.model.generators.ItemModelBuilder;
import net.minecraftforge.client.model.generators.ModelFile.ExistingModelFile;
import net.minecraftforge.client.model.generators.VariantBlockStateBuilder;
public class BlockStateGen {
/**
* Equivalent to BlockStateProvider#axisBlock without the need for a
* RotatedPillarBlock instance
*/
public static <T extends RotatedPillarKineticBlock> VariantBlockStateBuilder axisKineticBlock(
DataGenContext<Block, T> ctx, RegistrateBlockstateProvider prov, ExistingModelFile model) {
RotatedPillarKineticBlock block = ctx.getEntry();
return prov.getVariantBuilder(block).partialState().with(RotatedPillarBlock.AXIS, Axis.Y).modelForState()
.modelFile(model).addModel().partialState().with(RotatedPillarBlock.AXIS, Axis.Z).modelForState()
.modelFile(model).rotationX(90).addModel().partialState().with(RotatedPillarBlock.AXIS, Axis.X)
.modelForState().modelFile(model).rotationX(90).rotationY(90).addModel();
}
/**
* Custom block models packaged with other partials. Example:
* models/block/schematicannon/block.json
*/
public static ExistingModelFile partialBaseModel(@NonnullType DataGenContext<?, ?> ctx,
@NonnullType RegistrateBlockstateProvider prov) {
return prov.models().getExistingFile(prov.modLoc("block/" + ctx.getName() + "/block"));
}
/**
* Custom block model from models/block/x.json
*/
public static ExistingModelFile standardModel(@NonnullType DataGenContext<?, ?> ctx,
@NonnullType RegistrateBlockstateProvider prov) {
return prov.models().getExistingFile(prov.modLoc("block/" + ctx.getName()));
}
/**
* Generate item model inheriting from a seperate model in
* models/block/x/item.json
*/
public static ItemModelBuilder customItemModel(@NonnullType DataGenContext<Item, ? extends BlockItem> ctx,
@NonnullType RegistrateItemModelProvider prov) {
return prov.blockItem(ctx.getEntry()::getBlock, "/item");
}
}

View file

@ -1,7 +1,7 @@
package com.simibubi.create.modules.contraptions;
import static com.simibubi.create.AllBlocks.BELT;
import static com.simibubi.create.AllBlocks.LARGE_COGWHEEL;
import static com.simibubi.create.modules.contraptions.relays.elementary.CogWheelBlock.isLargeCog;
import static net.minecraft.state.properties.BlockStateProperties.AXIS;
import java.util.LinkedList;
@ -90,18 +90,18 @@ public class RotationPropagator {
}
// Gear <-> Large Gear
if (LARGE_COGWHEEL.typeOf(stateFrom) && definitionTo.hasIntegratedCogwheel(world, to.getPos(), stateTo))
if (isLargeToSmallGear(stateFrom, stateTo, definitionTo, diff))
if (isLargeCog(stateFrom) && definitionTo.hasIntegratedCogwheel(world, to.getPos(), stateTo))
if (isLargeToSmallCog(stateFrom, stateTo, definitionTo, diff))
return -2f;
if (LARGE_COGWHEEL.typeOf(stateTo) && definitionFrom.hasIntegratedCogwheel(world, from.getPos(), stateFrom))
if (isLargeToSmallGear(stateTo, stateFrom, definitionFrom, diff))
if (isLargeCog(stateTo) && definitionFrom.hasIntegratedCogwheel(world, from.getPos(), stateFrom))
if (isLargeToSmallCog(stateTo, stateFrom, definitionFrom, diff))
return -.5f;
// Gear <-> Gear
if (connectedByGears) {
if (diff.manhattanDistance(BlockPos.ZERO) != 1)
return 0;
if (LARGE_COGWHEEL.typeOf(stateTo))
if (isLargeCog(stateTo))
return 0;
if (direction.getAxis() == definitionFrom.getRotationAxis(stateFrom))
return 0;
@ -118,9 +118,9 @@ public class RotationPropagator {
final BlockPos diff = to.getPos().subtract(from.getPos());
// Rotation Speed Controller <-> Large Gear
if (isLargeGearToSpeedController(stateFrom, stateTo, diff))
if (isLargeCogToSpeedController(stateFrom, stateTo, diff))
return SpeedControllerTileEntity.getConveyedSpeed(from, to, true);
if (isLargeGearToSpeedController(stateTo, stateFrom, diff))
if (isLargeCogToSpeedController(stateTo, stateFrom, diff))
return SpeedControllerTileEntity.getConveyedSpeed(to, from, false);
float rotationSpeedModifier = getRotationSpeedModifier(from, to);
@ -128,7 +128,7 @@ public class RotationPropagator {
}
private static boolean isLargeToLargeGear(BlockState from, BlockState to, BlockPos diff) {
if (!LARGE_COGWHEEL.typeOf(from) || !LARGE_COGWHEEL.typeOf(to))
if (!isLargeCog(from) || !isLargeCog(to))
return false;
Axis fromAxis = from.get(AXIS);
Axis toAxis = to.get(AXIS);
@ -161,7 +161,7 @@ public class RotationPropagator {
return 1;
}
private static boolean isLargeToSmallGear(BlockState from, BlockState to, IRotate defTo, BlockPos diff) {
private static boolean isLargeToSmallCog(BlockState from, BlockState to, IRotate defTo, BlockPos diff) {
Axis axisFrom = from.get(AXIS);
if (axisFrom != defTo.getRotationAxis(to))
return false;
@ -176,8 +176,8 @@ public class RotationPropagator {
return true;
}
private static boolean isLargeGearToSpeedController(BlockState from, BlockState to, BlockPos diff) {
if (!LARGE_COGWHEEL.typeOf(from) || !AllBlocks.ROTATION_SPEED_CONTROLLER.typeOf(to))
private static boolean isLargeCogToSpeedController(BlockState from, BlockState to, BlockPos diff) {
if (!isLargeCog(from) || !AllBlocks.ROTATION_SPEED_CONTROLLER.typeOf(to))
return false;
if (!diff.equals(BlockPos.ZERO.up()) && !diff.equals(BlockPos.ZERO.down()))
return false;
@ -383,9 +383,9 @@ public class RotationPropagator {
final BlockState stateTo = to.getBlockState();
final BlockPos diff = to.getPos().subtract(from.getPos());
if (isLargeGearToSpeedController(stateFrom, stateTo, diff))
if (isLargeCogToSpeedController(stateFrom, stateTo, diff))
return true;
if (isLargeGearToSpeedController(stateTo, stateFrom, diff))
if (isLargeCogToSpeedController(stateTo, stateFrom, diff))
return true;
return getRotationSpeedModifier(from, to) != 0;
}
@ -413,7 +413,7 @@ public class RotationPropagator {
// Some Blocks can interface diagonally
BlockState blockState = te.getBlockState();
boolean isLargeWheel = LARGE_COGWHEEL.typeOf(blockState);
boolean isLargeWheel = isLargeCog(blockState);
if (!(blockState.getBlock() instanceof IRotate))
return neighbours;

View file

@ -2,7 +2,6 @@ package com.simibubi.create.modules.contraptions.base;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.vertex.IVertexBuilder;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.CreateClient;
import com.simibubi.create.foundation.block.SafeTileEntityRenderer;
import com.simibubi.create.foundation.utility.AnimationTickHolder;
@ -10,6 +9,7 @@ import com.simibubi.create.foundation.utility.ColorHelper;
import com.simibubi.create.foundation.utility.SuperByteBuffer;
import com.simibubi.create.foundation.utility.SuperByteBufferCache.Compartment;
import com.simibubi.create.modules.contraptions.KineticDebugger;
import com.simibubi.create.modules.contraptions.relays.elementary.CogWheelBlock;
import net.minecraft.block.BlockState;
import net.minecraft.client.renderer.IRenderTypeBuffer;
@ -83,7 +83,7 @@ public class KineticTileEntityRenderer extends SafeTileEntityRenderer<KineticTil
}
protected static float getRotationOffsetForPosition(KineticTileEntity te, final BlockPos pos, final Axis axis) {
float offset = AllBlocks.LARGE_COGWHEEL.typeOf(te.getBlockState()) ? 11.25f : 0;
float offset = CogWheelBlock.isLargeCog(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) {

View file

@ -1,6 +1,6 @@
package com.simibubi.create.modules.contraptions.components.contraptions.piston;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllBlocksNew;
import com.simibubi.create.modules.contraptions.base.IRotate;
import com.simibubi.create.modules.contraptions.base.KineticTileEntity;
import com.simibubi.create.modules.contraptions.base.KineticTileEntityRenderer;
@ -17,7 +17,7 @@ public class MechanicalPistonTileEntityRenderer extends KineticTileEntityRendere
@Override
protected BlockState getRenderedBlockState(KineticTileEntity te) {
return AllBlocks.SHAFT.get().getDefaultState().with(BlockStateProperties.AXIS,
return AllBlocksNew.getDefault(AllBlocksNew.SHAFT).with(BlockStateProperties.AXIS,
((IRotate) te.getBlockState().getBlock()).getRotationAxis(te.getBlockState()));
}

View file

@ -1,12 +1,12 @@
package com.simibubi.create.modules.contraptions.components.crank;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.foundation.block.ITE;
import com.simibubi.create.foundation.utility.AllShapes;
import com.simibubi.create.modules.contraptions.base.DirectionalKineticBlock;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.BlockItemUseContext;
import net.minecraft.tileentity.TileEntity;
@ -25,7 +25,7 @@ import net.minecraft.world.World;
public class HandCrankBlock extends DirectionalKineticBlock implements ITE<HandCrankTileEntity> {
public HandCrankBlock() {
super(Properties.from(AllBlocks.COGWHEEL.get()));
super(Properties.from(Blocks.OAK_PLANKS));
}
@Override

View file

@ -11,6 +11,7 @@ import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.vertex.IVertexBuilder;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllBlocksNew;
import com.simibubi.create.foundation.behaviour.filtering.FilteringRenderer;
import com.simibubi.create.foundation.block.SafeTileEntityRenderer;
import com.simibubi.create.foundation.utility.AngleHelper;
@ -138,7 +139,7 @@ public class DeployerTileEntityRenderer extends SafeTileEntityRenderer<DeployerT
BlockState state = te.getBlockState();
if (!AllBlocks.DEPLOYER.typeOf(state))
return Blocks.AIR.getDefaultState();
return AllBlocks.SHAFT.get().getDefaultState().with(AXIS, ((IRotate) state.getBlock()).getRotationAxis(state));
return AllBlocksNew.getDefault(AllBlocksNew.SHAFT).with(AXIS, ((IRotate) state.getBlock()).getRotationAxis(state));
}
private static SuperByteBuffer renderAndTransform(World world, AllBlockPartials renderBlock,

View file

@ -4,7 +4,7 @@ import static net.minecraft.state.properties.BlockStateProperties.HORIZONTAL_FAC
import com.mojang.blaze3d.matrix.MatrixStack;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllBlocksNew;
import com.simibubi.create.foundation.utility.SuperByteBuffer;
import com.simibubi.create.modules.contraptions.base.KineticTileEntity;
import com.simibubi.create.modules.contraptions.base.KineticTileEntityRenderer;
@ -39,7 +39,7 @@ public class MechanicalPressTileEntityRenderer extends KineticTileEntityRenderer
@Override
protected BlockState getRenderedBlockState(KineticTileEntity te) {
return AllBlocks.SHAFT.get().getDefaultState().with(BlockStateProperties.AXIS,
return AllBlocksNew.getDefault(AllBlocksNew.SHAFT).with(BlockStateProperties.AXIS,
te.getBlockState().get(HORIZONTAL_FACING).getAxis());
}

View file

@ -5,7 +5,7 @@ import static net.minecraft.state.properties.BlockStateProperties.FACING;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllBlocksNew;
import com.simibubi.create.CreateClient;
import com.simibubi.create.foundation.behaviour.filtering.FilteringRenderer;
import com.simibubi.create.foundation.block.SafeTileEntityRenderer;
@ -91,7 +91,7 @@ public class SawTileEntityRenderer extends SafeTileEntityRenderer<SawTileEntity>
protected BlockState getRenderedBlockState(KineticTileEntity te) {
BlockState state = te.getBlockState();
return AllBlocks.SHAFT.get().getDefaultState().with(AXIS, ((IRotate) state.getBlock()).getRotationAxis(state));
return AllBlocksNew.getDefault(AllBlocksNew.SHAFT).with(AXIS, ((IRotate) state.getBlock()).getRotationAxis(state));
}
}

View file

@ -1,6 +1,5 @@
package com.simibubi.create.modules.contraptions.relays.advanced;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.foundation.utility.AllShapes;
import com.simibubi.create.modules.contraptions.base.HorizontalAxisKineticBlock;
import com.simibubi.create.modules.contraptions.relays.elementary.CogWheelBlock;
@ -34,7 +33,7 @@ public class SpeedControllerBlock extends HorizontalAxisKineticBlock {
@Override
public BlockState getStateForPlacement(BlockItemUseContext context) {
BlockState above = context.getWorld().getBlockState(context.getPos().up());
if (AllBlocks.LARGE_COGWHEEL.typeOf(above) && above.get(CogWheelBlock.AXIS).isHorizontal())
if (CogWheelBlock.isLargeCog(above) && above.get(CogWheelBlock.AXIS).isHorizontal())
return getDefaultState().with(HORIZONTAL_AXIS, above.get(CogWheelBlock.AXIS) == Axis.X ? Axis.Z : Axis.X);
return super.getStateForPlacement(context);
}

View file

@ -1,7 +1,7 @@
package com.simibubi.create.modules.contraptions.relays.advanced;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllBlocksNew;
import com.simibubi.create.CreateClient;
import com.simibubi.create.foundation.behaviour.base.SmartTileEntityRenderer;
import com.simibubi.create.foundation.utility.SuperByteBuffer;
@ -30,7 +30,7 @@ public class SpeedControllerRenderer extends SmartTileEntityRenderer<SpeedContro
private SuperByteBuffer getRotatedModel(SpeedControllerTileEntity te) {
BlockState state = te.getBlockState();
return CreateClient.bufferCache.renderBlockIn(KineticTileEntityRenderer.KINETIC_TILE,
AllBlocks.SHAFT.getDefault().with(ShaftBlock.AXIS, state.get(SpeedControllerBlock.HORIZONTAL_AXIS)));
AllBlocksNew.getDefault(AllBlocksNew.SHAFT).with(ShaftBlock.AXIS, state.get(SpeedControllerBlock.HORIZONTAL_AXIS)));
}
}

View file

@ -7,6 +7,7 @@ import java.util.List;
import org.apache.commons.lang3.mutable.MutableInt;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllBlocksNew;
import com.simibubi.create.AllItems;
import com.simibubi.create.foundation.block.IHaveColorHandler;
import com.simibubi.create.foundation.block.ITE;
@ -60,8 +61,7 @@ import net.minecraftforge.common.Tags;
import net.minecraftforge.items.CapabilityItemHandler;
import net.minecraftforge.items.IItemHandler;
public class BeltBlock extends HorizontalKineticBlock
implements ITE<BeltTileEntity>, IHaveColorHandler {
public class BeltBlock extends HorizontalKineticBlock implements ITE<BeltTileEntity>, IHaveColorHandler {
public static final IProperty<Slope> SLOPE = EnumProperty.create("slope", Slope.class);
public static final IProperty<Part> PART = EnumProperty.create("part", Part.class);
@ -78,7 +78,8 @@ public class BeltBlock extends HorizontalKineticBlock
return false;
try {
return getTileEntity(world, pos).hasPulley();
} catch (TileEntityException e) {}
} catch (TileEntityException e) {
}
return false;
}
@ -106,7 +107,7 @@ public class BeltBlock extends HorizontalKineticBlock
drops.addAll(AllBlocks.BRASS_CASING.getDefault().getDrops(builder));
TileEntity tileEntity = builder.get(LootParameters.BLOCK_ENTITY);
if (tileEntity instanceof BeltTileEntity && ((BeltTileEntity) tileEntity).hasPulley())
drops.addAll(AllBlocks.SHAFT.getDefault().getDrops(builder));
drops.addAll(AllBlocksNew.getDefault(AllBlocksNew.SHAFT).getDrops(builder));
return drops;
}
@ -199,7 +200,7 @@ public class BeltBlock extends HorizontalKineticBlock
if (player.isSneaking() || !player.isAllowEdit())
return ActionResultType.PASS;
ItemStack heldItem = player.getHeldItem(handIn);
boolean isShaft = heldItem.getItem() == AllBlocks.SHAFT.get().asItem();
boolean isShaft = heldItem.getItem() == AllBlocksNew.SHAFT.get().asItem();
boolean isCasing = heldItem.getItem() == AllBlocks.BRASS_CASING.get().asItem();
boolean isDye = Tags.Items.DYES.contains(heldItem.getItem());
boolean isHand = heldItem.isEmpty() && handIn == Hand.MAIN_HAND;
@ -284,7 +285,7 @@ public class BeltBlock extends HorizontalKineticBlock
belt.attachKinetics();
}
if (!player.isCreative())
player.inventory.placeItemBackInInventory(world, new ItemStack(AllBlocks.SHAFT.get()));
player.inventory.placeItemBackInInventory(world, AllBlocksNew.asStack(AllBlocksNew.SHAFT));
return ActionResultType.SUCCESS;
}
@ -370,7 +371,8 @@ public class BeltBlock extends HorizontalKineticBlock
return BeltShapes.getCollisionShape(state);
}
} catch (TileEntityException e) {}
} catch (TileEntityException e) {
}
return shape;
}
@ -490,7 +492,7 @@ public class BeltBlock extends HorizontalKineticBlock
}
BlockState shaftState =
AllBlocks.SHAFT.get().getDefaultState().with(BlockStateProperties.AXIS, getRotationAxis(currentState));
AllBlocksNew.getDefault(AllBlocksNew.SHAFT).with(BlockStateProperties.AXIS, getRotationAxis(currentState));
world.setBlockState(currentPos, hasPulley ? shaftState : Blocks.AIR.getDefaultState(), 3);
world.playEvent(2001, currentPos, Block.getStateId(currentState));
}

View file

@ -4,9 +4,9 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Random;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllItems;
import com.simibubi.create.config.AllConfigs;
import com.simibubi.create.modules.contraptions.relays.elementary.ShaftBlock;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.PlayerEntity;
@ -68,7 +68,7 @@ public class BeltConnectorHandler {
if (world.getBlockState(selected).getMaterial().isReplaceable())
return;
if (!AllBlocks.SHAFT.typeOf(world.getBlockState(selected)))
if (!ShaftBlock.isShaft(world.getBlockState(selected)))
selected = selected.offset(((BlockRayTraceResult) rayTrace).getFace());
if (!selected.withinDistance(first, AllConfigs.SERVER.kinetics.maxBeltLength.get()))
return;

View file

@ -106,7 +106,7 @@ public class BeltConnectorItem extends BlockItem implements IAddedByOther {
for (BlockPos pos : beltsToCreate) {
BeltBlock.Part part = pos.equals(start) ? Part.START : pos.equals(end) ? Part.END : Part.MIDDLE;
boolean pulley = AllBlocks.SHAFT.typeOf(world.getBlockState(pos));
boolean pulley = ShaftBlock.isShaft(world.getBlockState(pos));
if (part == Part.MIDDLE && pulley)
part = Part.PULLEY;
world.setBlockState(pos, beltBlock.with(BeltBlock.SLOPE, slope).with(BeltBlock.PART, part)
@ -204,7 +204,7 @@ public class BeltConnectorItem extends BlockItem implements IAddedByOther {
for (BlockPos currentPos = first.add(step); !currentPos.equals(second) && limit-- > 0; currentPos =
currentPos.add(step)) {
BlockState blockState = world.getBlockState(currentPos);
if (AllBlocks.SHAFT.typeOf(blockState) && blockState.get(ShaftBlock.AXIS) == axis)
if (ShaftBlock.isShaft(blockState) && blockState.get(ShaftBlock.AXIS) == axis)
continue;
if (!blockState.getMaterial().isReplaceable())
return false;
@ -217,7 +217,7 @@ public class BeltConnectorItem extends BlockItem implements IAddedByOther {
public static boolean validateAxis(World world, BlockPos pos) {
if (!world.isAreaLoaded(pos, 1))
return false;
if (!AllBlocks.SHAFT.typeOf(world.getBlockState(pos)))
if (!ShaftBlock.isShaft(world.getBlockState(pos)))
return false;
if (world.getBlockState(pos).get(BlockStateProperties.AXIS) == Axis.Y)
return false;

View file

@ -1,13 +1,13 @@
package com.simibubi.create.modules.contraptions.relays.elementary;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllBlocksNew;
import com.simibubi.create.foundation.utility.AllShapes;
import com.simibubi.create.modules.contraptions.base.IRotate;
import com.simibubi.create.modules.contraptions.relays.advanced.SpeedControllerBlock;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.item.BlockItemUseContext;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack;
@ -23,10 +23,18 @@ import net.minecraft.world.World;
public class CogWheelBlock extends ShaftBlock {
private boolean isLarge;
boolean isLarge;
public CogWheelBlock(boolean large) {
super(Properties.from(Blocks.GRANITE));
public static CogWheelBlock small(Properties properties) {
return new CogWheelBlock(false, properties);
}
public static CogWheelBlock large(Properties properties) {
return new CogWheelBlock(true, properties);
}
private CogWheelBlock(boolean large, Properties properties) {
super(properties);
isLarge = large;
}
@ -42,7 +50,7 @@ public class CogWheelBlock extends ShaftBlock {
continue;
BlockState blockState = worldIn.getBlockState(pos.offset(facing));
if (AllBlocks.LARGE_COGWHEEL.typeOf(blockState) || isLarge && AllBlocks.COGWHEEL.typeOf(blockState))
if (isLargeCog(blockState) || isLarge && isSmallCog(blockState))
return false;
}
return true;
@ -82,6 +90,14 @@ public class CogWheelBlock extends ShaftBlock {
return isLarge ? 1f : .75f;
}
public static boolean isSmallCog(BlockState state) {
return AllBlocksNew.equals(AllBlocksNew.COGWHEEL, state);
}
public static boolean isLargeCog(BlockState state) {
return AllBlocksNew.equals(AllBlocksNew.LARGE_COGWHEEL, state);
}
public void fillItemGroup(ItemGroup group, NonNullList<ItemStack> items) {
items.add(new ItemStack(this));
}

View file

@ -1,9 +1,7 @@
package com.simibubi.create.modules.contraptions.relays.elementary;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.foundation.utility.VecHelper;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.item.BlockItem;
import net.minecraft.item.BlockItemUseContext;
@ -18,9 +16,9 @@ public class CogwheelBlockItem extends BlockItem {
boolean large;
public CogwheelBlockItem(Block block, Properties builder, boolean isLarge) {
public CogwheelBlockItem(CogWheelBlock block, Properties builder) {
super(block, builder);
large = isLarge;
large = block.isLarge;
}
@Override
@ -34,7 +32,7 @@ public class CogwheelBlockItem extends BlockItem {
if (face.getAxis() == placedOnState.get(CogWheelBlock.AXIS))
return super.tryPlace(context);
boolean placedOnLarge = AllBlocks.LARGE_COGWHEEL.typeOf(placedOnState);
boolean placedOnLarge = CogWheelBlock.isLargeCog(placedOnState);
if (placedOnLarge || large) {
boolean largeOnLarge = placedOnLarge && large;

View file

@ -1,5 +1,6 @@
package com.simibubi.create.modules.contraptions.relays.elementary;
import com.simibubi.create.AllBlocksNew;
import com.simibubi.create.AllItems;
import com.simibubi.create.foundation.utility.AllShapes;
import com.simibubi.create.modules.contraptions.base.RotatedPillarKineticBlock;
@ -66,6 +67,10 @@ public class ShaftBlock extends RotatedPillarKineticBlock {
AllItems.BELT_CONNECTOR.get().fillItemGroup(group, items);
}
public static boolean isShaft(BlockState state) {
return AllBlocksNew.equals(AllBlocksNew.SHAFT, state);
}
// IRotate:
@Override

View file

@ -3,7 +3,6 @@ package com.simibubi.create.modules.contraptions.relays.encased;
import com.simibubi.create.modules.contraptions.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;
@ -15,8 +14,8 @@ import net.minecraft.world.IWorldReader;
public class EncasedShaftBlock extends RotatedPillarKineticBlock {
public EncasedShaftBlock() {
super(Properties.from(Blocks.ANDESITE));
public EncasedShaftBlock(Properties properties) {
super(properties);
}
@Override

View file

@ -1,6 +1,6 @@
package com.simibubi.create.modules.contraptions.relays.encased;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllBlocksNew;
import com.simibubi.create.modules.contraptions.base.KineticTileEntity;
import com.simibubi.create.modules.contraptions.base.KineticTileEntityRenderer;
@ -16,7 +16,7 @@ public class EncasedShaftTileEntityRenderer extends KineticTileEntityRenderer {
@Override
protected BlockState getRenderedBlockState(KineticTileEntity te) {
return AllBlocks.SHAFT.get().getDefaultState().with(BlockStateProperties.AXIS,
return AllBlocksNew.getDefault(AllBlocksNew.SHAFT).with(BlockStateProperties.AXIS,
te.getBlockState().get(BlockStateProperties.AXIS));
}

View file

@ -9,6 +9,7 @@ import com.simibubi.create.modules.contraptions.relays.gearbox.GearshiftTileEnti
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.item.BlockItemUseContext;
import net.minecraft.state.BooleanProperty;
import net.minecraft.state.StateContainer.Builder;
@ -27,7 +28,7 @@ public class GearshiftBlock extends EncasedShaftBlock implements ITE<GearshiftTi
public static final BooleanProperty POWERED = BlockStateProperties.POWERED;
public GearshiftBlock() {
super();
super(Properties.from(Blocks.ANDESITE));
setDefaultState(getDefaultState().with(POWERED, false));
}

View file

@ -3,7 +3,7 @@ package com.simibubi.create.modules.contraptions.relays.gauge;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.vertex.IVertexBuilder;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllBlocksNew;
import com.simibubi.create.foundation.utility.SuperByteBuffer;
import com.simibubi.create.modules.contraptions.base.IRotate;
import com.simibubi.create.modules.contraptions.base.KineticTileEntity;
@ -60,7 +60,7 @@ public class GaugeTileEntityRenderer extends KineticTileEntityRenderer {
@Override
protected BlockState getRenderedBlockState(KineticTileEntity te) {
return AllBlocks.SHAFT.get().getDefaultState().with(BlockStateProperties.AXIS,
return AllBlocksNew.getDefault(AllBlocksNew.SHAFT).with(BlockStateProperties.AXIS,
((IRotate) te.getBlockState().getBlock()).getRotationAxis(te.getBlockState()));
}

View file

@ -1,7 +0,0 @@
{
"variants": {
"axis=x" : { "model": "create:block/cogwheel", "x": 90, "y": 90 },
"axis=y" : { "model": "create:block/cogwheel" },
"axis=z" : { "model": "create:block/cogwheel", "x": 90 }
}
}

View file

@ -1,13 +0,0 @@
{
"forge_marker": 1,
"defaults": {
"model": "create:block/encased_shaft"
},
"variants": {
"axis" : {
"x": { "y": 90 },
"y": { "x": 90 },
"z": { }
}
}
}

View file

@ -1,7 +0,0 @@
{
"variants": {
"axis=x" : { "model": "create:block/large_cogwheel", "x": 90, "y": 90 },
"axis=y" : { "model": "create:block/large_cogwheel" },
"axis=z" : { "model": "create:block/large_cogwheel", "x": 90 }
}
}

View file

@ -1,7 +0,0 @@
{
"variants": {
"axis=x" : { "model": "create:block/shaft", "x": 90, "y": 90 },
"axis=y" : { "model": "create:block/shaft" },
"axis=z" : { "model": "create:block/shaft", "x": 90 }
}
}

View file

@ -1,68 +0,0 @@
{
"__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)",
"parent": "block/block",
"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 ] }
}
}
]
}

View file

@ -0,0 +1,68 @@
{
"credit": "Made with Blockbench",
"parent": "block/block",
"textures": {
"0": "create:block/andesite_casing",
"1": "create:block/gearbox",
"particle": "create:block/andesite_casing"
},
"elements": [
{
"name": "Bottom",
"from": [0, 0, 0],
"to": [16, 16, 2],
"faces": {
"north": {"uv": [0, 0, 16, 16], "rotation": 90, "texture": "#0"},
"east": {"uv": [0, 14, 16, 16], "rotation": 270, "texture": "#0"},
"south": {"uv": [0, 0, 16, 16], "texture": "#0"},
"west": {"uv": [0, 14, 16, 16], "rotation": 90, "texture": "#0"},
"up": {"uv": [0, 14, 16, 16], "rotation": 180, "texture": "#0"},
"down": {"uv": [0, 14, 16, 16], "texture": "#0"}
}
},
{
"name": "Core",
"from": [1, 1, 2],
"to": [15, 15, 14],
"faces": {
"up": {"uv": [1, 2, 15, 14], "rotation": 180, "texture": "#1"},
"down": {"uv": [1, 2, 15, 14], "texture": "#1"}
}
},
{
"name": "Top",
"from": [0, 0, 14],
"to": [16, 16, 16],
"faces": {
"north": {"uv": [0, 0, 16, 16], "rotation": 180, "texture": "#0"},
"east": {"uv": [0, 0, 16, 2], "rotation": 270, "texture": "#0"},
"south": {"uv": [0, 0, 16, 16], "rotation": 90, "texture": "#0"},
"west": {"uv": [0, 0, 16, 2], "rotation": 90, "texture": "#0"},
"up": {"uv": [0, 0, 16, 2], "rotation": 180, "texture": "#0"},
"down": {"uv": [0, 0, 16, 2], "texture": "#0"}
}
},
{
"name": "SideWest",
"from": [0, 0, 2],
"to": [2, 16, 14],
"faces": {
"east": {"uv": [0, 2, 16, 14], "rotation": 270, "texture": "#0"},
"west": {"uv": [0, 2, 16, 14], "rotation": 90, "texture": "#0"},
"up": {"uv": [14, 2, 16, 14], "rotation": 180, "texture": "#0"},
"down": {"uv": [0, 2, 2, 14], "texture": "#0"}
}
},
{
"name": "SideEast",
"from": [14, 0, 2],
"to": [16, 16, 14],
"faces": {
"east": {"uv": [0, 2, 16, 14], "rotation": 270, "texture": "#0"},
"west": {"uv": [0, 2, 16, 14], "rotation": 90, "texture": "#0"},
"up": {"uv": [0, 2, 2, 14], "rotation": 180, "texture": "#0"},
"down": {"uv": [14, 2, 16, 14], "texture": "#0"}
}
}
]
}

View file

@ -2,7 +2,7 @@
"credit": "Made with Blockbench",
"parent": "block/block",
"textures": {
"0": "create:block/gearbox_top",
"0": "create:block/andesite_casing",
"1": "create:block/gearbox",
"particle": "create:block/axis",
"1_0": "create:block/axis",
@ -19,7 +19,7 @@
"south": {"uv": [0, 14, 16, 16], "texture": "#0"},
"west": {"uv": [0, 14, 16, 16], "texture": "#0"},
"up": {"uv": [0, 0, 16, 16], "texture": "#0"},
"down": {"uv": [0, 0, 16, 16], "texture": "#0"}
"down": {"uv": [0, 0, 16, 16], "rotation": 90, "texture": "#0"}
}
},
{
@ -40,7 +40,7 @@
"east": {"uv": [0, 0, 16, 2], "texture": "#0"},
"south": {"uv": [0, 0, 16, 2], "texture": "#0"},
"west": {"uv": [0, 0, 16, 2], "texture": "#0"},
"up": {"uv": [0, 0, 16, 16], "texture": "#0"},
"up": {"uv": [0, 0, 16, 16], "rotation": 90, "texture": "#0"},
"down": {"uv": [0, 0, 16, 16], "texture": "#0"}
}
},

View file

@ -1,10 +0,0 @@
{
"parent": "create:block/cogwheel",
"display": {
"fixed": {
"rotation": [ 90, 0, 0 ],
"translation": [ 0, 0, 0],
"scale":[ 0.5, 0.5, 0.5 ]
}
}
}

View file

@ -1,10 +0,0 @@
{
"parent": "create:block/large_cogwheel",
"display": {
"fixed": {
"rotation": [ 90, 0, 0 ],
"translation": [ 0, 0, 0],
"scale":[ 0.5, 0.5, 0.5 ]
}
}
}

View file

@ -1,3 +0,0 @@
{
"parent": "create:block/shaft"
}