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 (
1212// Lava is a light-emitting fluid block that causes fire damage. 
1313type  Lava  struct  {
1414	empty 
15- 	replaceable 
1615
1716	// Still makes the lava not spread whenever it is updated. Still lava cannot be acquired in the game 
1817	// without world editing. 
@@ -35,6 +34,16 @@ func neighboursLavaFlammable(pos cube.Pos, tx *world.Tx) bool {
3534	return  false 
3635}
3736
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+ 
3847// EntityInside ... 
3948func  (l  Lava ) EntityInside (_  cube.Pos , _  * world.Tx , e  world.Entity ) {
4049	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 {
2929	if  ! below .Model ().FaceSolid (pos .Side (cube .FaceDown ), cube .FaceUp , tx ) {
3030		return  false 
3131	}
32+ 	if  liquid , ok  :=  tx .Liquid (pos ); ok  {
33+ 		if  _ , ok  =  liquid .(Water ); ! ok  ||  liquid .LiquidDepth () !=  8  {
34+ 			return  false 
35+ 		}
36+ 	}
3237	if  emitter , ok  :=  below .(LightDiffuser ); ok  &&  emitter .LightDiffusionLevel () !=  15  {
3338		return  false 
3439	}
Original file line number Diff line number Diff line change @@ -14,7 +14,6 @@ import (
1414// Water is a natural fluid that generates abundantly in the world. 
1515type  Water  struct  {
1616	empty 
17- 	replaceable 
1817
1918	// Still makes the water appear as if it is not flowing. 
2019	Still  bool 
@@ -26,6 +25,16 @@ type Water struct {
2625	Falling  bool 
2726}
2827
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+ 
2938// EntityInside ... 
3039func  (w  Water ) EntityInside (_  cube.Pos , _  * world.Tx , e  world.Entity ) {
3140	if  fallEntity , ok  :=  e .(fallDistanceEntity ); ok  {
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments