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;
|
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"){{
|
tar = new Floor("tar"){{
|
||||||
drownTime = 150f;
|
drownTime = 150f;
|
||||||
liquidColor = Color.valueOf("292929");
|
liquidColor = Color.valueOf("292929");
|
||||||
@@ -161,28 +183,6 @@ public class Blocks implements ContentList{
|
|||||||
blendGroup = stone;
|
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"){{
|
sand = new Floor("sand"){{
|
||||||
itemDrop = Items.sand;
|
itemDrop = Items.sand;
|
||||||
playerUnmineable = true;
|
playerUnmineable = true;
|
||||||
|
|||||||
@@ -73,9 +73,9 @@ public class BlockRenderer{
|
|||||||
|
|
||||||
Events.on(TileChangeEvent.class, event -> {
|
Events.on(TileChangeEvent.class, event -> {
|
||||||
int avgx = (int)(camera.position.x / tilesize);
|
int avgx = (int)(camera.position.x / tilesize);
|
||||||
int avgy = (int)(camera.position. y/ tilesize);
|
int avgy = (int)(camera.position. y / tilesize);
|
||||||
int rangex = (int) (camera.width / tilesize / 2) + 2;
|
int rangex = (int) (camera.width / tilesize / 2) + 2;
|
||||||
int rangey = (int) (camera.height / 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){
|
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
|
lastCamY = lastCamX = -99; //invalidate camera position so blocks get updated
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ import java.io.IOException;
|
|||||||
import static io.anuke.mindustry.Vars.*;
|
import static io.anuke.mindustry.Vars.*;
|
||||||
|
|
||||||
public class Conveyor extends Block{
|
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 final float minmove = 1f / (Short.MAX_VALUE - 2);
|
||||||
private static ItemPos drawpos = new ItemPos();
|
private static ItemPos drawpos = new ItemPos();
|
||||||
private static ItemPos pos1 = new ItemPos();
|
private static ItemPos pos1 = new ItemPos();
|
||||||
@@ -60,7 +60,7 @@ public class Conveyor extends Block{
|
|||||||
@Override
|
@Override
|
||||||
public void setStats(){
|
public void setStats(){
|
||||||
super.setStats();
|
super.setStats();
|
||||||
stats.add(BlockStat.itemsMoved, speed * 60, StatUnit.itemsSecond);
|
stats.add(BlockStat.itemsMoved, speed * 60 * (1f / itemSpace), StatUnit.itemsSecond);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user