This commit is contained in:
Anuken
2020-04-23 00:03:03 -04:00
parent 6cf422eebf
commit 362846bd68
19 changed files with 46 additions and 80 deletions
-8
View File
@@ -199,14 +199,6 @@ public class Block extends UnlockableContent{
return sum / size / size;
}
public void drawLayer(Tile tile){
if(tile.entity != null) tile.entity.drawLayer();
}
public void drawLayer2(Tile tile){
if(tile.entity != null) tile.entity.drawLayer2();
}
/** Drawn when you are placing a block. */
public void drawPlace(int x, int y, int rotation, boolean valid){
}
@@ -22,21 +22,11 @@ public class ShockMine extends Block{
destructible = true;
solid = false;
targetable = false;
layer = Layer.overlay;
rebuildable = false;
}
public class ShockMineEntity extends TileEntity{
@Override
public void drawLayer(){
super.draw();
Draw.color(team.color);
Draw.alpha(0.22f);
Fill.rect(x, y, 2f, 2f);
Draw.color();
}
@Override
public void drawTeam(){
//no
@@ -44,7 +34,11 @@ public class ShockMine extends Block{
@Override
public void draw(){
//nope
super.draw();
Draw.color(team.color);
Draw.alpha(0.22f);
Fill.rect(x, y, 2f, 2f);
Draw.color();
}
@Override
@@ -10,8 +10,8 @@ import arc.util.ArcAnnotate.*;
import arc.util.*;
import arc.util.io.*;
import mindustry.content.*;
import mindustry.gen.*;
import mindustry.entities.units.*;
import mindustry.gen.*;
import mindustry.graphics.*;
import mindustry.type.*;
import mindustry.ui.*;
@@ -36,7 +36,6 @@ public class Conveyor extends Block implements Autotiler{
super(name);
rotate = true;
update = true;
layer = Layer.overlay;
group = BlockGroup.transportation;
hasItems = true;
itemCapacity = 4;
@@ -127,6 +126,19 @@ public class Conveyor extends Block implements Autotiler{
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,
tilesize * blendsclx, tilesize * blendscly, rotation * 90);
//TODO is clustering necessary? does it create garbage?
Draw.z(Layer.blockOver);
for(int i = 0; i < len; i++){
Item item = ids[i];
tr1.trns(rotation * 90, tilesize, 0);
tr2.trns(rotation * 90, -tilesize / 2f, xs[i] * tilesize / 2f);
Draw.rect(item.icon(Cicon.medium),
(tile.x * tilesize + tr1.x * ys[i] + tr2.x),
(tile.y * tilesize + tr1.y * ys[i] + tr2.y), itemSize, itemSize);
}
}
@Override
@@ -150,21 +162,6 @@ public class Conveyor extends Block implements Autotiler{
}
}
@Override
public void drawLayer(){
byte rotation = tile.rotation();
for(int i = 0; i < len; i++){
Item item = ids[i];
tr1.trns(rotation * 90, tilesize, 0);
tr2.trns(rotation * 90, -tilesize / 2f, xs[i] * tilesize / 2f);
Draw.rect(item.icon(Cicon.medium),
(tile.x * tilesize + tr1.x * ys[i] + tr2.x),
(tile.y * tilesize + tr1.y * ys[i] + tr2.y), itemSize, itemSize);
}
}
@Override
public void unitOn(Unitc unit){
if(clogHeat > 0.5f){
@@ -32,7 +32,6 @@ public class ItemBridge extends Block{
update = true;
solid = true;
hasPower = true;
layer = Layer.power;
expanded = true;
itemCapacity = 10;
configurable = true;
@@ -375,8 +375,6 @@ public class PowerNode extends PowerBlock{
public void drawLayer(){
if(Core.settings.getInt("lasersopacity") == 0) return;
Tilec entity = tile.ent();
for(int i = 0; i < power.links.size; i++){
Tilec link = world.ent(power.links.get(i));
@@ -31,7 +31,6 @@ public class CoreBlock extends StorageBlock{
flags = EnumSet.of(BlockFlag.core, BlockFlag.producer);
activeSound = Sounds.respawning;
activeSoundVolume = 1f;
layer = Layer.overlay;
}
@Remote(called = Loc.server)