mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-03-13 19:39:04 +07:00
Cleanup
This commit is contained in:
parent
7dfd20d020
commit
7b7e803011
@ -25,6 +25,7 @@ import mindustry.maps.Map;
|
||||
import mindustry.type.*;
|
||||
import mindustry.ui.dialogs.*;
|
||||
import mindustry.world.*;
|
||||
import mindustry.world.blocks.storage.CoreBlock.*;
|
||||
|
||||
import java.io.*;
|
||||
import java.text.*;
|
||||
@ -241,7 +242,7 @@ public class Control implements ApplicationListener, Loadable{
|
||||
}
|
||||
|
||||
//TODO move
|
||||
public void handleLaunch(Tilec tile){
|
||||
public void handleLaunch(CoreEntity tile){
|
||||
LaunchCorec ent = LaunchCoreEntity.create();
|
||||
ent.set(tile);
|
||||
ent.block(Blocks.coreShard);
|
||||
@ -249,7 +250,7 @@ public class Control implements ApplicationListener, Loadable{
|
||||
ent.add();
|
||||
|
||||
//remove launch requirements from core
|
||||
player.team().core().items.remove(player.team().core().block.requirements);
|
||||
tile.items.remove(tile.block.requirements);
|
||||
}
|
||||
|
||||
public void playSector(Sector sector){
|
||||
|
@ -36,7 +36,7 @@ public class Schematic implements Publishable, Comparable<Schematic>{
|
||||
if(t.block.buildVisibility == BuildVisibility.hidden) return;
|
||||
|
||||
for(ItemStack stack : t.block.requirements){
|
||||
amounts.inc(stack.item.id, stack.amount);
|
||||
amounts.increment(stack.item.id, stack.amount);
|
||||
}
|
||||
});
|
||||
Seq<ItemStack> stacks = new Seq<>();
|
||||
|
@ -31,7 +31,7 @@ public class Tutorial{
|
||||
public Tutorial(){
|
||||
Events.on(BlockBuildEndEvent.class, event -> {
|
||||
if(!event.breaking){
|
||||
blocksPlaced.getAndIncrement(event.tile.block(), 0, 1);
|
||||
blocksPlaced.increment(event.tile.block(), 1);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -22,6 +22,8 @@ import mindustry.graphics.g3d.PlanetRenderer.*;
|
||||
import mindustry.type.*;
|
||||
import mindustry.type.Sector.*;
|
||||
import mindustry.ui.*;
|
||||
import mindustry.world.blocks.storage.*;
|
||||
import mindustry.world.blocks.storage.CoreBlock.*;
|
||||
|
||||
import static mindustry.Vars.*;
|
||||
import static mindustry.graphics.g3d.PlanetRenderer.*;
|
||||
@ -35,7 +37,7 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
|
||||
private int launchRange;
|
||||
private float zoom = 1f, selectAlpha = 1f;
|
||||
private @Nullable Sector selected, hovered, launchSector;
|
||||
private Tilec launcher;
|
||||
private CoreEntity launcher;
|
||||
private Mode mode = look;
|
||||
|
||||
public PlanetDialog(){
|
||||
@ -97,7 +99,7 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
|
||||
return super.show();
|
||||
}
|
||||
|
||||
public void show(Sector sector, int range, Tilec launcher){
|
||||
public void show(Sector sector, CoreEntity launcher){
|
||||
this.launcher = launcher;
|
||||
selected = null;
|
||||
hovered = null;
|
||||
@ -107,7 +109,7 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
|
||||
zoom = 1f;
|
||||
planets.zoom = 2f;
|
||||
selectAlpha = 0f;
|
||||
launchRange = range;
|
||||
launchRange = ((CoreBlock)launcher.block).launchRange;
|
||||
launchSector = sector;
|
||||
|
||||
mode = launch;
|
||||
|
@ -24,7 +24,6 @@ import mindustry.net.Packets.*;
|
||||
import mindustry.type.*;
|
||||
import mindustry.ui.*;
|
||||
import mindustry.ui.dialogs.*;
|
||||
import mindustry.world.blocks.storage.*;
|
||||
|
||||
import static mindustry.Vars.*;
|
||||
|
||||
@ -365,9 +364,9 @@ public class HudFragment extends Fragment{
|
||||
t.bottom().visible(() -> state.isCampaign() && player.team().core() != null);
|
||||
|
||||
t.button("test launch", Icon.warning, () -> {
|
||||
ui.planet.show(state.getSector(), ((CoreBlock)player.team().core().block).launchRange, player.team().core());
|
||||
ui.planet.show(state.getSector(), player.team().core());
|
||||
}).width(150f)
|
||||
.disabled(!player.team().core().items.has(player.team().core().block.requirements)); //disable core when missing resources for launch
|
||||
.disabled(b -> player.team().core() == null || !player.team().core().items.has(player.team().core().block.requirements)); //disable core when missing resources for launch
|
||||
});
|
||||
|
||||
blockfrag.build(parent);
|
||||
|
@ -175,7 +175,7 @@ public class Drill extends Block{
|
||||
|
||||
for(Tile other : tile.getLinkedTilesAs(this, tempTiles)){
|
||||
if(canMine(other)){
|
||||
oreCount.getAndIncrement(getDrop(other), 0, 1);
|
||||
oreCount.increment(getDrop(other), 0, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,3 +1,3 @@
|
||||
org.gradle.daemon=true
|
||||
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
||||
archash=23b2fc721fa7ebb52e2edb0ce72b87731050e76e
|
||||
archash=639a3f2e3b5657c44b21f74a00ebf93be5892c12
|
||||
|
Loading…
Reference in New Issue
Block a user