mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-21 13:17:39 +07:00
Fixed #431 [item spacing not taken into account]
This commit is contained in:
@ -136,6 +136,28 @@ public class Blocks implements ContentList{
|
||||
cacheLayer = CacheLayer.water;
|
||||
}};
|
||||
|
||||
sandWater = new Floor("sand-water"){{
|
||||
liquidColor = Color.valueOf("596ab8");
|
||||
speedMultiplier = 0.8f;
|
||||
variants = 0;
|
||||
status = StatusEffects.wet;
|
||||
statusDuration = 50f;
|
||||
liquidDrop = Liquids.water;
|
||||
isLiquid = true;
|
||||
cacheLayer = CacheLayer.water;
|
||||
}};
|
||||
|
||||
darksandWater = new Floor("darksand-water"){{
|
||||
liquidColor = Color.valueOf("596ab8");
|
||||
speedMultiplier = 0.8f;
|
||||
variants = 0;
|
||||
status = StatusEffects.wet;
|
||||
statusDuration = 50f;
|
||||
liquidDrop = Liquids.water;
|
||||
isLiquid = true;
|
||||
cacheLayer = CacheLayer.water;
|
||||
}};
|
||||
|
||||
tar = new Floor("tar"){{
|
||||
drownTime = 150f;
|
||||
liquidColor = Color.valueOf("292929");
|
||||
@ -161,28 +183,6 @@ public class Blocks implements ContentList{
|
||||
blendGroup = stone;
|
||||
}};
|
||||
|
||||
sandWater = new Floor("sand-water"){{
|
||||
liquidColor = Color.valueOf("596ab8");
|
||||
speedMultiplier = 0.8f;
|
||||
variants = 0;
|
||||
status = StatusEffects.wet;
|
||||
statusDuration = 50f;
|
||||
liquidDrop = Liquids.water;
|
||||
isLiquid = true;
|
||||
cacheLayer = CacheLayer.water;
|
||||
}};
|
||||
|
||||
darksandWater = new Floor("darksand-water"){{
|
||||
liquidColor = Color.valueOf("596ab8");
|
||||
speedMultiplier = 0.8f;
|
||||
variants = 0;
|
||||
status = StatusEffects.wet;
|
||||
statusDuration = 50f;
|
||||
liquidDrop = Liquids.water;
|
||||
isLiquid = true;
|
||||
cacheLayer = CacheLayer.water;
|
||||
}};
|
||||
|
||||
sand = new Floor("sand"){{
|
||||
itemDrop = Items.sand;
|
||||
playerUnmineable = true;
|
||||
|
@ -73,9 +73,9 @@ public class BlockRenderer{
|
||||
|
||||
Events.on(TileChangeEvent.class, event -> {
|
||||
int avgx = (int)(camera.position.x / tilesize);
|
||||
int avgy = (int)(camera.position. y/ tilesize);
|
||||
int rangex = (int) (camera.width / tilesize / 2) + 2;
|
||||
int rangey = (int) (camera.height / tilesize / 2) + 2;
|
||||
int avgy = (int)(camera.position. y / tilesize);
|
||||
int rangex = (int) (camera.width / tilesize / 2) + 2;
|
||||
int rangey = (int) (camera.height / tilesize / 2) + 2;
|
||||
|
||||
if(Math.abs(avgx - event.tile.x) <= rangex && Math.abs(avgy - event.tile.y) <= rangey){
|
||||
lastCamY = lastCamX = -99; //invalidate camera position so blocks get updated
|
||||
|
@ -29,7 +29,7 @@ import java.io.IOException;
|
||||
import static io.anuke.mindustry.Vars.*;
|
||||
|
||||
public class Conveyor extends Block{
|
||||
private static final float itemSpace = 0.135f * 3f;
|
||||
private static final float itemSpace = 0.4f;
|
||||
private static final float minmove = 1f / (Short.MAX_VALUE - 2);
|
||||
private static ItemPos drawpos = new ItemPos();
|
||||
private static ItemPos pos1 = new ItemPos();
|
||||
@ -60,7 +60,7 @@ public class Conveyor extends Block{
|
||||
@Override
|
||||
public void setStats(){
|
||||
super.setStats();
|
||||
stats.add(BlockStat.itemsMoved, speed * 60, StatUnit.itemsSecond);
|
||||
stats.add(BlockStat.itemsMoved, speed * 60 * (1f / itemSpace), StatUnit.itemsSecond);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user