use of com.simibubi.create.content.logistics.block.belts.tunnel.BeltTunnelItem in project Create by Creators-of-Create.
the class BuilderTransformers method beltTunnel.
public static <B extends BeltTunnelBlock> NonNullUnaryOperator<BlockBuilder<B, CreateRegistrate>> beltTunnel(String type, ResourceLocation particleTexture) {
return b -> b.initialProperties(SharedProperties::stone).addLayer(() -> RenderType::cutoutMipped).properties(BlockBehaviour.Properties::noOcclusion).transform(pickaxeOnly()).blockstate((c, p) -> p.getVariantBuilder(c.get()).forAllStates(state -> {
String id = "block/" + type + "_tunnel";
Shape shape = state.getValue(BeltTunnelBlock.SHAPE);
if (shape == BeltTunnelBlock.Shape.CLOSED)
shape = BeltTunnelBlock.Shape.STRAIGHT;
String shapeName = shape.getSerializedName();
return ConfiguredModel.builder().modelFile(p.models().withExistingParent(id + "/" + shapeName, p.modLoc("block/belt_tunnel/" + shapeName)).texture("1", p.modLoc(id + "_top")).texture("2", p.modLoc(id)).texture("3", p.modLoc(id + "_top_window")).texture("particle", particleTexture)).rotationY(state.getValue(BeltTunnelBlock.HORIZONTAL_AXIS) == Axis.X ? 0 : 90).build();
})).item(BeltTunnelItem::new).model((c, p) -> {
String id = type + "_tunnel";
p.withExistingParent("item/" + id, p.modLoc("block/belt_tunnel/item")).texture("1", p.modLoc("block/" + id + "_top")).texture("2", p.modLoc("block/" + id)).texture("particle", particleTexture);
}).build();
}
Aggregations