Update LibZontreck, add CreeperHeal, add Partially implemented block

This commit is contained in:
zontreck 2024-04-30 04:17:29 -07:00
parent 1ada902c26
commit 1bdcb0c2fc
14 changed files with 142 additions and 265 deletions

View file

@ -3,7 +3,7 @@
org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false
libzontreck=1201.13.042524.0527
libzontreck=1201.13.043024.0404
## Environment Properties
@ -48,7 +48,7 @@ mod_name=Aria's Essentials
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
mod_license=GPLv3
# The mod version. See https://semver.org/
mod_version=1201.2.042524.0537
mod_version=1201.2.043024.0417
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
# This should match the base package used for the mod sources.
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html

View file

@ -1,4 +1,4 @@
// 1.20.1 2024-04-23T21:56:19.854483943 Block States: ariasessentials
// 1.20.1 2024-04-26T11:35:05.580755664 Block States: ariasessentials
ae2f6cd918bd461be7fb693641eaa5b78410b538 assets/ariasessentials/blockstates/clinker_brick_block.json
f48474f63edb825feaa3cc2c990ecd5ed6909c74 assets/ariasessentials/blockstates/clinker_brick_slab.json
5b501afd2a40c586b6811b9784ca2cd1a2dba373 assets/ariasessentials/blockstates/clinker_brick_stained_block.json
@ -34,7 +34,7 @@ acdba80ab9bebc435f3cfdc80f845fa942eaf1d4 assets/ariasessentials/blockstates/stee
b2076aa8074c942d074509a3ee27df350f81ab0f assets/ariasessentials/blockstates/steel_floor_grating_top.json
a637df1cfe9b47f5691beb585ad9e7f72a8a641b assets/ariasessentials/blockstates/steel_railing.json
7c667fb64bd412a080e1d92d9b7e194ef1a7cb25 assets/ariasessentials/blockstates/steel_table.json
1bef53c224409e06091b0f9da5407589e173845b assets/ariasessentials/blockstates/tflipflop.json
ea6637a7465981525768e7ba089113c0297278f9 assets/ariasessentials/blockstates/tflipflop.json
e03106a0ee60bc58f97f5cc3b1ad921f245c99dd assets/ariasessentials/models/block/clinker_brick_block_model0.json
d777dea2873725f45fadd678d411040f530f8f58 assets/ariasessentials/models/block/clinker_brick_block_model1.json
c480c6d87ce48bdf5d6fbb846a9c435a5c263c06 assets/ariasessentials/models/block/clinker_brick_block_model2.json

View file

