Compare commits

...
6 Commits
Author SHA1 Message Date
Anuken 9e0de644c4 more iOS fixes 2019-08-15 20:59:45 -04:00
Anuken 393bdfccaf iOS map export 2019-08-15 20:45:30 -04:00
Anuken 56c39799c8 things 2019-08-15 20:02:35 -04:00
Anuken 7f2a1374e4 Fixed truncated sounds 2019-08-15 14:16:41 -04:00
Anuken 6fa0ac56ac files 2019-08-15 13:33:23 -04:00
Anuken 89ee04c942 Machine ambient sounds 2019-08-15 13:32:36 -04:00
67 changed files with 256 additions and 135 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

+1
View File
@@ -514,6 +514,7 @@ setting.lasers.name = Show Power Lasers
setting.pixelate.name = Pixelate[lightgray] (disables animations)
setting.minimap.name = Show Minimap
setting.musicvol.name = Music Volume
setting.ambientvol.name = Ambient Volume
setting.mutemusic.name = Mute Music
setting.sfxvol.name = SFX Volume
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.
Executable → Regular
BIN
View File
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
Executable → Regular
BIN
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.
Executable → Regular
BIN
View File
Binary file not shown.
Executable → Regular
BIN
View 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.
Executable → Regular
BIN
View 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.
Executable → Regular
BIN
View File
Binary file not shown.
Executable → Regular
BIN
View File
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
-5
View File
@@ -132,11 +132,6 @@
fontColor: white,
up: info-banner
},
discord: {
font: default,
fontColor: white,
up: info-banner
},
clear-partial: {
down: whiteui,
up: pane,
+12
View File
@@ -0,0 +1,12 @@
#convert from stereo to mono
cd assets/sounds/
for i in *.ogg; do
echo $i
ffmpeg -i "$i" -ac 1 "OUT_$i"
done
find . -type f ! -name "OUT_*" -delete
for file in OUT_*; do mv "$file" "${file#OUT_}"; done;
cd ../../
+2
View File
@@ -133,6 +133,7 @@ public class Vars{
public static GlobalData data;
public static EntityCollisions collisions;
public static DefaultWaves defaultWaves;
public static LoopControl loops;
public static Control control;
public static Logic logic;
@@ -181,6 +182,7 @@ public class Vars{
content.setVerbose();
}
loops = new LoopControl();
defaultWaves = new DefaultWaves();
collisions = new EntityCollisions();
@@ -1608,8 +1608,8 @@ public class Blocks implements ContentList{
shootDuration = 220f;
powerUse = 14f;
shootSound = Sounds.laserbig;
idleSound = Sounds.beam;
idleSoundVolume = 2f;
activeSound = Sounds.beam;
activeSoundVolume = 2f;
health = 200 * size * size;
consumes.add(new ConsumeLiquidFilter(liquid -> liquid.temperature <= 0.5f && liquid.flammability < 0.1f, 0.5f)).update(false);
+2 -2
View File
@@ -734,7 +734,7 @@ public class Fx implements ContentList{
shootSmallFlame = new Effect(32f, e -> {
Draw.color(Pal.lightFlame, Pal.darkFlame, Color.GRAY, e.fin());
Angles.randLenVectors(e.id, 8, e.finpow() * 44f, e.rotation, 10f, (x, y) -> {
Angles.randLenVectors(e.id, 8, e.finpow() * 60f, e.rotation, 10f, (x, y) -> {
Fill.circle(e.x + x, e.y + y, 0.65f + e.fout() * 1.5f);
});
@@ -744,7 +744,7 @@ public class Fx implements ContentList{
shootPyraFlame = new Effect(33f, e -> {
Draw.color(Pal.lightPyraFlame, Pal.darkPyraFlame, Color.GRAY, e.fin());
Angles.randLenVectors(e.id, 10, e.finpow() * 50f, e.rotation, 10f, (x, y) -> {
Angles.randLenVectors(e.id, 10, e.finpow() * 70f, e.rotation, 10f, (x, y) -> {
Fill.circle(e.x + x, e.y + y, 0.65f + e.fout() * 1.6f);
});
@@ -196,7 +196,7 @@ public class UnitTypes implements ContentList{
mass = 5f;
hitsize = 20f;
rotatespeed = 0.06f;
health = 4000;
health = 3000;
weapon = new Weapon("chaos"){{
length = 8f;
reload = 50f;
@@ -220,7 +220,7 @@ public class UnitTypes implements ContentList{
mass = 5f;
hitsize = 20f;
rotatespeed = 0.06f;
health = 10000;
health = 9000;
weapon = new Weapon("eradication"){{
length = 13f;
reload = 30f;
@@ -313,7 +313,7 @@ public class UnitTypes implements ContentList{
}};
lich = new UnitType("lich", Revenant.class, Revenant::new){{
health = 7000;
health = 6000;
mass = 20f;
hitsize = 40f;
speed = 0.01f;
@@ -346,7 +346,7 @@ public class UnitTypes implements ContentList{
}};
reaper = new UnitType("reaper", Revenant.class, Revenant::new){{
health = 13000;
health = 11000;
mass = 30f;
hitsize = 56f;
speed = 0.01f;
@@ -392,6 +392,7 @@ public class Control implements ApplicationListener{
data.checkSave();
music.update();
loops.update();
if(!state.is(State.menu)){
input.update();
@@ -415,7 +416,7 @@ public class Control implements ApplicationListener{
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);
}
+14 -16
View File
@@ -1,30 +1,28 @@
package io.anuke.mindustry.core;
import io.anuke.arc.*;
import io.anuke.arc.files.FileHandle;
import io.anuke.arc.function.Consumer;
import io.anuke.arc.function.Predicate;
import io.anuke.arc.files.*;
import io.anuke.arc.function.*;
import io.anuke.arc.graphics.*;
import io.anuke.arc.graphics.g2d.*;
import io.anuke.arc.graphics.glutils.FrameBuffer;
import io.anuke.arc.math.Mathf;
import io.anuke.arc.math.geom.Rectangle;
import io.anuke.arc.math.geom.Vector2;
import io.anuke.arc.graphics.glutils.*;
import io.anuke.arc.math.*;
import io.anuke.arc.math.geom.*;
import io.anuke.arc.scene.ui.layout.*;
import io.anuke.arc.util.*;
import io.anuke.arc.util.pooling.Pools;
import io.anuke.mindustry.content.Fx;
import io.anuke.mindustry.core.GameState.State;
import io.anuke.arc.util.pooling.*;
import io.anuke.mindustry.content.*;
import io.anuke.mindustry.core.GameState.*;
import io.anuke.mindustry.entities.*;
import io.anuke.mindustry.entities.effect.GroundEffectEntity;
import io.anuke.mindustry.entities.effect.GroundEffectEntity.GroundEffect;
import io.anuke.mindustry.entities.impl.EffectEntity;
import io.anuke.mindustry.entities.effect.*;
import io.anuke.mindustry.entities.effect.GroundEffectEntity.*;
import io.anuke.mindustry.entities.impl.*;
import io.anuke.mindustry.entities.traits.*;
import io.anuke.mindustry.entities.type.*;
import io.anuke.mindustry.game.EventType.DisposeEvent;
import io.anuke.mindustry.game.Team;
import io.anuke.mindustry.game.EventType.*;
import io.anuke.mindustry.game.*;
import io.anuke.mindustry.graphics.*;
import io.anuke.mindustry.world.blocks.defense.ForceProjector.ShieldEntity;
import io.anuke.mindustry.world.blocks.defense.ForceProjector.*;
import static io.anuke.arc.Core.*;
import static io.anuke.mindustry.Vars.*;
@@ -87,7 +87,8 @@ public class MapEditorDialog extends Dialog implements Disposable{
t.row();
t.addImageTextButton("$editor.import", "icon-load-map", isize, () ->
if(!ios){
t.addImageTextButton("$editor.import", "icon-load-map", isize, () ->
createDialog("$editor.import",
"$editor.importmap", "$editor.importmap.description", "icon-load-map", (Runnable)loadDialog::show,
"$editor.importfile", "$editor.importfile.description", "icon-file", (Runnable)() ->
@@ -115,24 +116,43 @@ public class MapEditorDialog extends Dialog implements Disposable{
Log.err(e);
}
}), true, FileChooser.pngFiles))
);
);
}
t.addImageTextButton("$editor.export", "icon-save-map", isize, () ->
Platform.instance.showFileChooser("$editor.savemap", "Map Files", file -> {
file = file.parent().child(file.nameWithoutExtension() + "." + mapExtension);
FileHandle result = file;
Cell cell = t.addImageTextButton("$editor.export", "icon-save-map", isize, () -> {
if(!ios){
Platform.instance.showFileChooser("$editor.savemap", "Map Files", file -> {
file = file.parent().child(file.nameWithoutExtension() + "." + mapExtension);
FileHandle result = file;
ui.loadAnd(() -> {
try{
if(!editor.getTags().containsKey("name")){
editor.getTags().put("name", result.nameWithoutExtension());
}
MapIO.writeMap(result, editor.createMap(result));
}catch(Exception e){
ui.showError(Core.bundle.format("editor.errorsave", Strings.parseException(e, true)));
Log.err(e);
}
});
}, false, FileChooser.mapFiles);
}else{
ui.loadAnd(() -> {
try{
if(!editor.getTags().containsKey("name")){
editor.getTags().put("name", result.nameWithoutExtension());
}
FileHandle result = Core.files.local(editor.getTags().get("name", "unknown") + "." + mapExtension);
MapIO.writeMap(result, editor.createMap(result));
Platform.instance.shareFile(result);
}catch(Exception e){
ui.showError(Core.bundle.format("editor.errorsave", Strings.parseException(e, true)));
Log.err(e);
}
});
}, false, FileChooser.mapFiles));
}
});
if(ios){
cell.size(swidth * 2f + 10, 60f).colspan(2);
}
});
menu.cont.row();
@@ -20,8 +20,7 @@ import io.anuke.mindustry.world.modules.*;
import java.io.*;
import static io.anuke.mindustry.Vars.tileGroup;
import static io.anuke.mindustry.Vars.world;
import static io.anuke.mindustry.Vars.*;
public class TileEntity extends BaseEntity implements TargetTrait, HealthTrait{
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();
y = tile.drawy();
block = tile.block();
if(block.idleSound != Sounds.none){
sound = new SoundLoop(block.idleSound, block.idleSoundVolume);
if(block.activeSound != Sounds.none){
sound = new SoundLoop(block.activeSound, block.activeSoundVolume);
}
health = block.health;
@@ -298,7 +297,11 @@ public class TileEntity extends BaseEntity implements TargetTrait, HealthTrait{
}
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;
@@ -0,0 +1,61 @@
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);
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){
valid.visible(true);
}else{
displays.get((int)(time) % displays.size).visible(true);
if(displays.size > 0){
displays.get((int)(time) % displays.size).visible(true);
}
}
}
}
@@ -43,7 +43,7 @@ public class MapsDialog extends FloatingDialog{
void setup(){
buttons.clearChildren();
if(Core.graphics.isPortrait()){
if(Core.graphics.isPortrait() && !ios){
buttons.addImageTextButton("$back", "icon-arrow-left", iconsize, this::hide).size(210f*2f, 64f).colspan(2);
buttons.row();
}else{
@@ -60,54 +60,56 @@ public class MapsDialog extends FloatingDialog{
});
}).size(210f, 64f);
buttons.addImageTextButton("$editor.importmap", "icon-load", iconsize, () -> {
Platform.instance.showFileChooser("$editor.importmap", "Map File", file -> {
world.maps.tryCatchMapError(() -> {
if(MapIO.isImage(file)){
ui.showError("$editor.errorimage");
return;
}
if(!ios){
buttons.addImageTextButton("$editor.importmap", "icon-load", iconsize, () -> {
Platform.instance.showFileChooser("$editor.importmap", "Map File", file -> {
world.maps.tryCatchMapError(() -> {
if(MapIO.isImage(file)){
ui.showError("$editor.errorimage");
return;
}
Map map;
if(file.extension().equalsIgnoreCase(mapExtension)){
map = MapIO.createMap(file, true);
}else{
map = world.maps.makeLegacyMap(file);
}
Map map;
if(file.extension().equalsIgnoreCase(mapExtension)){
map = MapIO.createMap(file, true);
}else{
map = world.maps.makeLegacyMap(file);
}
//when you attempt to import a save, it will have no name, so generate one
String name = map.tags.getOr("name", () -> {
String result = "unknown";
int number = 0;
while(world.maps.byName(result + number++) != null);
return result + number;
});
//this will never actually get called, but it remains just in case
if(name == null){
ui.showError("$editor.errorname");
return;
}
Map conflict = world.maps.all().find(m -> m.name().equals(name));
if(conflict != null && !conflict.custom){
ui.showInfo(Core.bundle.format("editor.import.exists", name));
}else if(conflict != null){
ui.showConfirm("$confirm", "$editor.overwrite.confirm", () -> {
world.maps.tryCatchMapError(() -> {
world.maps.importMap(file);
setup();
});
//when you attempt to import a save, it will have no name, so generate one
String name = map.tags.getOr("name", () -> {
String result = "unknown";
int number = 0;
while(world.maps.byName(result + number++) != null) ;
return result + number;
});
}else{
world.maps.importMap(map.file);
setup();
}
});
}, true, FileChooser.anyMapFiles);
}).size(210f, 64f);
//this will never actually get called, but it remains just in case
if(name == null){
ui.showError("$editor.errorname");
return;
}
Map conflict = world.maps.all().find(m -> m.name().equals(name));
if(conflict != null && !conflict.custom){
ui.showInfo(Core.bundle.format("editor.import.exists", name));
}else if(conflict != null){
ui.showConfirm("$confirm", "$editor.overwrite.confirm", () -> {
world.maps.tryCatchMapError(() -> {
world.maps.importMap(file);
setup();
});
});
}else{
world.maps.importMap(map.file);
setup();
}
});
}, true, FileChooser.anyMapFiles);
}).size(210f, 64f);
}
cont.clear();
@@ -126,6 +126,7 @@ public class SettingsMenuDialog extends SettingsDialog{
void addSettings(){
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("ambientvol", bundle.get("setting.ambientvol.name", "Ambient Volume"), 100, 0, 100, 1, i -> i + "%");
game.screenshakePref();
if(mobile){
+12 -1
View File
@@ -101,7 +101,13 @@ public class Block extends BlockStorage{
public boolean hasShadow = true;
/** Sounds made when this block breaks.*/
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;
/** Idle sound base volume. */
public float idleSoundVolume = 0.5f;
@@ -212,6 +218,11 @@ public class Block extends BlockStorage{
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.*/
public boolean shouldIdleSound(Tile tile){
return canProduce(tile);
@@ -105,7 +105,7 @@ public class LaserTurret extends PowerTurret{
}
@Override
public boolean shouldIdleSound(Tile tile){
public boolean shouldActiveSound(Tile tile){
LaserTurretEntity entity = tile.entity();
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.effect.*;
import io.anuke.mindustry.entities.type.*;
import io.anuke.mindustry.gen.*;
import io.anuke.mindustry.type.*;
import io.anuke.mindustry.world.*;
import io.anuke.mindustry.world.consumers.*;
@@ -19,6 +20,7 @@ public abstract class LiquidTurret extends Turret{
public LiquidTurret(String name){
super(name);
hasLiquids = true;
activeSound = Sounds.spray;
}
/** 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
protected boolean validateTarget(Tile tile){
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.smokeEffect, entity.liquids.current().color, tile.drawx() + tr.x, tile.drawy() + tr.y, entity.rotation);
shootSound.at(tile);
//shootSound.at(tile);
if(shootShake > 0){
Effects.shake(shootShake, shootShake, tile.entity);
@@ -1,19 +1,17 @@
package io.anuke.mindustry.world.blocks.distribution;
import io.anuke.arc.Core;
import io.anuke.arc.collection.LongArray;
import io.anuke.arc.graphics.g2d.Draw;
import io.anuke.arc.graphics.g2d.TextureRegion;
import io.anuke.arc.math.Mathf;
import io.anuke.arc.*;
import io.anuke.arc.collection.*;
import io.anuke.arc.graphics.g2d.*;
import io.anuke.arc.math.*;
import io.anuke.arc.math.geom.*;
import io.anuke.arc.util.*;
import io.anuke.mindustry.entities.type.TileEntity;
import io.anuke.mindustry.entities.type.Unit;
import io.anuke.mindustry.graphics.Layer;
import io.anuke.mindustry.input.InputHandler.PlaceDraw;
import io.anuke.mindustry.type.Item;
import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.Tile;
import io.anuke.mindustry.entities.type.*;
import io.anuke.mindustry.gen.*;
import io.anuke.mindustry.graphics.*;
import io.anuke.mindustry.input.InputHandler.*;
import io.anuke.mindustry.type.*;
import io.anuke.mindustry.world.*;
import io.anuke.mindustry.world.meta.*;
import java.io.*;
@@ -41,6 +39,9 @@ public class Conveyor extends Block{
group = BlockGroup.transportation;
hasItems = true;
itemCapacity = 4;
idleSound = Sounds.conveyor;
idleSoundVolume = 0.004f;
}
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);
}
@Override
public boolean shouldIdleSound(Tile tile){
ConveyorEntity entity = tile.entity();
return entity.clogHeat <= 0.5f ;
}
@Override
public void onProximityUpdate(Tile tile){
super.onProximityUpdate(tile);
@@ -10,6 +10,7 @@ import io.anuke.mindustry.content.*;
import io.anuke.mindustry.entities.*;
import io.anuke.mindustry.entities.Effects.*;
import io.anuke.mindustry.entities.type.*;
import io.anuke.mindustry.gen.*;
import io.anuke.mindustry.graphics.*;
import io.anuke.mindustry.type.*;
import io.anuke.mindustry.ui.*;
@@ -65,8 +66,8 @@ public class Drill extends Block{
liquidCapacity = 5f;
hasItems = true;
//idleSound = Sounds.drill;
//idleSoundVolume = 0.5f;
idleSound = Sounds.drill;
idleSoundVolume = 0.004f;
}
@Override
@@ -1,21 +1,18 @@
package io.anuke.mindustry.world.blocks.production;
import io.anuke.arc.function.Consumer;
import io.anuke.arc.function.Supplier;
import io.anuke.arc.graphics.g2d.TextureRegion;
import io.anuke.arc.math.Mathf;
import io.anuke.arc.util.Time;
import io.anuke.mindustry.content.Fx;
import io.anuke.mindustry.entities.Effects;
import io.anuke.mindustry.entities.Effects.Effect;
import io.anuke.mindustry.entities.type.TileEntity;
import io.anuke.arc.function.*;
import io.anuke.arc.graphics.g2d.*;
import io.anuke.arc.math.*;
import io.anuke.arc.util.*;
import io.anuke.mindustry.content.*;
import io.anuke.mindustry.entities.*;
import io.anuke.mindustry.entities.Effects.*;
import io.anuke.mindustry.entities.type.*;
import io.anuke.mindustry.gen.*;
import io.anuke.mindustry.type.*;
import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.Tile;
import io.anuke.mindustry.world.consumers.ConsumeLiquidBase;
import io.anuke.mindustry.world.consumers.ConsumeType;
import io.anuke.mindustry.world.meta.BlockStat;
import io.anuke.mindustry.world.meta.StatUnit;
import io.anuke.mindustry.world.*;
import io.anuke.mindustry.world.consumers.*;
import io.anuke.mindustry.world.meta.*;
import java.io.*;
@@ -37,6 +34,8 @@ public class GenericCrafter extends Block{
solid = true;
hasItems = true;
health = 60;
idleSound = Sounds.machine;
idleSoundVolume = 0.03f;
}
@Override
@@ -58,6 +57,11 @@ public class GenericCrafter extends Block{
}
}
@Override
public boolean shouldIdleSound(Tile tile){
return tile.entity.cons.valid();
}
@Override
public void init(){
outputsLiquid = outputLiquid != null;
@@ -30,8 +30,8 @@ public class CoreBlock extends StorageBlock{
update = true;
hasItems = true;
flags = EnumSet.of(BlockFlag.target, BlockFlag.producer);
idleSound = Sounds.respawning;
idleSoundVolume = 1f;
activeSound = Sounds.respawning;
activeSoundVolume = 1f;
}
@Remote(called = Loc.server)
@@ -156,7 +156,7 @@ public class CoreBlock extends StorageBlock{
}
@Override
public boolean shouldIdleSound(Tile tile){
public boolean shouldActiveSound(Tile tile){
CoreEntity entity = tile.entity();
return entity.spawnPlayer != null;
+1 -5
View File
@@ -1,5 +1 @@
@Echo Off
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
java -jar server.jar