Bugfixes
This commit is contained in:
@@ -47,6 +47,7 @@ public class GlobalData{
|
|||||||
|
|
||||||
try(OutputStream fos = file.write(false, 2048); ZipOutputStream zos = new ZipOutputStream(fos)){
|
try(OutputStream fos = file.write(false, 2048); ZipOutputStream zos = new ZipOutputStream(fos)){
|
||||||
for(FileHandle add : files){
|
for(FileHandle add : files){
|
||||||
|
if(add.isDirectory()) continue;
|
||||||
zos.putNextEntry(new ZipEntry(add.path().substring(base.length())));
|
zos.putNextEntry(new ZipEntry(add.path().substring(base.length())));
|
||||||
Streams.copyStream(add.read(), zos);
|
Streams.copyStream(add.read(), zos);
|
||||||
zos.closeEntry();
|
zos.closeEntry();
|
||||||
|
|||||||
@@ -28,10 +28,8 @@ public class MusicControl{
|
|||||||
private boolean silenced;
|
private boolean silenced;
|
||||||
|
|
||||||
public MusicControl(){
|
public MusicControl(){
|
||||||
Events.on(ClientLoadEvent.class, e -> {
|
Events.on(ClientLoadEvent.class, e -> reload());
|
||||||
ambientMusic = Array.with(Musics.game1, Musics.game3, Musics.game4, Musics.game6);
|
Events.on(ContentReloadEvent.class, e -> reload());
|
||||||
darkMusic = Array.with(Musics.game2, Musics.game5, Musics.game7);
|
|
||||||
});
|
|
||||||
|
|
||||||
//only run music 10 seconds after a wave spawns
|
//only run music 10 seconds after a wave spawns
|
||||||
Events.on(WaveEvent.class, e -> Time.run(60f * 10f, () -> {
|
Events.on(WaveEvent.class, e -> Time.run(60f * 10f, () -> {
|
||||||
@@ -41,6 +39,13 @@ public class MusicControl{
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void reload(){
|
||||||
|
current = null;
|
||||||
|
fade = 0f;
|
||||||
|
ambientMusic = Array.with(Musics.game1, Musics.game3, Musics.game4, Musics.game6);
|
||||||
|
darkMusic = Array.with(Musics.game2, Musics.game5, Musics.game7);
|
||||||
|
}
|
||||||
|
|
||||||
/** Update and play the right music track.*/
|
/** Update and play the right music track.*/
|
||||||
public void update(){
|
public void update(){
|
||||||
if(state.is(State.menu)){
|
if(state.is(State.menu)){
|
||||||
|
|||||||
@@ -12,12 +12,12 @@ import io.anuke.mindustry.entities.*;
|
|||||||
import io.anuke.mindustry.entities.effect.*;
|
import io.anuke.mindustry.entities.effect.*;
|
||||||
import io.anuke.mindustry.entities.traits.BuilderTrait.*;
|
import io.anuke.mindustry.entities.traits.BuilderTrait.*;
|
||||||
import io.anuke.mindustry.entities.type.*;
|
import io.anuke.mindustry.entities.type.*;
|
||||||
import io.anuke.mindustry.game.*;
|
|
||||||
import io.anuke.mindustry.game.EventType.*;
|
import io.anuke.mindustry.game.EventType.*;
|
||||||
|
import io.anuke.mindustry.game.*;
|
||||||
import io.anuke.mindustry.gen.*;
|
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.Cicon;
|
import io.anuke.mindustry.ui.*;
|
||||||
import io.anuke.mindustry.world.*;
|
import io.anuke.mindustry.world.*;
|
||||||
import io.anuke.mindustry.world.modules.*;
|
import io.anuke.mindustry.world.modules.*;
|
||||||
|
|
||||||
@@ -64,15 +64,19 @@ public class BuildBlock extends Block{
|
|||||||
if(tile.entity != null){
|
if(tile.entity != null){
|
||||||
tile.entity.health = block.health * healthf;
|
tile.entity.health = block.health * healthf;
|
||||||
}
|
}
|
||||||
Effects.effect(Fx.placeBlock, tile.drawx(), tile.drawy(), block.size);
|
|
||||||
tile.block().placed(tile);
|
|
||||||
|
|
||||||
//last builder was this local client player, call placed()
|
//last builder was this local client player, call placed()
|
||||||
if(!headless && builderID == player.id){
|
if(!headless && builderID == player.id){
|
||||||
if(!skipConfig){
|
if(!skipConfig){
|
||||||
tile.block().playerPlaced(tile);
|
tile.block().playerPlaced(tile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Effects.effect(Fx.placeBlock, tile.drawx(), tile.drawy(), block.size);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void constructed(Tile tile, Block block, int builderID, byte rotation, Team team, boolean skipConfig){
|
||||||
|
Call.onConstructFinish(tile, block, builderID, rotation, team, skipConfig);
|
||||||
|
tile.block().placed(tile);
|
||||||
|
|
||||||
Events.fire(new BlockBuildEndEvent(tile, playerGroup.getByID(builderID), team, false));
|
Events.fire(new BlockBuildEndEvent(tile, playerGroup.getByID(builderID), team, false));
|
||||||
Sounds.place.at(tile, Mathf.random(0.7f, 1.4f));
|
Sounds.place.at(tile, Mathf.random(0.7f, 1.4f));
|
||||||
}
|
}
|
||||||
@@ -209,7 +213,7 @@ public class BuildBlock extends Block{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(progress >= 1f || state.rules.infiniteResources){
|
if(progress >= 1f || state.rules.infiniteResources){
|
||||||
Call.onConstructFinish(tile, cblock, builderID, tile.rotation(), builder.getTeam(), configured);
|
constructed(tile, cblock, builderID, tile.rotation(), builder.getTeam(), configured);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user