mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-08 01:43:59 +07:00
Cleanup
This commit is contained in:
parent
2395bc9308
commit
67a084a5e7
Binary file not shown.
Before Width: | Height: | Size: 736 B After Width: | Height: | Size: 736 B |
Binary file not shown.
Before Width: | Height: | Size: 128 KiB After Width: | Height: | Size: 128 KiB |
@ -159,6 +159,24 @@ public class Blocks implements ContentList{
|
|||||||
albedo = 0.5f;
|
albedo = 0.5f;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
darksandTaintedWater = new ShallowLiquid("darksand-tainted-water"){{
|
||||||
|
speedMultiplier = 0.75f;
|
||||||
|
statusDuration = 60f;
|
||||||
|
albedo = 0.5f;
|
||||||
|
}};
|
||||||
|
|
||||||
|
sandWater = new ShallowLiquid("sand-water"){{
|
||||||
|
speedMultiplier = 0.8f;
|
||||||
|
statusDuration = 50f;
|
||||||
|
albedo = 0.5f;
|
||||||
|
}};
|
||||||
|
|
||||||
|
darksandWater = new ShallowLiquid("darksand-water"){{
|
||||||
|
speedMultiplier = 0.8f;
|
||||||
|
statusDuration = 50f;
|
||||||
|
albedo = 0.5f;
|
||||||
|
}};
|
||||||
|
|
||||||
tar = new Floor("tar"){{
|
tar = new Floor("tar"){{
|
||||||
drownTime = 150f;
|
drownTime = 150f;
|
||||||
status = StatusEffects.tarred;
|
status = StatusEffects.tarred;
|
||||||
@ -221,23 +239,9 @@ public class Blocks implements ContentList{
|
|||||||
playerUnmineable = true;
|
playerUnmineable = true;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
darksandTaintedWater = new ShallowLiquid("darksand-tainted-water", Blocks.taintedWater, Blocks.darksand){{
|
((ShallowLiquid)darksandTaintedWater).set(Blocks.taintedWater, Blocks.darksand);
|
||||||
speedMultiplier = 0.75f;
|
((ShallowLiquid)sandWater).set(Blocks.water, Blocks.sand);
|
||||||
statusDuration = 60f;
|
((ShallowLiquid)darksandWater).set(Blocks.water, Blocks.darksand);
|
||||||
albedo = 0.5f;
|
|
||||||
}};
|
|
||||||
|
|
||||||
sandWater = new ShallowLiquid("sand-water", Blocks.water, Blocks.sand){{
|
|
||||||
speedMultiplier = 0.8f;
|
|
||||||
statusDuration = 50f;
|
|
||||||
albedo = 0.5f;
|
|
||||||
}};
|
|
||||||
|
|
||||||
darksandWater = new ShallowLiquid("darksand-water", Blocks.water, Blocks.darksand){{
|
|
||||||
speedMultiplier = 0.8f;
|
|
||||||
statusDuration = 50f;
|
|
||||||
albedo = 0.5f;
|
|
||||||
}};
|
|
||||||
|
|
||||||
holostone = new Floor("holostone"){{
|
holostone = new Floor("holostone"){{
|
||||||
|
|
||||||
|
@ -59,7 +59,9 @@ public class UnitType extends UnlockableContent{
|
|||||||
if(EntityMapping.map(name) != null){
|
if(EntityMapping.map(name) != null){
|
||||||
constructor = EntityMapping.map(name);
|
constructor = EntityMapping.map(name);
|
||||||
}else{
|
}else{
|
||||||
constructor = () -> Nulls.unit;
|
//TODO fix for mods
|
||||||
|
throw new RuntimeException("Unit has no type: " + name);
|
||||||
|
//constructor = () -> Nulls.unit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -231,14 +231,7 @@ public class Floor extends Block{
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected boolean doEdge(Floor other, boolean sameLayer){
|
protected boolean doEdge(Floor other, boolean sameLayer){
|
||||||
//TODO this is awful and should not exist.
|
return (((other.blendGroup.id > blendGroup.id) || edges() == null) && (other.cacheLayer.ordinal() > this.cacheLayer.ordinal() || !sameLayer));
|
||||||
boolean normal = ((other instanceof ShallowLiquid) == (this instanceof ShallowLiquid)) || (cacheLayer == other.cacheLayer);
|
|
||||||
return (((other.blendGroup.id > blendGroup.id) || edges() == null) &&
|
|
||||||
other.edgeOnto(this) && (other.cacheLayer.ordinal() > this.cacheLayer.ordinal() || !sameLayer)) == normal;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected boolean edgeOnto(Floor other){
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TextureRegion edge(Floor block, int x, int y){
|
TextureRegion edge(Floor block, int x, int y){
|
||||||
|
@ -4,12 +4,14 @@ import mindustry.world.*;
|
|||||||
|
|
||||||
//do not use in mods!
|
//do not use in mods!
|
||||||
public class ShallowLiquid extends Floor{
|
public class ShallowLiquid extends Floor{
|
||||||
public final Floor liquidBase, floorBase;
|
public Floor liquidBase, floorBase;
|
||||||
public float liquidOpacity = 0.35f;
|
public float liquidOpacity = 0.35f;
|
||||||
|
|
||||||
public ShallowLiquid(String name, Block liquid, Block floor){
|
public ShallowLiquid(String name){
|
||||||
super(name);
|
super(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void set(Block liquid, Block floor){
|
||||||
this.liquidBase = liquid.asFloor();
|
this.liquidBase = liquid.asFloor();
|
||||||
this.floorBase = floor.asFloor();
|
this.floorBase = floor.asFloor();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user