@ -1,62 +1,62 @@
{
"variants": {
"facing=east,input_power=false,powered=false": {
"facing=east,inputpower=false,powered=false": {
"model": "ariasessentials:block/tflipflop",
"y": 90
},
"facing=east,input_power=false,powered=true": {
"facing=east,inputpower=false,powered=true": {
"model": "ariasessentials:block/tflipflop",
"y": 90
},
"facing=east,input_power=true,powered=false": {
"facing=east,inputpower=true,powered=false": {
"model": "ariasessentials:block/tflipflop",
"y": 90
},
"facing=east,input_power=true,powered=true": {
"facing=east,inputpower=true,powered=true": {
"model": "ariasessentials:block/tflipflop",
"y": 90
},
"facing=north,input_power=false,powered=false": {
"facing=north,inputpower=false,powered=false": {
"model": "ariasessentials:block/tflipflop"
},
"facing=north,input_power=false,powered=true": {
"facing=north,inputpower=false,powered=true": {
"model": "ariasessentials:block/tflipflop"
},
"facing=north,input_power=true,powered=false": {
"facing=north,inputpower=true,powered=false": {
"model": "ariasessentials:block/tflipflop"
},
"facing=north,input_power=true,powered=true": {
"facing=north,inputpower=true,powered=true": {
"model": "ariasessentials:block/tflipflop"
},
"facing=south,input_power=false,powered=false": {
"facing=south,inputpower=false,powered=false": {
"model": "ariasessentials:block/tflipflop",
"y": 180
},
"facing=south,input_power=false,powered=true": {
"facing=south,inputpower=false,powered=true": {
"model": "ariasessentials:block/tflipflop",
"y": 180
},
"facing=south,input_power=true,powered=false": {
"facing=south,inputpower=true,powered=false": {
"model": "ariasessentials:block/tflipflop",
"y": 180
},
"facing=south,input_power=true,powered=true": {
"facing=south,inputpower=true,powered=true": {
"model": "ariasessentials:block/tflipflop",
"y": 180
},
"facing=west,input_power=false,powered=false": {
"facing=west,inputpower=false,powered=false": {
"model": "ariasessentials:block/tflipflop",
"y": 270
},
"facing=west,input_power=false,powered=true": {
"facing=west,inputpower=false,powered=true": {
"model": "ariasessentials:block/tflipflop",
"y": 270
},
"facing=west,input_power=true,powered=false": {
"facing=west,inputpower=true,powered=false": {
"model": "ariasessentials:block/tflipflop",
"y": 270
},
"facing=west,input_power=true,powered=true": {
"facing=west,inputpower=true,powered=true": {
"model": "ariasessentials:block/tflipflop",
"y": 270
}

View file

@ -1,22 +0,0 @@
package dev.zontreck.essentials.blocks;
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;
public class BlockCustomVoxels extends PartialTransparentBlock
{
private VoxelShape superShape;
protected BlockCustomVoxels(Properties p_54120_, VoxelShape shape) {
super(p_54120_);
this.superShape = shape;
}
@Override
public VoxelShape getShape(BlockState p_60555_, BlockGetter p_60556_, BlockPos p_60557_, CollisionContext p_60558_) {
return superShape;
}
}

View file

@ -3,6 +3,10 @@ package dev.zontreck.essentials.blocks;
import dev.zontreck.essentials.AriasEssentials;
import dev.zontreck.essentials.blocks.logicgates.TFlipFlopBlock;
import dev.zontreck.essentials.items.CreativeModeTabs;
import dev.zontreck.libzontreck.blocks.BlockCustomVoxels;
import dev.zontreck.libzontreck.blocks.PartialTransparentBlock;
import dev.zontreck.libzontreck.blocks.PartialTransparentSlabBlock;
import dev.zontreck.libzontreck.blocks.RotatableBlockCustomVoxels;
import dev.zontreck.libzontreck.edlibmc.Auxiliaries;
import dev.zontreck.libzontreck.edlibmc.StandardBlocks;
import net.minecraft.core.BlockPos;
@ -318,6 +322,7 @@ public class ModBlocks {
public static final RegistryObject<Block> STEEL_CATWALK_BLOCK = registerWithItem(BLOCKS.register("steel_catwalk_block", ()-> new Block(gratingBlock)), new Item.Properties());
public static final VoxelShape SHAPE_T_FLIPFLOP = Block.box(0, 0, 0, 16, 1, 16);
public static final RegistryObject<Block> TFLIPFLOP_BLOCK = registerWithItem(BLOCKS.register("tflipflop", () -> new TFlipFlopBlock(noViewBlocking().noOcclusion().noCollission())), new Item.Properties());

View file

@ -1,18 +0,0 @@
package dev.zontreck.essentials.blocks;
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.block.AbstractGlassBlock;
import net.minecraft.world.level.block.state.BlockState;
public class PartialTransparentBlock extends AbstractGlassBlock
{
protected PartialTransparentBlock(Properties p_48729_) {
super(p_48729_);
}
@Override
public boolean propagatesSkylightDown(BlockState p_48740_, BlockGetter p_48741_, BlockPos p_48742_) {
return true;
}
}

View file

@ -1,19 +0,0 @@
package dev.zontreck.essentials.blocks;
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.block.AbstractGlassBlock;
import net.minecraft.world.level.block.SlabBlock;
import net.minecraft.world.level.block.state.BlockState;
public class PartialTransparentSlabBlock extends SlabBlock
{
protected PartialTransparentSlabBlock(Properties p_48729_) {
super(p_48729_);
}
@Override
public boolean propagatesSkylightDown(BlockState p_48740_, BlockGetter p_48741_, BlockPos p_48742_) {
return true;
}
}

View file

@ -1,26 +0,0 @@
package dev.zontreck.essentials.blocks;
import net.minecraft.world.item.context.BlockPlaceContext;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.HorizontalDirectionalBlock;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.StateDefinition;
public class RotatableBlock extends HorizontalDirectionalBlock
{
protected RotatableBlock(Properties pProperties) {
super(pProperties);
}
@Override
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> pBuilder) {
super.createBlockStateDefinition(pBuilder);
pBuilder.add(FACING);
}
@Override
public BlockState getStateForPlacement(BlockPlaceContext pContext) {
return defaultBlockState().setValue(FACING, pContext.getHorizontalDirection());
}
}

View file

@ -1,35 +0,0 @@
package dev.zontreck.essentials.blocks;
import dev.zontreck.ariaslib.util.Maps;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.Shapes;
import net.minecraft.world.phys.shapes.VoxelShape;
import java.util.HashMap;
import java.util.Map;
public class RotatableBlockCustomVoxels extends RotatableBlock
{
private Map<Direction, VoxelShape> rotatedShapes = new HashMap<>();
protected RotatableBlockCustomVoxels(Properties properties, VoxelShape north, VoxelShape south, VoxelShape east, VoxelShape west) {
super(properties);
rotatedShapes = Maps.of(new Maps.Entry<>(Direction.NORTH, north), new Maps.Entry<>(Direction.SOUTH, south), new Maps.Entry<>(Direction.WEST, west), new Maps.Entry<>(Direction.EAST, east), new Maps.Entry<>(Direction.NORTH, north), new Maps.Entry<>(Direction.DOWN, north));
}
@Override
public VoxelShape getShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext context) {
Direction facing = state.getValue(FACING);
return rotatedShapes.get(facing);
}
@Override
public boolean propagatesSkylightDown(BlockState p_49928_, BlockGetter p_49929_, BlockPos p_49930_) {
return true;
}
}

View file

@ -1,75 +1,54 @@
package dev.zontreck.essentials.blocks.logicgates;
import dev.zontreck.essentials.blocks.RotatableBlock;
import dev.zontreck.essentials.AriasEssentials;
import dev.zontreck.essentials.blocks.ModBlocks;
import dev.zontreck.libzontreck.blocks.RedstoneBlock;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.world.item.context.BlockPlaceContext;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.block.*;
import net.minecraft.world.level.LevelReader;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.StateDefinition;
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
import net.minecraft.world.level.block.state.properties.BooleanProperty;
import org.jetbrains.annotations.Nullable;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;
public class TFlipFlopBlock extends RotatableBlock
public class TFlipFlopBlock extends RedstoneBlock
{
public static final BooleanProperty POWERED = BlockStateProperties.POWERED;
public static final BooleanProperty INPUTPOWER = BooleanProperty.create("input_power");
public TFlipFlopBlock(Properties p_49795_) {
super(p_49795_);
super(p_49795_, Direction.NORTH, Direction.SOUTH);
}
@Override
public BlockState rotate(BlockState p_55115_, Rotation p_55116_) {
return p_55115_.setValue(FACING, p_55116_.rotate(p_55115_.getValue(FACING)));
}
@Override
public BlockState mirror(BlockState p_55112_, Mirror p_55113_) {
return p_55112_.rotate(p_55113_.getRotation(p_55112_.getValue(FACING)));
}
@Override
public BlockState getStateForPlacement(BlockPlaceContext p_55087_) {
return super.getStateForPlacement(p_55087_).setValue(POWERED, false).setValue(INPUTPOWER, false);
}
@Override
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
super.createBlockStateDefinition(builder);
builder.add(POWERED, INPUTPOWER);
}
@Override
public boolean canConnectRedstone(BlockState state, BlockGetter level, BlockPos pos, @Nullable Direction direction) {
public boolean propagatesSkylightDown(BlockState p_49928_, BlockGetter p_49929_, BlockPos p_49930_) {
return true;
}
@Override
public VoxelShape getShape(BlockState p_60555_, BlockGetter p_60556_, BlockPos p_60557_, CollisionContext p_60558_) {
return ModBlocks.SHAPE_T_FLIPFLOP;
}
@Override
protected void onRedstone(LevelReader levelReader, BlockPos blockPos, boolean b) {
}
@Override
protected void onRedstoneInputChanged(LevelReader levelReader, BlockPos blockPos, boolean b) {
BlockState state = levelReader.getBlockState(blockPos);
AriasEssentials.LOGGER.info("Redstone connected to TFlipFlop block, B : " + b + "; INP:" + state.getValue(INPUT_POWER) + "; POW:" + state.getValue(POWERED));
if (b) {
if (state.getValue(POWERED)) {
state.setValue(POWERED, false);
} else {
state.setValue(POWERED, true);
}
}
}
@Override
public int getSignal(BlockState state, BlockGetter level, BlockPos pos, Direction direction) {
return state.getValue(POWERED) && state.getValue(FACING) == direction ? 15 : 0;
}
public void updatePowered(BlockState state)
{
boolean powered = state.getValue(POWERED);
boolean inputPower = state.getValue(INPUTPOWER);
if(inputPower)return;
inputPower = true;
powered = !powered;
state.setValue((POWERED), powered);
state.setValue((INPUTPOWER), inputPower);
}
public void removePower(BlockState state)
{
state.setValue(INPUTPOWER, false);
int signal = super.getSignal(state, level, pos, direction);
return state.getValue(FACING) == direction ? signal : 0;
}
}

View file

@ -3,9 +3,7 @@
"textures": {
"0": "ariasessentials:block/logicgates/logic_gate",
"1": "ariasessentials:block/logicgates/tflipflop",
"2": "ariasessentials:block/logicgates/locked_bar",
"3": "ariasessentials:block/logicgates/torch",
"4": "ariasessentials:block/logicgates/off",
"3": "ariasessentials:block/logicgates/torch_off",
"particle": "ariasessentials:block/logicgates/logic_gate"
},
"elements": [
@ -20,18 +18,6 @@
"up": {"uv": [0, 0, 15.5, 15.5], "rotation": 270, "texture": "#1"}
}
},
{
"name": "lock_bar",
"from": [3, 0.5, 11],
"to": [13, 1, 12],
"faces": {
"north": {"uv": [0, 0, 9, 1], "texture": "#2"},
"east": {"uv": [2, 3, 3, 4], "texture": "#2"},
"south": {"uv": [0, 1, 9, 2], "texture": "#2"},
"west": {"uv": [2, 2, 3, 3], "texture": "#2"},
"up": {"uv": [1, 11, 0, 2], "rotation": 270, "texture": "#2"}
}
},
{
"from": [0, 0, 0],
"to": [16, 0.25, 16],
@ -45,78 +31,105 @@
}
},
{
"name": "indicator",
"from": [8.4, 3.25, 14.25],
"to": [9.15, 4.25, 15],
"from": [8.45, 0.5, 14],
"to": [9.2, 3, 14.75],
"faces": {
"north": {"uv": [0, 0, 16, 16], "texture": "#4"},
"east": {"uv": [0, 0, 16, 16], "texture": "#4"},
"south": {"uv": [0, 0, 16, 16], "texture": "#4"},
"west": {"uv": [0, 0, 16, 16], "texture": "#4"},
"up": {"uv": [0, 0, 16, 16], "rotation": 270, "texture": "#4"}
"north": {"uv": [6, 6, 9.75, 14.5], "texture": "#3"},
"east": {"uv": [6, 6, 9.75, 14.5], "texture": "#3"},
"south": {"uv": [6, 6, 9.75, 14.5], "texture": "#3"},
"west": {"uv": [6, 6, 9.75, 14.5], "texture": "#3"}
}
},
{
"name": "torch",
"from": [8.4, 0.5, 14.25],
"to": [9.15, 3.25, 15],
"from": [8.1, 3, 14],
"to": [9.55, 3.75, 14.75],
"faces": {
"north": {"uv": [1, 0, 2, 3], "texture": "#3"},
"east": {"uv": [2, 0, 2.75, 2.75], "texture": "#3"},
"south": {"uv": [0, 3, 1, 6], "texture": "#3"},
"west": {"uv": [0, 0, 1, 3], "texture": "#3"},
"up": {"uv": [4, 1, 3, 0], "rotation": 270, "texture": "#3"},
"down": {"uv": [2, 3, 1, 4], "rotation": 90, "texture": "#3"}
"north": {"uv": [4, 0, 11.75, 5.5], "texture": "#3"},
"south": {"uv": [4, 0, 11.75, 5.5], "texture": "#3"}
}
},
{
"name": "indicator",
"from": [8.4, 3.25, 4.25],
"to": [9.15, 4.25, 5],
"from": [8.45, 3.475, 14],
"to": [9.2, 3.475, 14.75],
"faces": {
"north": {"uv": [0, 0, 16, 16], "texture": "#4"},
"east": {"uv": [0, 0, 16, 16], "texture": "#4"},
"south": {"uv": [0, 0, 16, 16], "texture": "#4"},
"west": {"uv": [0, 0, 16, 16], "texture": "#4"},
"up": {"uv": [0, 0, 16, 16], "rotation": 270, "texture": "#4"}
"up": {"uv": [6, 3, 10, 6], "texture": "#3"}
}
},
{
"name": "torch",
"from": [8.4, 0.5, 4.25],
"to": [9.15, 3.25, 5],
"from": [8.45, 3, 13.65],
"to": [9.2, 3.75, 15.1],
"rotation": {"angle": 0, "axis": "y", "origin": [8.825, 3.375, 14.375]},
"faces": {
"north": {"uv": [0, 0, 0.75, 2.75], "texture": "#3"},
"east": {"uv": [0, 0, 0.75, 2.75], "texture": "#3"},
"south": {"uv": [0, 0, 0.75, 2.75], "texture": "#3"},
"west": {"uv": [0, 0, 0.75, 2.75], "texture": "#3"},
"up": {"uv": [0, 0, 0.75, 0.75], "rotation": 270, "texture": "#3"},
"down": {"uv": [0, 0, 0.75, 0.75], "rotation": 90, "texture": "#3"}
"east": {"uv": [4, 0, 11.75, 5.5], "texture": "#3"},
"west": {"uv": [4, 0, 11.75, 5.5], "texture": "#3"}
}
},
{
"name": "indicator",
"from": [8.4, 3.25, 1.25],
"to": [9.15, 4.25, 2],
"from": [8.45, 0.5, 4],
"to": [9.2, 3, 4.75],
"faces": {
"north": {"uv": [0, 0, 16, 16], "texture": "#4"},
"east": {"uv": [0, 0, 16, 16], "texture": "#4"},
"south": {"uv": [0, 0, 16, 16], "texture": "#4"},
"west": {"uv": [0, 0, 16, 16], "texture": "#4"},
"up": {"uv": [0, 0, 16, 16], "rotation": 270, "texture": "#4"}
"north": {"uv": [6, 6, 9.75, 14.5], "texture": "#3"},
"east": {"uv": [6, 6, 9.75, 14.5], "texture": "#3"},
"south": {"uv": [6, 6, 9.75, 14.5], "texture": "#3"},
"west": {"uv": [6, 6, 9.75, 14.5], "texture": "#3"}
}
},
{
"name": "torch",
"from": [8.4, 0.5, 1.25],
"to": [9.15, 3.25, 2],
"from": [8.1, 3, 4],
"to": [9.55, 3.75, 4.75],
"faces": {
"north": {"uv": [0, 0, 0.75, 2.75], "texture": "#3"},
"east": {"uv": [0, 0, 0.75, 2.75], "texture": "#3"},
"south": {"uv": [0, 0, 0.75, 2.75], "texture": "#3"},
"west": {"uv": [0, 0, 0.75, 2.75], "texture": "#3"},
"up": {"uv": [0, 0, 0.75, 0.75], "rotation": 270, "texture": "#3"},
"down": {"uv": [0, 0, 0.75, 0.75], "rotation": 90, "texture": "#3"}
"north": {"uv": [4, 0, 11.75, 5.5], "texture": "#3"},
"south": {"uv": [4, 0, 11.75, 5.5], "texture": "#3"}
}
},
{
"from": [8.45, 3.475, 4],
"to": [9.2, 3.475, 4.75],
"faces": {
"up": {"uv": [6, 3, 10, 6], "texture": "#3"}
}
},
{
"from": [8.45, 3, 3.65],
"to": [9.2, 3.75, 5.1],
"rotation": {"angle": 0, "axis": "y", "origin": [8.825, 3.375, 14.375]},
"faces": {
"east": {"uv": [4, 0, 11.75, 5.5], "texture": "#3"},
"west": {"uv": [4, 0, 11.75, 5.5], "texture": "#3"}
}
},
{
"from": [8.45, 0.5, 0.8],
"to": [9.2, 3, 1.55],
"faces": {
"north": {"uv": [6, 6, 9.75, 14.5], "texture": "#3"},
"east": {"uv": [6, 6, 9.75, 14.5], "texture": "#3"},
"south": {"uv": [6, 6, 9.75, 14.5], "texture": "#3"},
"west": {"uv": [6, 6, 9.75, 14.5], "texture": "#3"}
}
},
{
"from": [8.1, 3, 0.8],
"to": [9.55, 3.75, 1.55],
"faces": {
"north": {"uv": [4, 0, 11.75, 5.5], "texture": "#3"},
"south": {"uv": [4, 0, 11.75, 5.5], "texture": "#3"}
}
},
{
"from": [8.45, 3.475, 0.8],
"to": [9.2, 3.475, 1.55],
"faces": {
"up": {"uv": [6, 3, 10, 6], "texture": "#3"}
}
},
{
"from": [8.45, 3, 0.45],
"to": [9.2, 3.75, 1.9],
"rotation": {"angle": 0, "axis": "y", "origin": [8.825, 3.375, 14.375]},
"faces": {
"east": {"uv": [4, 0, 11.75, 5.5], "texture": "#3"},
"west": {"uv": [4, 0, 11.75, 5.5], "texture": "#3"}
}
}
],
@ -160,28 +173,28 @@
"origin": [0, 0, 0],
"color": 0,
"nbt": "{}",
"children": [0, 1, 2]
"children": [0, 1]
},
{
"name": "input",
"origin": [0, 0, 0],
"color": 0,
"nbt": "{}",
"children": [3, 4]
"children": [2, 3, 4, 5]
},
{
"name": "state",
"origin": [0, 0, 0],
"color": 0,
"nbt": "{}",
"children": [5, 6]
"children": [6, 7, 8, 9]
},
{
"name": "state",
"origin": [0, 0, 0],
"color": 0,
"nbt": "{}",
"children": [7, 8]
"children": [10, 11, 12, 13]
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 263 B