env distributor models and textures

This commit is contained in:
Robin 2024-06-28 21:06:09 +02:00
parent 370724bb37
commit 27fe1af0be
7 changed files with 264 additions and 4 deletions

View File

@ -0,0 +1,3 @@
{
"parent": "environmenttech:block/env_distributor"
}

View File

@ -68,8 +68,6 @@ public class EnvCollectorRecipeCategory implements IRecipeCategory<RecipeHolder<
@Override
public void setRecipe(IRecipeLayoutBuilder builder, RecipeHolder<EnvCollectorRecipe> recipeHolder, IFocusGroup focuses) {
//54, 34))
// 116, 35
EnvCollectorRecipe recipe = recipeHolder.value();
builder.addSlot(RecipeIngredientRole.INPUT, 6, 16).addIngredients(recipe.input());

View File

@ -29,7 +29,7 @@ public class ETItemModelProvider extends ItemModelProvider {
@Override
protected void registerModels() {
withExistingParent(ETBlocks.ENV_COLLECTOR_BLOCK.getId().getPath(), modLoc("block/" + "env_collector"));
// withExistingParent(ETBlocks.ENV_DISTRIBUTOR_BLOCK.getId().getPath(), modLoc("block/" + "env_distributor"));
withExistingParent(ETBlocks.ENV_DISTRIBUTOR_BLOCK.getId().getPath(), modLoc("block/" + "env_distributor"));
basicItem(ETItems.ENVIRONMENTAL_ESSENCE_ITEM.get());
basicItem(ETItems.GLASS_TANK.get());
registerEnvDetector();

View File

@ -10,6 +10,11 @@ import lombok.extern.slf4j.Slf4j;
import javax.annotation.ParametersAreNonnullByDefault;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.phys.shapes.BooleanOp;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.Shapes;
import net.minecraft.world.phys.shapes.VoxelShape;
import org.jetbrains.annotations.Nullable;
import net.minecraft.MethodsReturnNonnullByDefault;
@ -28,6 +33,31 @@ import robaertschi.environmenttech.level.block.entity.EnvDistributorBlockEntity;
@MethodsReturnNonnullByDefault
public class EnvDistributorBlock extends SimpleBlockWithEntity<EnvDistributorBlockEntity> {
public static final MapCodec<EnvDistributorBlock> CODEC = simpleCodec(EnvDistributorBlock::new);
public static final VoxelShape SHAPE = makeShape();
public static VoxelShape makeShape(){
VoxelShape shape = Shapes.empty();
shape = Shapes.join(shape, Shapes.box(0, 0, 0, 1, 0.0625, 1), BooleanOp.OR);
shape = Shapes.join(shape, Shapes.box(0.0625, 0.0625, 0.0625, 0.0625, 0.375, 0.9375), BooleanOp.OR);
shape = Shapes.join(shape, Shapes.box(0.9375, 0.0625, 0.0625, 0.9375, 0.375, 0.9375), BooleanOp.OR);
shape = Shapes.join(shape, Shapes.box(0.0625, 0.0625, 0.9375, 0.9375, 0.375, 0.9375), BooleanOp.OR);
shape = Shapes.join(shape, Shapes.box(0.0625, 0.0625, 0.0625, 0.9375, 0.375, 0.0625), BooleanOp.OR);
shape = Shapes.join(shape, Shapes.box(0, 0.4375, 0, 1, 0.625, 1), BooleanOp.OR);
shape = Shapes.join(shape, Shapes.box(0.1875, 0.625, 0.1875, 0.25, 1, 0.8125), BooleanOp.OR);
shape = Shapes.join(shape, Shapes.box(0.75, 0.625, 0.1875, 0.8125, 1, 0.8125), BooleanOp.OR);
shape = Shapes.join(shape, Shapes.box(0.25, 0.625, 0.25, 0.75, 0.75, 0.75), BooleanOp.OR);
shape = Shapes.join(shape, Shapes.box(0, 0.375, 0, 1, 0.4375, 1), BooleanOp.OR);
shape = Shapes.join(shape, Shapes.box(0.25, 0.625, 0.75, 0.75, 1, 0.8125), BooleanOp.OR);
shape = Shapes.join(shape, Shapes.box(0.25, 0.625, 0.1875, 0.75, 1, 0.25), BooleanOp.OR);
return shape;
}
@Override
protected VoxelShape getShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) {
return SHAPE;
}
public EnvDistributorBlock(Properties pProperties) {
super(pProperties, ETBlockEntities.ENV_DISTRIBUTOR_BLOCK_ENTITY);
@ -43,5 +73,4 @@ public class EnvDistributorBlock extends SimpleBlockWithEntity<EnvDistributorBlo
public BlockEntity newBlockEntity(BlockPos pPos, BlockState pState) {
return new EnvDistributorBlockEntity(pPos, pState);
}
}

View File

@ -34,6 +34,7 @@ public class ETItems {
// public static final DeferredItem<BlockItem> EXAMPLE_BLOCK_ITEM = ITEMS.registerSimpleBlockItem("example_block", EXAMPLE_BLOCK);
public static final DeferredItem<BlockItem> ENV_COLLECTOR_BLOCK_ITEM = ITEMS.registerSimpleBlockItem("env_collector", ETBlocks.ENV_COLLECTOR_BLOCK);
public static final DeferredItem<BlockItem> ENV_DISTRIBUTOR_ITEM = ITEMS.registerSimpleBlockItem("env_distributor", ETBlocks.ENV_DISTRIBUTOR_BLOCK);
public static final DeferredItem<EnvDetectorItem> ENV_DETECTOR_ITEM = ITEMS.registerItem("env_detector",
EnvDetectorItem::new,
@ -54,6 +55,7 @@ public class ETItems {
.icon(() -> ENV_COLLECTOR_BLOCK_ITEM.get().getDefaultInstance())
.displayItems((parameters, output) -> {
output.accept(ENV_COLLECTOR_BLOCK_ITEM.get());
output.accept(ENV_DISTRIBUTOR_ITEM);
output.accept(ENV_DETECTOR_ITEM.get());
// output.accept(EXAMPLE_BLOCK_ITEM.get());
output.accept(ENVIRONMENTAL_ESSENCE_ITEM.get());

View File

@ -0,0 +1,228 @@
{
"credit": "Made with Blockbench",
"texture_size": [128, 128],
"render_type": "cutout",
"textures": {
"0": "environmenttech:block/env_distributor",
"particle": "#0"
},
"elements": [
{
"name": "base",
"from": [0, 0, 0],
"to": [16, 1, 16],
"faces": {
"north": {"uv": [2, 6.75, 4, 6.875], "texture": "#0", "cullface": "north"},
"east": {"uv": [0, 6.75, 2, 6.875], "texture": "#0", "cullface": "east"},
"south": {"uv": [6, 6.75, 8, 6.875], "texture": "#0", "cullface": "south"},
"west": {"uv": [4, 6.75, 6, 6.875], "texture": "#0", "cullface": "west"},
"up": {"uv": [4, 6.75, 2, 4.75], "texture": "#0"},
"down": {"uv": [6, 4.75, 4, 6.75], "texture": "#0", "cullface": "down"}
}
},
{
"name": "base",
"from": [0, 6, 0],
"to": [16, 7, 16],
"rotation": {"angle": 0, "axis": "y", "origin": [0, 6, 0]},
"faces": {
"north": {"uv": [2, 4.5, 4, 4.625], "texture": "#0", "cullface": "north"},
"east": {"uv": [0, 4.5, 2, 4.625], "texture": "#0", "cullface": "east"},
"south": {"uv": [6, 4.5, 8, 4.625], "texture": "#0", "cullface": "south"},
"west": {"uv": [4, 4.5, 6, 4.625], "texture": "#0", "cullface": "west"},
"up": {"uv": [4, 4.5, 2, 2.5], "texture": "#0"},
"down": {"uv": [6, 2.5, 4, 4.5], "texture": "#0", "cullface": "down"}
}
},
{
"name": "glass_east",
"from": [1, 1, 1],
"to": [1, 6, 15],
"rotation": {"angle": 0, "axis": "y", "origin": [-1, 1, 1]},
"faces": {
"north": {"uv": [8.125, 5, 8.125, 5.625], "texture": "#0"},
"east": {"uv": [6.375, 5, 8.125, 5.625], "texture": "#0"},
"south": {"uv": [9.875, 5, 9.875, 5.625], "texture": "#0"},
"west": {"uv": [8.125, 5, 9.875, 5.625], "texture": "#0"},
"up": {"uv": [8.125, 5, 8.125, 3.25], "texture": "#0"},
"down": {"uv": [8.125, 3.25, 8.125, 5], "texture": "#0"}
}
},
{
"name": "glass_west",
"from": [15, 1, 1],
"to": [15, 6, 15],
"rotation": {"angle": 0, "axis": "y", "origin": [13, 1, 1]},
"faces": {
"north": {"uv": [8.125, 2.5, 8.125, 3.125], "texture": "#0"},
"east": {"uv": [6.375, 2.5, 8.125, 3.125], "texture": "#0"},
"south": {"uv": [9.875, 2.5, 9.875, 3.125], "texture": "#0"},
"west": {"uv": [8.125, 2.5, 9.875, 3.125], "texture": "#0"},
"up": {"uv": [8.125, 2.5, 8.125, 0.75], "texture": "#0"},
"down": {"uv": [8.125, 0.75, 8.125, 2.5], "texture": "#0"}
}
},
{
"name": "glass_south",
"from": [1, 1, 15],
"to": [15, 6, 15],
"rotation": {"angle": 0, "axis": "y", "origin": [2, 1, 14]},
"faces": {
"north": {"uv": [7, 7.875, 8.75, 8.5], "texture": "#0"},
"east": {"uv": [7, 7.875, 7, 8.5], "texture": "#0"},
"south": {"uv": [8.75, 7.875, 10.5, 8.5], "texture": "#0"},
"west": {"uv": [8.75, 7.875, 8.75, 8.5], "texture": "#0"},
"up": {"uv": [8.75, 7.875, 7, 7.875], "texture": "#0"},
"down": {"uv": [10.5, 7.875, 8.75, 7.875], "texture": "#0"}
}
},
{
"name": "glass_north",
"from": [1, 1, 1],
"to": [15, 6, 1],
"rotation": {"angle": 0, "axis": "y", "origin": [2, 1, 0]},
"faces": {
"north": {"uv": [6.125, 0, 7.875, 0.625], "texture": "#0"},
"east": {"uv": [6.125, 0, 6.125, 0.625], "texture": "#0"},
"south": {"uv": [7.875, 0, 9.625, 0.625], "texture": "#0"},
"west": {"uv": [7.875, 0, 7.875, 0.625], "texture": "#0"},
"up": {"uv": [7.875, 0, 6.125, 0], "texture": "#0"},
"down": {"uv": [9.625, 0, 7.875, 0], "texture": "#0"}
}
},
{
"name": "base",
"from": [0, 7, 0],
"to": [16, 10, 16],
"rotation": {"angle": 0, "axis": "y", "origin": [0, 7, 0]},
"faces": {
"north": {"uv": [2, 2, 4, 2.375], "texture": "#0"},
"east": {"uv": [0, 2, 2, 2.375], "texture": "#0"},
"south": {"uv": [6, 2, 8, 2.375], "texture": "#0"},
"west": {"uv": [4, 2, 6, 2.375], "texture": "#0"},
"up": {"uv": [4, 2, 2, 0], "texture": "#0"},
"down": {"uv": [6, 0, 4, 2], "texture": "#0"}
}
},
{
"name": "east",
"from": [3, 10, 3],
"to": [4, 16, 13],
"rotation": {"angle": 0, "axis": "y", "origin": [0, 10, 0]},
"faces": {
"north": {"uv": [5.375, 8.25, 5.5, 9], "texture": "#0"},
"east": {"uv": [4.125, 8.25, 5.375, 9], "texture": "#0"},
"south": {"uv": [6.75, 8.25, 6.875, 9], "texture": "#0"},
"west": {"uv": [5.5, 8.25, 6.75, 9], "texture": "#0"},
"up": {"uv": [5.5, 8.25, 5.375, 7], "texture": "#0"},
"down": {"uv": [5.625, 7, 5.5, 8.25], "texture": "#0"}
}
},
{
"name": "west",
"from": [12, 10, 3],
"to": [13, 16, 13],
"rotation": {"angle": 0, "axis": "y", "origin": [9, 10, 0]},
"faces": {
"north": {"uv": [8.125, 7, 8.25, 7.75], "texture": "#0"},
"east": {"uv": [6.875, 7, 8.125, 7.75], "texture": "#0"},
"south": {"uv": [9.5, 7, 9.625, 7.75], "texture": "#0"},
"west": {"uv": [8.25, 7, 9.5, 7.75], "texture": "#0"},
"up": {"uv": [8.25, 7, 8.125, 5.75], "texture": "#0"},
"down": {"uv": [8.375, 5.75, 8.25, 7], "texture": "#0"}
}
},
{
"name": "spout_base",
"from": [4, 10, 4],
"to": [12, 12, 12],
"rotation": {"angle": 0, "axis": "y", "origin": [7.5, 13, 8.5]},
"faces": {
"north": {"uv": [1, 8, 2, 8.25], "texture": "#0"},
"east": {"uv": [0, 8, 1, 8.25], "texture": "#0"},
"south": {"uv": [3, 8, 4, 8.25], "texture": "#0"},
"west": {"uv": [2, 8, 3, 8.25], "texture": "#0"},
"up": {"uv": [2, 8, 1, 7], "rotation": 90, "texture": "#0"},
"down": {"uv": [3, 7, 2, 8], "rotation": 270, "texture": "#0"}
}
},
{
"from": [4, 10, 12],
"to": [12, 16, 13],
"rotation": {"angle": 0, "axis": "y", "origin": [4, 10, 12]},
"faces": {
"north": {"uv": [10.75, 3.375, 11.75, 4.125], "texture": "#0"},
"east": {"uv": [10.625, 3.375, 10.75, 4.125], "texture": "#0"},
"south": {"uv": [11.875, 3.375, 12.875, 4.125], "texture": "#0"},
"west": {"uv": [11.75, 3.375, 11.875, 4.125], "texture": "#0"},
"up": {"uv": [11.75, 3.375, 10.75, 3.25], "texture": "#0"},
"down": {"uv": [12.75, 3.25, 11.75, 3.375], "texture": "#0"}
}
},
{
"from": [4, 10, 3],
"to": [12, 16, 4],
"rotation": {"angle": 0, "axis": "y", "origin": [4, 10, 3]},
"faces": {
"north": {"uv": [10.75, 0.875, 11.75, 1.625], "texture": "#0"},
"east": {"uv": [10.625, 0.875, 10.75, 1.625], "texture": "#0"},
"south": {"uv": [11.875, 0.875, 12.875, 1.625], "texture": "#0"},
"west": {"uv": [11.75, 0.875, 11.875, 1.625], "texture": "#0"},
"up": {"uv": [11.75, 0.875, 10.75, 0.75], "texture": "#0"},
"down": {"uv": [12.75, 0.75, 11.75, 0.875], "texture": "#0"}
}
}
],
"display": {
"thirdperson_righthand": {
"rotation": [75, 45, 0],
"translation": [0, 2.5, 0],
"scale": [0.375, 0.375, 0.375]
},
"thirdperson_lefthand": {
"rotation": [75, 45, 0],
"translation": [0, 2.5, 0],
"scale": [0.375, 0.375, 0.375]
},
"firstperson_righthand": {
"rotation": [0, 45, 0],
"scale": [0.4, 0.4, 0.4]
},
"firstperson_lefthand": {
"rotation": [0, 225, 0],
"scale": [0.4, 0.4, 0.4]
},
"ground": {
"translation": [0, 3, 0],
"scale": [0.25, 0.25, 0.25]
},
"gui": {
"rotation": [30, 225, 0],
"scale": [0.625, 0.625, 0.625]
},
"fixed": {
"scale": [0.5, 0.5, 0.5]
}
},
"groups": [
{
"name": "main",
"origin": [0, 0, 0],
"color": 0,
"children": [
{
"name": "tank",
"origin": [0, 0, 0],
"color": 0,
"children": [0, 1, 2, 3, 4, 5]
},
{
"name": "spiller",
"origin": [0, 0, 0],
"color": 0,
"children": [6, 7, 8, 9, 10, 11]
}
]
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB