-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement custom smooshing reactions.
Implement reactions between liquids or between a liquid and a solid, such as lava and water producing stone, or certain liquids being able to destroy certain blocks.
- Loading branch information
1 parent
0c5fd01
commit fec0da8
Showing
5 changed files
with
131 additions
and
17 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,9 @@ | ||
{ | ||
"LiquidSmooshingReaction" : { | ||
"liquid" : "CoreAssets:Water", | ||
"block" : "CoreAssets:Lava", | ||
"product" : "CoreAssets:Stone", | ||
"liquidRequired" : 0.5, | ||
"reversible" : true | ||
} | ||
} |
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,6 @@ | ||
{ | ||
"LiquidSmooshingReaction" : { | ||
"liquid" : "FlowingLiquids:DebugLiquid", | ||
"block" : "CoreAssets:Sand" | ||
} | ||
} |
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 |
---|---|---|
@@ -1,10 +1,12 @@ | ||
{ | ||
"id": "FlowingLiquids", | ||
"version": "1.2.1", | ||
"version": "1.3.0", | ||
"author": "4Denthusiast", | ||
"displayName": "FlowingLiquids", | ||
"description": "Lets water flow, conserving its volume.", | ||
"dependencies": [], | ||
"dependencies": [ | ||
{ "id": "CoreAssets", "minVersion": "2.0.0", "optional" : true } | ||
], | ||
"serverSideOnly": false, | ||
"isLibrary": true | ||
} |
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
29 changes: 29 additions & 0 deletions
29
...main/java/org/terasology/flowingliquids/world/block/LiquidSmooshingReactionComponent.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,29 @@ | ||
// Copyright 2020 The Terasology Foundation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package org.terasology.flowingliquids.world.block; | ||
|
||
import org.terasology.entitySystem.Component; | ||
|
||
/** | ||
* Specifies that a liquid is able to flow into and destroy a particular block, | ||
* and optionally create a different block in the process. | ||
*/ | ||
public class LiquidSmooshingReactionComponent implements Component { | ||
public String liquid; | ||
|
||
/** The block that gets smooshed */ | ||
public String block; | ||
|
||
/** The block produced by the reaction, or null if the block is simply destroyed */ | ||
public String product; | ||
|
||
/** The amount of liquid required (on average) to produce the product block, in units of whole blocks. */ | ||
public float liquidRequired = 1; | ||
|
||
/** If the block that gets smooshed is a liquid, how much of that second liquid is required (on average) to produce the product block. */ | ||
public float otherLiquidRequired = 1; | ||
|
||
/** If the block that is smooshed is also a liquid, whether the reverse reaction (`block` flowing into `liquid`) is also possible. */ | ||
public boolean reversible; | ||
} |