-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
61 changed files
with
2,116 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# CHANGELOG | ||
- ### There's a config now !! | ||
- ### Urns can now be interacted with Dirt -- when they are filled in this way, plants can be placed atop them. | ||
- To remove the Dirt, simply right-click the Urn with any Shovel -- this uses the #minecraft:shovels tag, so any item tagged as a Shovel will work. | ||
- Urns utilize Supplementaries' "prevents_offset_above" tag, so when using Supplementaries, plants will not have a random offset when placed inside of Urns. This prevents them from being placed on the edges of the Urn. | ||
- ### Stone Frames + Frame Tweaks | ||
- Frames now have custom hitboxes, and can be interacted through. Their more precise hitboxes will be replaced with a larger hitbox when holding Hammers or Frames or crouching. | ||
- **There is a config available to change these hitboxes to always be visible or to not get show at all when crouching.** | ||
- Frame tooltips also change depending on which config option you have enabled! | ||
- Stone Frames act the same as normal wooden Frames -- the only differences are their materials and styles. | ||
- Frames now have custom sizing when placed in Item Frames, allowing them to encompass the Item Frame _(but with a different shape)_, allowing for further Frame customization and build opportunities. | ||
- Wooden Frames and stone Frames alike no longer have an odd pixel gap when placed on corners. The corner gap fills -- this is a simple model change. | ||
- Frames no longer have z-fighting when customized with Debug Sticks or placed on opposing corners. | ||
- ### Added Balustrades | ||
- Balustrades replace the functionality of placing Trapdoors on top of Lecterns, but in all wood types. | ||
- Balustrades can be interacted with a Hammer on either their top or bottom half to toggle the top and bottom respectively. Their center beam cannot be toggled, and uses the texture of Wooden Walls / Beams so they can better connect with them. | ||
- Balustrades can be **SHIFT** + right-clicked with a Hammer to tilt the top cube to represent a slightly taller Lectern. Doing so will give them a custom hitbox, but they will act the same otherwise. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package com.starfish_studios.bbb; | ||
|
||
import eu.midnightdust.lib.config.MidnightConfig; | ||
|
||
public class BBBConfig extends MidnightConfig { | ||
@Entry(category = "text") public static boolean disableShiftTooltips = false; | ||
@Entry(category = "text") public static boolean alwaysShowFrameHitboxes = false; | ||
@Entry(category = "text") public static boolean disableFrameCrouchHitbox = false; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
112 changes: 112 additions & 0 deletions
112
src/main/java/com/starfish_studios/bbb/block/BalustradeBlock.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
package com.starfish_studios.bbb.block; | ||
|
||
import com.starfish_studios.bbb.block.properties.BBBBlockStateProperties; | ||
import com.starfish_studios.bbb.block.properties.ColumnType; | ||
import com.starfish_studios.bbb.registry.BBBTags; | ||
import net.minecraft.core.BlockPos; | ||
import net.minecraft.core.Direction; | ||
import net.minecraft.world.InteractionHand; | ||
import net.minecraft.world.InteractionResult; | ||
import net.minecraft.world.entity.player.Player; | ||
import net.minecraft.world.item.context.BlockPlaceContext; | ||
import net.minecraft.world.level.BlockGetter; | ||
import net.minecraft.world.level.Level; | ||
import net.minecraft.world.level.block.Block; | ||
import net.minecraft.world.level.block.HorizontalDirectionalBlock; | ||
import net.minecraft.world.level.block.SimpleWaterloggedBlock; | ||
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 net.minecraft.world.level.block.state.properties.DirectionProperty; | ||
import net.minecraft.world.level.block.state.properties.IntegerProperty; | ||
import net.minecraft.world.level.material.FluidState; | ||
import net.minecraft.world.level.material.Fluids; | ||
import net.minecraft.world.phys.BlockHitResult; | ||
import net.minecraft.world.phys.shapes.CollisionContext; | ||
import net.minecraft.world.phys.shapes.Shapes; | ||
import net.minecraft.world.phys.shapes.VoxelShape; | ||
|
||
public class BalustradeBlock extends Block implements SimpleWaterloggedBlock { | ||
public static BooleanProperty TOP = BBBBlockStateProperties.TOP; | ||
public static BooleanProperty BOTTOM = BBBBlockStateProperties.BOTTOM; | ||
public static BooleanProperty TILTED = BooleanProperty.create("tilted"); | ||
public static final DirectionProperty FACING = BlockStateProperties.FACING; | ||
public static BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; | ||
|
||
public static VoxelShape BOTTOM_AABB = Block.box(0, 0, 0, 16, 2, 16); | ||
public static VoxelShape TOP_AABB = Block.box(0, 12, 0, 16, 16, 16); | ||
public static VoxelShape PILLAR_AABB = Block.box(4, 0, 4, 12, 16, 12); | ||
|
||
public static VoxelShape NORTH_TILTED_AABB = Shapes.or( | ||
Block.box(0, 12, 0, 16, 17, 8), | ||
Block.box(0, 15, 8, 16, 20, 16) | ||
); | ||
public static VoxelShape SOUTH_TILTED_AABB = Shapes.or( | ||
Block.box(0, 12, 8, 16, 17, 16), | ||
Block.box(0, 15, 0, 16, 20, 8) | ||
); | ||
public static VoxelShape EAST_TILTED_AABB = Shapes.or( | ||
Block.box(8, 10, 0, 16, 17, 16), | ||
Block.box(0, 15, 0, 8, 20, 16) | ||
); | ||
public static VoxelShape WEST_TILTED_AABB = Shapes.or( | ||
Block.box(0, 10, 0, 8, 17, 16), | ||
Block.box(8, 15, 0, 16, 20, 16) | ||
); | ||
|
||
public BalustradeBlock(Properties properties) { | ||
super(properties); | ||
this.registerDefaultState(this.stateDefinition.any() | ||
.setValue(FACING, Direction.NORTH) | ||
.setValue(TOP, true) | ||
.setValue(BOTTOM, true) | ||
.setValue(TILTED, false) | ||
.setValue(WATERLOGGED, false)); | ||
} | ||
|
||
@Override | ||
public InteractionResult use(BlockState state, Level level, BlockPos blockPos, Player player, InteractionHand hand, BlockHitResult hitResult) { | ||
if (player.getItemInHand(hand).is(BBBTags.BBBItemTags.HAMMERS)) { | ||
if (hitResult.getLocation().y - (double)blockPos.getY() > 0.5D) { | ||
level.setBlockAndUpdate(blockPos, state.cycle(TOP)); | ||
} else if (hitResult.getLocation().y - (double)blockPos.getY() < 0.5D) { | ||
level.setBlockAndUpdate(blockPos, state.cycle(BOTTOM)); | ||
} | ||
level.playSound(player, blockPos, state.getSoundType().getPlaceSound(), player.getSoundSource(), 1.0F, 1.0F); | ||
return InteractionResult.SUCCESS; | ||
} | ||
return InteractionResult.PASS; | ||
} | ||
|
||
@Override | ||
public VoxelShape getShape(BlockState state, BlockGetter blockGetter, BlockPos blockPos, CollisionContext collisionContext) { | ||
VoxelShape shape = PILLAR_AABB; | ||
if (state.getValue(TILTED) && state.getValue(TOP)) { | ||
shape = switch (state.getValue(FACING)) { | ||
case NORTH -> Shapes.or(shape, NORTH_TILTED_AABB); | ||
case SOUTH -> Shapes.or(shape, SOUTH_TILTED_AABB); | ||
case EAST -> Shapes.or(shape, EAST_TILTED_AABB); | ||
case WEST -> Shapes.or(shape, WEST_TILTED_AABB); | ||
default -> shape; | ||
}; | ||
} else if (state.getValue(TOP)) shape = Shapes.or(shape, TOP_AABB); | ||
if (state.getValue(BOTTOM)) shape = Shapes.or(shape, BOTTOM_AABB); | ||
return shape; | ||
} | ||
|
||
@Override | ||
public BlockState getStateForPlacement(BlockPlaceContext context) { | ||
return this.defaultBlockState() | ||
.setValue(FACING, context.getHorizontalDirection().getOpposite()) | ||
.setValue(WATERLOGGED, context.getLevel().getFluidState(context.getClickedPos()).getType() == Fluids.WATER); | ||
} | ||
|
||
public FluidState getFluidState(BlockState blockState) { | ||
return blockState.getValue(WATERLOGGED) ? Fluids.WATER.getSource(false) : super.getFluidState(blockState); | ||
} | ||
|
||
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) { | ||
builder.add(TOP, BOTTOM, WATERLOGGED, FACING, TILTED); | ||
} | ||
} |
Oops, something went wrong.