APISonar


io.anuke.ucore.core.Timers.time

> io > anuke > ucore > core > Timers > time
io APIs anuke APIs ucore APIs core APIs Timers APIs time APIs

Example 1
public void update(){
        super.update();

        if(Net.client() && state.is(repair) && target instanceof TileEntity){
            TileEntity entity = (TileEntity) target;
            entity.health += type.healSpeed * Timers.delta();
            entity.health = Mathf.clamp(entity.health, 0, entity.tile.block().health);
        }

        x += Mathf.sin(Timers.time() + id * 999, 25f, 0.07f);
        y += Mathf.cos(Timers.time() + id * 999, 25f, 0.07f);

        updateBuilding(this);
    }
Example 2
public void accept(Item item, short data){
        //if(!accepts()) return;
        buffer[index++] = Bits.packLong(NumberUtils.floatToIntBits(Timers.time()), Bits.packInt((short) item.id, data));
    }
Example 3
public void draw(Tile tile){
        super.draw(tile);

        GeneratorEntity entity = tile.entity();

        if(entity.generateTime > 0){
            Draw.color(heatColor);
            float alpha = (entity.items.total() > 0 ? 1f : Mathf.clamp(entity.generateTime));
            alpha = alpha * 0.7f + Mathf.absin(Timers.time(), 12f, 0.3f) * alpha;
            Draw.alpha(alpha);
            Draw.rect(topRegion, tile.drawx(), tile.drawy());
            Draw.reset();
        }
    }
Example 4
public void handleItem(Item item, Tile tile, Tile source){
        JunctionEntity entity = tile.entity();
        boolean x = tile.x == source.x;
        long value = Bits.packLong(NumberUtils.floatToIntBits(Timers.time()), Bits.packInt((short) item.id, source.relativeTo(tile.x, tile.y)));
        if(x){
            entity.bx.add(value);
        }else{
            entity.by.add(value);
        }
    }
Example 5
public void draw(Tile tile){
        ConveyorEntity entity = tile.entity();
        byte rotation = tile.getRotation();

        int frame = entity.clogHeat <= 0.5f ? (int) ((Timers.time() / 4f) % 4) : 0;
        Draw.rect(regions[entity.blendbits][frame], tile.drawx(), tile.drawy(),
            tilesize * entity.blendsclx, tilesize * entity.blendscly, rotation*90);
    }