File tree Expand file tree Collapse file tree 3 files changed +25
-2
lines changed Expand file tree Collapse file tree 3 files changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,6 @@ import (
12
12
// Lava is a light-emitting fluid block that causes fire damage.
13
13
type Lava struct {
14
14
empty
15
- replaceable
16
15
17
16
// Still makes the lava not spread whenever it is updated. Still lava cannot be acquired in the game
18
17
// without world editing.
@@ -35,6 +34,16 @@ func neighboursLavaFlammable(pos cube.Pos, tx *world.Tx) bool {
35
34
return false
36
35
}
37
36
37
+ // ReplaceableBy ...
38
+ func (l Lava ) ReplaceableBy (b world.Block ) bool {
39
+ if _ , ok := b .(LiquidRemovable ); ok {
40
+ _ , displacer := b .(world.LiquidDisplacer )
41
+ _ , liquid := b .(world.Liquid )
42
+ return displacer || liquid
43
+ }
44
+ return true
45
+ }
46
+
38
47
// EntityInside ...
39
48
func (l Lava ) EntityInside (_ cube.Pos , _ * world.Tx , e world.Entity ) {
40
49
if fallEntity , ok := e .(fallDistanceEntity ); ok {
Original file line number Diff line number Diff line change @@ -29,6 +29,11 @@ func (SeaPickle) canSurvive(pos cube.Pos, tx *world.Tx) bool {
29
29
if ! below .Model ().FaceSolid (pos .Side (cube .FaceDown ), cube .FaceUp , tx ) {
30
30
return false
31
31
}
32
+ if liquid , ok := tx .Liquid (pos ); ok {
33
+ if _ , ok = liquid .(Water ); ! ok || liquid .LiquidDepth () != 8 {
34
+ return false
35
+ }
36
+ }
32
37
if emitter , ok := below .(LightDiffuser ); ok && emitter .LightDiffusionLevel () != 15 {
33
38
return false
34
39
}
Original file line number Diff line number Diff line change @@ -14,7 +14,6 @@ import (
14
14
// Water is a natural fluid that generates abundantly in the world.
15
15
type Water struct {
16
16
empty
17
- replaceable
18
17
19
18
// Still makes the water appear as if it is not flowing.
20
19
Still bool
@@ -26,6 +25,16 @@ type Water struct {
26
25
Falling bool
27
26
}
28
27
28
+ // ReplaceableBy ...
29
+ func (w Water ) ReplaceableBy (b world.Block ) bool {
30
+ if _ , ok := b .(LiquidRemovable ); ok {
31
+ _ , displacer := b .(world.LiquidDisplacer )
32
+ _ , liquid := b .(world.Liquid )
33
+ return displacer || liquid
34
+ }
35
+ return true
36
+ }
37
+
29
38
// EntityInside ...
30
39
func (w Water ) EntityInside (_ cube.Pos , _ * world.Tx , e world.Entity ) {
31
40
if fallEntity , ok := e .(fallDistanceEntity ); ok {
You can’t perform that action at this time.
0 commit comments