Moved block icons to UI atlas
This commit is contained in:
@@ -82,6 +82,7 @@ public class MinerDrone extends BaseDrone implements MinerTrait{
|
||||
|
||||
public void update(){
|
||||
if(item.amount == 0 || item.item.type != ItemType.material){
|
||||
clearItem();
|
||||
setState(mine);
|
||||
return;
|
||||
}
|
||||
@@ -93,11 +94,11 @@ public class MinerDrone extends BaseDrone implements MinerTrait{
|
||||
TileEntity tile = (TileEntity)target;
|
||||
|
||||
if(dst(target) < type.range){
|
||||
if(tile.tile.block().acceptStack(item.item, item.amount, tile.tile, MinerDrone.this) == item.amount){
|
||||
if(tile.tile.block().acceptStack(item.item, item.amount, tile.tile, MinerDrone.this) > 0){
|
||||
Call.transferItemTo(item.item, item.amount, x, y, tile.tile);
|
||||
item.amount = 0;
|
||||
}
|
||||
|
||||
clearItem();
|
||||
setState(mine);
|
||||
}
|
||||
|
||||
|
||||
@@ -591,7 +591,8 @@ public class Block extends BlockStorage{
|
||||
|
||||
public TextureRegion icon(Icon icon){
|
||||
if(icons[icon.ordinal()] == null){
|
||||
icons[icon.ordinal()] = Core.atlas.find(name + "-icon-" + icon.name(), icon == Icon.full ? getGeneratedIcons()[0] : Core.atlas.find(name + "-icon-full", getGeneratedIcons()[0]));
|
||||
icons[icon.ordinal()] = Core.atlas.find(name + "-icon-" + icon.name(), icon == Icon.full ?
|
||||
getGeneratedIcons()[0] : Core.atlas.find(name + "-icon-full", getGeneratedIcons()[0]));
|
||||
}
|
||||
return icons[icon.ordinal()];
|
||||
}
|
||||
@@ -701,10 +702,11 @@ public class Block extends BlockStorage{
|
||||
}
|
||||
|
||||
public enum Icon{
|
||||
//these are stored in the UI atlases
|
||||
small(8 * 3),
|
||||
medium(8 * 4),
|
||||
large(8 * 6),
|
||||
/** uses whatever the size of the block is */
|
||||
/** uses whatever the size of the block is. this is always stored in the main game atlas! */
|
||||
full(0);
|
||||
|
||||
public final int size;
|
||||
|
||||
Reference in New Issue
Block a user