Machine ambient sounds
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 5.5 KiB |
@@ -514,6 +514,7 @@ setting.lasers.name = Show Power Lasers
|
|||||||
setting.pixelate.name = Pixelate[lightgray] (disables animations)
|
setting.pixelate.name = Pixelate[lightgray] (disables animations)
|
||||||
setting.minimap.name = Show Minimap
|
setting.minimap.name = Show Minimap
|
||||||
setting.musicvol.name = Music Volume
|
setting.musicvol.name = Music Volume
|
||||||
|
setting.ambientvol.name = Ambient Volume
|
||||||
setting.mutemusic.name = Mute Music
|
setting.mutemusic.name = Mute Music
|
||||||
setting.sfxvol.name = SFX Volume
|
setting.sfxvol.name = SFX Volume
|
||||||
setting.mutesound.name = Mute Sound
|
setting.mutesound.name = Mute Sound
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
core/assets/sounds/drill.ogg
Executable file → Normal file
BIN
core/assets/sounds/drill.ogg
Executable file → Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -132,11 +132,6 @@
|
|||||||
fontColor: white,
|
fontColor: white,
|
||||||
up: info-banner
|
up: info-banner
|
||||||
},
|
},
|
||||||
discord: {
|
|
||||||
font: default,
|
|
||||||
fontColor: white,
|
|
||||||
up: info-banner
|
|
||||||
},
|
|
||||||
clear-partial: {
|
clear-partial: {
|
||||||
down: whiteui,
|
down: whiteui,
|
||||||
up: pane,
|
up: pane,
|
||||||
|
|||||||
@@ -133,6 +133,7 @@ public class Vars{
|
|||||||
public static GlobalData data;
|
public static GlobalData data;
|
||||||
public static EntityCollisions collisions;
|
public static EntityCollisions collisions;
|
||||||
public static DefaultWaves defaultWaves;
|
public static DefaultWaves defaultWaves;
|
||||||
|
public static LoopControl loops;
|
||||||
|
|
||||||
public static Control control;
|
public static Control control;
|
||||||
public static Logic logic;
|
public static Logic logic;
|
||||||
@@ -181,6 +182,7 @@ public class Vars{
|
|||||||
content.setVerbose();
|
content.setVerbose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
loops = new LoopControl();
|
||||||
defaultWaves = new DefaultWaves();
|
defaultWaves = new DefaultWaves();
|
||||||
collisions = new EntityCollisions();
|
collisions = new EntityCollisions();
|
||||||
|
|
||||||
|
|||||||
@@ -1608,8 +1608,8 @@ public class Blocks implements ContentList{
|
|||||||
shootDuration = 220f;
|
shootDuration = 220f;
|
||||||
powerUse = 14f;
|
powerUse = 14f;
|
||||||
shootSound = Sounds.laserbig;
|
shootSound = Sounds.laserbig;
|
||||||
idleSound = Sounds.beam;
|
activeSound = Sounds.beam;
|
||||||
idleSoundVolume = 2f;
|
activeSoundVolume = 2f;
|
||||||
|
|
||||||
health = 200 * size * size;
|
health = 200 * size * size;
|
||||||
consumes.add(new ConsumeLiquidFilter(liquid -> liquid.temperature <= 0.5f && liquid.flammability < 0.1f, 0.5f)).update(false);
|
consumes.add(new ConsumeLiquidFilter(liquid -> liquid.temperature <= 0.5f && liquid.flammability < 0.1f, 0.5f)).update(false);
|
||||||
|
|||||||
@@ -392,6 +392,7 @@ public class Control implements ApplicationListener{
|
|||||||
data.checkSave();
|
data.checkSave();
|
||||||
|
|
||||||
music.update();
|
music.update();
|
||||||
|
loops.update();
|
||||||
|
|
||||||
if(!state.is(State.menu)){
|
if(!state.is(State.menu)){
|
||||||
input.update();
|
input.update();
|
||||||
@@ -415,7 +416,7 @@ public class Control implements ApplicationListener{
|
|||||||
Platform.instance.updateRPC();
|
Platform.instance.updateRPC();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Core.input.keyTap(Binding.pause) && !ui.restart.isShown() && (state.is(State.paused) || state.is(State.playing))){
|
if(Core.input.keyTap(Binding.pause) && !scene.hasDialog() && !ui.restart.isShown() && (state.is(State.paused) || state.is(State.playing))){
|
||||||
state.set(state.is(State.playing) ? State.paused : State.playing);
|
state.set(state.is(State.playing) ? State.paused : State.playing);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,8 +20,7 @@ import io.anuke.mindustry.world.modules.*;
|
|||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
|
|
||||||
import static io.anuke.mindustry.Vars.tileGroup;
|
import static io.anuke.mindustry.Vars.*;
|
||||||
import static io.anuke.mindustry.Vars.world;
|
|
||||||
|
|
||||||
public class TileEntity extends BaseEntity implements TargetTrait, HealthTrait{
|
public class TileEntity extends BaseEntity implements TargetTrait, HealthTrait{
|
||||||
public static final float timeToSleep = 60f * 4; //4 seconds to fall asleep
|
public static final float timeToSleep = 60f * 4; //4 seconds to fall asleep
|
||||||
@@ -70,8 +69,8 @@ public class TileEntity extends BaseEntity implements TargetTrait, HealthTrait{
|
|||||||
x = tile.drawx();
|
x = tile.drawx();
|
||||||
y = tile.drawy();
|
y = tile.drawy();
|
||||||
block = tile.block();
|
block = tile.block();
|
||||||
if(block.idleSound != Sounds.none){
|
if(block.activeSound != Sounds.none){
|
||||||
sound = new SoundLoop(block.idleSound, block.idleSoundVolume);
|
sound = new SoundLoop(block.activeSound, block.activeSoundVolume);
|
||||||
}
|
}
|
||||||
|
|
||||||
health = block.health;
|
health = block.health;
|
||||||
@@ -298,7 +297,11 @@ public class TileEntity extends BaseEntity implements TargetTrait, HealthTrait{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(sound != null){
|
if(sound != null){
|
||||||
sound.update(x, y, block.shouldIdleSound(tile));
|
sound.update(x, y, block.shouldActiveSound(tile));
|
||||||
|
}
|
||||||
|
|
||||||
|
if(block.idleSound != Sounds.none && block.shouldIdleSound(tile)){
|
||||||
|
loops.play(block.idleSound, this, block.idleSoundVolume);
|
||||||
}
|
}
|
||||||
|
|
||||||
Block previous = block;
|
Block previous = block;
|
||||||
|
|||||||
63
core/src/io/anuke/mindustry/game/LoopControl.java
Normal file
63
core/src/io/anuke/mindustry/game/LoopControl.java
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
package io.anuke.mindustry.game;
|
||||||
|
|
||||||
|
import io.anuke.arc.*;
|
||||||
|
import io.anuke.arc.audio.*;
|
||||||
|
import io.anuke.arc.collection.*;
|
||||||
|
import io.anuke.arc.math.*;
|
||||||
|
import io.anuke.arc.math.geom.*;
|
||||||
|
import io.anuke.mindustry.*;
|
||||||
|
|
||||||
|
public class LoopControl{
|
||||||
|
private ObjectMap<Sound, SoundData> sounds = new ObjectMap<>();
|
||||||
|
|
||||||
|
public void play(Sound sound, Position pos, float volume){
|
||||||
|
if(Vars.headless) return;
|
||||||
|
|
||||||
|
float baseVol = sound.calcFalloff(pos.getX(), pos.getY());
|
||||||
|
float vol = baseVol * volume;
|
||||||
|
|
||||||
|
SoundData data = sounds.getOr(sound, SoundData::new);
|
||||||
|
data.volume += vol;
|
||||||
|
data.volume = Mathf.clamp(data.volume, 0f, 1f);
|
||||||
|
data.total += baseVol;
|
||||||
|
data.sum.add(pos.getX() * baseVol, pos.getY() * baseVol);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void update(){
|
||||||
|
float avol = Core.settings.getInt("ambientvol", 100) / 100f;
|
||||||
|
|
||||||
|
sounds.each((sound, data) -> {
|
||||||
|
data.curVolume = Mathf.lerpDelta(data.curVolume, data.volume * avol, 0.2f);
|
||||||
|
|
||||||
|
boolean play = data.curVolume > 0.01f;
|
||||||
|
float pan = Mathf.isZero(data.total, 0.0001f) ? 0f : sound.calcPan(data.sum.x / data.total, data.sum.y / data.total);
|
||||||
|
//Log.info(pan);
|
||||||
|
//TODO calc pan
|
||||||
|
if(data.soundID <= 0){
|
||||||
|
if(play){
|
||||||
|
data.soundID = sound.loop(data.curVolume, 1f, pan);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
if(data.curVolume <= 0.01f){
|
||||||
|
sound.stop(data.soundID);
|
||||||
|
data.soundID = -1;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
sound.setPan(data.soundID, pan, data.curVolume);
|
||||||
|
}
|
||||||
|
|
||||||
|
data.volume = 0f;
|
||||||
|
data.total = 0f;
|
||||||
|
data.sum.setZero();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private class SoundData{
|
||||||
|
float volume;
|
||||||
|
float total;
|
||||||
|
Vector2 sum = new Vector2();
|
||||||
|
|
||||||
|
int soundID;
|
||||||
|
float curVolume;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
package io.anuke.mindustry.game;
|
|
||||||
|
|
||||||
public class SoundControl{
|
|
||||||
}
|
|
||||||
@@ -25,7 +25,9 @@ public class MultiReqImage extends Stack{
|
|||||||
if(valid != null){
|
if(valid != null){
|
||||||
valid.visible(true);
|
valid.visible(true);
|
||||||
}else{
|
}else{
|
||||||
displays.get((int)(time) % displays.size).visible(true);
|
if(displays.size > 0){
|
||||||
|
displays.get((int)(time) % displays.size).visible(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -126,6 +126,7 @@ public class SettingsMenuDialog extends SettingsDialog{
|
|||||||
void addSettings(){
|
void addSettings(){
|
||||||
sound.sliderPref("musicvol", bundle.get("setting.musicvol.name", "Music Volume"), 100, 0, 100, 1, i -> i + "%");
|
sound.sliderPref("musicvol", bundle.get("setting.musicvol.name", "Music Volume"), 100, 0, 100, 1, i -> i + "%");
|
||||||
sound.sliderPref("sfxvol", bundle.get("setting.sfxvol.name", "SFX Volume"), 100, 0, 100, 1, i -> i + "%");
|
sound.sliderPref("sfxvol", bundle.get("setting.sfxvol.name", "SFX Volume"), 100, 0, 100, 1, i -> i + "%");
|
||||||
|
sound.sliderPref("ambientvol", bundle.get("setting.ambientvol.name", "Ambient Volume"), 100, 0, 100, 1, i -> i + "%");
|
||||||
|
|
||||||
game.screenshakePref();
|
game.screenshakePref();
|
||||||
if(mobile){
|
if(mobile){
|
||||||
|
|||||||
@@ -101,7 +101,13 @@ public class Block extends BlockStorage{
|
|||||||
public boolean hasShadow = true;
|
public boolean hasShadow = true;
|
||||||
/** Sounds made when this block breaks.*/
|
/** Sounds made when this block breaks.*/
|
||||||
public Sound breakSound = Sounds.boom;
|
public Sound breakSound = Sounds.boom;
|
||||||
/** The sound that this block makes while active.*/
|
|
||||||
|
/** The sound that this block makes while active. One sound loop. Do not overuse.*/
|
||||||
|
public Sound activeSound = Sounds.none;
|
||||||
|
/** Active sound base volume. */
|
||||||
|
public float activeSoundVolume = 0.5f;
|
||||||
|
|
||||||
|
/** The sound that this block makes while idle. Uses one sound loop for all blocks.*/
|
||||||
public Sound idleSound = Sounds.none;
|
public Sound idleSound = Sounds.none;
|
||||||
/** Idle sound base volume. */
|
/** Idle sound base volume. */
|
||||||
public float idleSoundVolume = 0.5f;
|
public float idleSoundVolume = 0.5f;
|
||||||
@@ -212,6 +218,11 @@ public class Block extends BlockStorage{
|
|||||||
return progressIncrease;
|
return progressIncrease;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @return whether this block should play its active sound.*/
|
||||||
|
public boolean shouldActiveSound(Tile tile){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/** @return whether this block should play its idle sound.*/
|
/** @return whether this block should play its idle sound.*/
|
||||||
public boolean shouldIdleSound(Tile tile){
|
public boolean shouldIdleSound(Tile tile){
|
||||||
return canProduce(tile);
|
return canProduce(tile);
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ public class LaserTurret extends PowerTurret{
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean shouldIdleSound(Tile tile){
|
public boolean shouldActiveSound(Tile tile){
|
||||||
LaserTurretEntity entity = tile.entity();
|
LaserTurretEntity entity = tile.entity();
|
||||||
|
|
||||||
return entity.bulletLife > 0 && entity.bullet != null;
|
return entity.bulletLife > 0 && entity.bullet != null;
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import io.anuke.mindustry.entities.*;
|
|||||||
import io.anuke.mindustry.entities.bullet.*;
|
import io.anuke.mindustry.entities.bullet.*;
|
||||||
import io.anuke.mindustry.entities.effect.*;
|
import io.anuke.mindustry.entities.effect.*;
|
||||||
import io.anuke.mindustry.entities.type.*;
|
import io.anuke.mindustry.entities.type.*;
|
||||||
|
import io.anuke.mindustry.gen.*;
|
||||||
import io.anuke.mindustry.type.*;
|
import io.anuke.mindustry.type.*;
|
||||||
import io.anuke.mindustry.world.*;
|
import io.anuke.mindustry.world.*;
|
||||||
import io.anuke.mindustry.world.consumers.*;
|
import io.anuke.mindustry.world.consumers.*;
|
||||||
@@ -19,6 +20,7 @@ public abstract class LiquidTurret extends Turret{
|
|||||||
public LiquidTurret(String name){
|
public LiquidTurret(String name){
|
||||||
super(name);
|
super(name);
|
||||||
hasLiquids = true;
|
hasLiquids = true;
|
||||||
|
activeSound = Sounds.spray;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Initializes accepted ammo map. Format: [liquid1, bullet1, liquid2, bullet2...] */
|
/** Initializes accepted ammo map. Format: [liquid1, bullet1, liquid2, bullet2...] */
|
||||||
@@ -44,6 +46,12 @@ public abstract class LiquidTurret extends Turret{
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldActiveSound(Tile tile){
|
||||||
|
TurretEntity entity = tile.entity();
|
||||||
|
return entity.target != null && hasAmmo(tile);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean validateTarget(Tile tile){
|
protected boolean validateTarget(Tile tile){
|
||||||
TurretEntity entity = tile.entity();
|
TurretEntity entity = tile.entity();
|
||||||
@@ -79,7 +87,7 @@ public abstract class LiquidTurret extends Turret{
|
|||||||
|
|
||||||
Effects.effect(type.shootEffect, entity.liquids.current().color, tile.drawx() + tr.x, tile.drawy() + tr.y, entity.rotation);
|
Effects.effect(type.shootEffect, entity.liquids.current().color, tile.drawx() + tr.x, tile.drawy() + tr.y, entity.rotation);
|
||||||
Effects.effect(type.smokeEffect, entity.liquids.current().color, tile.drawx() + tr.x, tile.drawy() + tr.y, entity.rotation);
|
Effects.effect(type.smokeEffect, entity.liquids.current().color, tile.drawx() + tr.x, tile.drawy() + tr.y, entity.rotation);
|
||||||
shootSound.at(tile);
|
//shootSound.at(tile);
|
||||||
|
|
||||||
if(shootShake > 0){
|
if(shootShake > 0){
|
||||||
Effects.shake(shootShake, shootShake, tile.entity);
|
Effects.shake(shootShake, shootShake, tile.entity);
|
||||||
|
|||||||
@@ -1,19 +1,17 @@
|
|||||||
package io.anuke.mindustry.world.blocks.distribution;
|
package io.anuke.mindustry.world.blocks.distribution;
|
||||||
|
|
||||||
import io.anuke.arc.Core;
|
import io.anuke.arc.*;
|
||||||
import io.anuke.arc.collection.LongArray;
|
import io.anuke.arc.collection.*;
|
||||||
import io.anuke.arc.graphics.g2d.Draw;
|
import io.anuke.arc.graphics.g2d.*;
|
||||||
import io.anuke.arc.graphics.g2d.TextureRegion;
|
import io.anuke.arc.math.*;
|
||||||
import io.anuke.arc.math.Mathf;
|
|
||||||
import io.anuke.arc.math.geom.*;
|
import io.anuke.arc.math.geom.*;
|
||||||
import io.anuke.arc.util.*;
|
import io.anuke.arc.util.*;
|
||||||
import io.anuke.mindustry.entities.type.TileEntity;
|
import io.anuke.mindustry.entities.type.*;
|
||||||
import io.anuke.mindustry.entities.type.Unit;
|
import io.anuke.mindustry.gen.*;
|
||||||
import io.anuke.mindustry.graphics.Layer;
|
import io.anuke.mindustry.graphics.*;
|
||||||
import io.anuke.mindustry.input.InputHandler.PlaceDraw;
|
import io.anuke.mindustry.input.InputHandler.*;
|
||||||
import io.anuke.mindustry.type.Item;
|
import io.anuke.mindustry.type.*;
|
||||||
import io.anuke.mindustry.world.Block;
|
import io.anuke.mindustry.world.*;
|
||||||
import io.anuke.mindustry.world.Tile;
|
|
||||||
import io.anuke.mindustry.world.meta.*;
|
import io.anuke.mindustry.world.meta.*;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
@@ -41,6 +39,9 @@ public class Conveyor extends Block{
|
|||||||
group = BlockGroup.transportation;
|
group = BlockGroup.transportation;
|
||||||
hasItems = true;
|
hasItems = true;
|
||||||
itemCapacity = 4;
|
itemCapacity = 4;
|
||||||
|
|
||||||
|
idleSound = Sounds.conveyor;
|
||||||
|
idleSoundVolume = 0.004f;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int compareItems(long a, long b){
|
private static int compareItems(long a, long b){
|
||||||
@@ -76,6 +77,12 @@ public class Conveyor extends Block{
|
|||||||
tilesize * entity.blendsclx, tilesize * entity.blendscly, rotation * 90);
|
tilesize * entity.blendsclx, tilesize * entity.blendscly, rotation * 90);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldIdleSound(Tile tile){
|
||||||
|
ConveyorEntity entity = tile.entity();
|
||||||
|
return entity.clogHeat <= 0.5f ;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onProximityUpdate(Tile tile){
|
public void onProximityUpdate(Tile tile){
|
||||||
super.onProximityUpdate(tile);
|
super.onProximityUpdate(tile);
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import io.anuke.mindustry.content.*;
|
|||||||
import io.anuke.mindustry.entities.*;
|
import io.anuke.mindustry.entities.*;
|
||||||
import io.anuke.mindustry.entities.Effects.*;
|
import io.anuke.mindustry.entities.Effects.*;
|
||||||
import io.anuke.mindustry.entities.type.*;
|
import io.anuke.mindustry.entities.type.*;
|
||||||
|
import io.anuke.mindustry.gen.*;
|
||||||
import io.anuke.mindustry.graphics.*;
|
import io.anuke.mindustry.graphics.*;
|
||||||
import io.anuke.mindustry.type.*;
|
import io.anuke.mindustry.type.*;
|
||||||
import io.anuke.mindustry.ui.*;
|
import io.anuke.mindustry.ui.*;
|
||||||
@@ -65,8 +66,8 @@ public class Drill extends Block{
|
|||||||
liquidCapacity = 5f;
|
liquidCapacity = 5f;
|
||||||
hasItems = true;
|
hasItems = true;
|
||||||
|
|
||||||
//idleSound = Sounds.drill;
|
idleSound = Sounds.drill;
|
||||||
//idleSoundVolume = 0.5f;
|
idleSoundVolume = 0.004f;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,21 +1,18 @@
|
|||||||
package io.anuke.mindustry.world.blocks.production;
|
package io.anuke.mindustry.world.blocks.production;
|
||||||
|
|
||||||
import io.anuke.arc.function.Consumer;
|
import io.anuke.arc.function.*;
|
||||||
import io.anuke.arc.function.Supplier;
|
import io.anuke.arc.graphics.g2d.*;
|
||||||
import io.anuke.arc.graphics.g2d.TextureRegion;
|
import io.anuke.arc.math.*;
|
||||||
import io.anuke.arc.math.Mathf;
|
import io.anuke.arc.util.*;
|
||||||
import io.anuke.arc.util.Time;
|
import io.anuke.mindustry.content.*;
|
||||||
import io.anuke.mindustry.content.Fx;
|
import io.anuke.mindustry.entities.*;
|
||||||
import io.anuke.mindustry.entities.Effects;
|
import io.anuke.mindustry.entities.Effects.*;
|
||||||
import io.anuke.mindustry.entities.Effects.Effect;
|
import io.anuke.mindustry.entities.type.*;
|
||||||
import io.anuke.mindustry.entities.type.TileEntity;
|
import io.anuke.mindustry.gen.*;
|
||||||
import io.anuke.mindustry.type.*;
|
import io.anuke.mindustry.type.*;
|
||||||
import io.anuke.mindustry.world.Block;
|
import io.anuke.mindustry.world.*;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.consumers.*;
|
||||||
import io.anuke.mindustry.world.consumers.ConsumeLiquidBase;
|
import io.anuke.mindustry.world.meta.*;
|
||||||
import io.anuke.mindustry.world.consumers.ConsumeType;
|
|
||||||
import io.anuke.mindustry.world.meta.BlockStat;
|
|
||||||
import io.anuke.mindustry.world.meta.StatUnit;
|
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
|
|
||||||
@@ -37,6 +34,8 @@ public class GenericCrafter extends Block{
|
|||||||
solid = true;
|
solid = true;
|
||||||
hasItems = true;
|
hasItems = true;
|
||||||
health = 60;
|
health = 60;
|
||||||
|
idleSound = Sounds.machine;
|
||||||
|
idleSoundVolume = 0.03f;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -58,6 +57,11 @@ public class GenericCrafter extends Block{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldIdleSound(Tile tile){
|
||||||
|
return tile.entity.cons.valid();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(){
|
public void init(){
|
||||||
outputsLiquid = outputLiquid != null;
|
outputsLiquid = outputLiquid != null;
|
||||||
|
|||||||
@@ -30,8 +30,8 @@ public class CoreBlock extends StorageBlock{
|
|||||||
update = true;
|
update = true;
|
||||||
hasItems = true;
|
hasItems = true;
|
||||||
flags = EnumSet.of(BlockFlag.target, BlockFlag.producer);
|
flags = EnumSet.of(BlockFlag.target, BlockFlag.producer);
|
||||||
idleSound = Sounds.respawning;
|
activeSound = Sounds.respawning;
|
||||||
idleSoundVolume = 1f;
|
activeSoundVolume = 1f;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Remote(called = Loc.server)
|
@Remote(called = Loc.server)
|
||||||
@@ -156,7 +156,7 @@ public class CoreBlock extends StorageBlock{
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean shouldIdleSound(Tile tile){
|
public boolean shouldActiveSound(Tile tile){
|
||||||
CoreEntity entity = tile.entity();
|
CoreEntity entity = tile.entity();
|
||||||
|
|
||||||
return entity.spawnPlayer != null;
|
return entity.spawnPlayer != null;
|
||||||
|
|||||||
@@ -1,5 +1 @@
|
|||||||
@Echo Off
|
java -jar server.jar
|
||||||
Set "JV="
|
|
||||||
For /F "Tokens=3" %%A In ('java -version 2^>^&1') Do If Not Defined JV Set "JV=%%~A"
|
|
||||||
If /I "%JV%"=="not" (Echo Java is not installed, this server requires Java to run.) Else (start java -jar server.jar)
|
|
||||||
Pause
|
|
||||||
Reference in New Issue
Block a user