Skip to content

Commit

Permalink
make certain blocks PistonBreakable
Browse files Browse the repository at this point in the history
  • Loading branch information
xNatsuri committed Jan 9, 2025
1 parent e11d3b7 commit a7ced05
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
5 changes: 5 additions & 0 deletions server/block/dragon_egg.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ func (d DragonEgg) SideClosed(cube.Pos, cube.Pos, *world.Tx) bool {
return false
}

// PistonBreakable ...
func (DragonEgg) PistonBreakable() bool {
return true
}

// teleport ...
func (d DragonEgg) teleport(pos cube.Pos, tx *world.Tx) {
for i := 0; i < 1000; i++ {
Expand Down
5 changes: 5 additions & 0 deletions server/block/ladder.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ func (l Ladder) SideClosed(cube.Pos, cube.Pos, *world.Tx) bool {
return false
}

// PistonBreakable ...
func (Ladder) PistonBreakable() bool {
return true
}

// BreakInfo ...
func (l Ladder) BreakInfo() BreakInfo {
return newBreakInfo(0.4, alwaysHarvestable, axeEffective, oneOf(l))
Expand Down
5 changes: 5 additions & 0 deletions server/block/leaves.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,11 @@ func (Leaves) SideClosed(cube.Pos, cube.Pos, *world.Tx) bool {
return false
}

// PistonBreakable ...
func (Leaves) PistonBreakable() bool {
return true
}

// EncodeBlock ...
func (l Leaves) EncodeBlock() (name string, properties map[string]any) {
return "minecraft:" + l.Wood.String() + "_leaves", map[string]any{"persistent_bit": l.Persistent, "update_bit": l.ShouldUpdate}
Expand Down
5 changes: 5 additions & 0 deletions server/block/lit_pumpkin.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ func (l LitPumpkin) LightEmissionLevel() uint8 {
return 15
}

// PistonBreakable ...
func (LitPumpkin) PistonBreakable() bool {
return true
}

// UseOnBlock ...
func (l LitPumpkin) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) {
pos, _, used = firstReplaceable(tx, pos, face, l)
Expand Down

0 comments on commit a7ced05

Please sign in to comment.