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