This commit is contained in:
Anuken
2020-03-13 22:33:37 -04:00
parent 06e94b1800
commit 808615a77c
19 changed files with 102 additions and 27 deletions

View File

@@ -118,11 +118,15 @@ public class Conveyor extends Block implements Autotiler{
int blendbits;
int blendsclx, blendscly;
boolean everupdated = false;
float clogHeat = 0f;
@Override
public void draw(){
if(!everupdated){
Log.info("--DID NOT UPDATE {0}", tile);
}
byte rotation = tile.rotation();
int frame = clogHeat <= 0.5f ? (int)(((Time.time() * speed * 8f * timeScale())) % 4) : 0;
Draw.rect(regions[Mathf.clamp(blendbits, 0, regions.length - 1)][Mathf.clamp(frame, 0, regions[0].length - 1)], x, y,
@@ -142,6 +146,7 @@ public class Conveyor extends Block implements Autotiler{
blendbits = bits[0];
blendsclx = bits[1];
blendscly = bits[2];
everupdated = true;
if(tile.front() != null && tile.front() != null){
next = tile.front();

View File

@@ -0,0 +1,11 @@
package mindustry.world.blocks.legacy;
import mindustry.world.*;
/** Any subclass of this will be removed upon world load. */
public class LegacyBlock extends Block{
public LegacyBlock(String name){
super(name);
}
}

View File

@@ -0,0 +1,25 @@
package mindustry.world.blocks.legacy;
import arc.util.io.*;
import mindustry.gen.*;
import mindustry.world.*;
public class LegacyMechPad extends Block{
public LegacyMechPad(String name){
super(name);
update = true;
}
public class LegacyMechPadEntity extends TileEntity{
@Override
public void read(Reads read, byte revision){
super.read(read, revision);
//read 3 floats for pad data, and discard them
read.f();
read.f();
read.f();
}
}
}

View File

@@ -204,7 +204,7 @@ public class Drill extends Block{
float progress;
int index;
float warmup;
float drillTime;
float timeDrilled;
float lastDrillSpeed;
int dominantItems;
@@ -249,7 +249,7 @@ public class Drill extends Block{
dump(dominantItem);
}
drillTime += warmup * delta();
timeDrilled += warmup * delta();
if(items.total() < itemCapacity && dominantItems > 0 && consValid()){
@@ -263,8 +263,7 @@ public class Drill extends Block{
lastDrillSpeed = (speed * dominantItems * warmup) / (drillTime + hardnessDrillMultiplier * dominantItem.hardness);
warmup = Mathf.lerpDelta(warmup, speed, warmupSpeed);
progress += delta()
* dominantItems * speed * warmup;
progress += delta() * dominantItems * speed * warmup;
if(Mathf.chance(Time.delta() * updateEffectChance * warmup))
updateEffect.at(getX() + Mathf.range(size * 2f), getY() + Mathf.range(size * 2f));
@@ -305,7 +304,7 @@ public class Drill extends Block{
Draw.color();
}
Draw.rect(rotatorRegion, x, y, drillTime * rotateSpeed);
Draw.rect(rotatorRegion, x, y, timeDrilled * rotateSpeed);
Draw.rect(topRegion, x, y);