Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement shulker boxes #956

Draft
wants to merge 17 commits into
base: master
Choose a base branch
from
Draft

Conversation

mmm545
Copy link
Contributor

@mmm545 mmm545 commented Dec 11, 2024

This PR aims to fully implement shulker boxes.

Only one thing needs to be addressed:

  • Properly implement the bounding box for shulker boxes.
    • Shulker boxes have a dynamically changing bounding box, it gradually expands as it opens, pushing entities in its path, and vise versa.

@DaPigGuy DaPigGuy mentioned this pull request Dec 15, 2024
89 tasks
@@ -254,7 +254,7 @@ func (s *Session) invByID(id int32, tx *world.Tx) (*inventory.Inventory, bool) {
return nil, false
}
switch id {
case protocol.ContainerLevelEntity:
case protocol.ContainerLevelEntity, protocol.ContainerShulkerBox:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should validate that the shulker box actually exists, as is the case with other container block inventories.


// ShulkerBox is a dye-able block that stores items. Unlike other blocks, it keeps its contents when broken.
type ShulkerBox struct {
solid // TODO: I don't think it should be solid
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Transparent & water loggable


// BreakInfo ...
func (s ShulkerBox) BreakInfo() BreakInfo {
return newBreakInfo(2, alwaysHarvestable, pickaxeEffective, oneOf(s)).withBlastResistance(10)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return newBreakInfo(2, alwaysHarvestable, pickaxeEffective, oneOf(s)).withBlastResistance(10)
return newBreakInfo(2, alwaysHarvestable, pickaxeEffective, oneOf(s))

Not needed if blast resistance = hardness * 5

@@ -0,0 +1,205 @@
package block

// ShulkerBoxType represents a type of shulker box.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice if we could avoid this. Candles & bundles will also have a no color option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants