Fixed power nodes in multiplayer
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 5.5 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 575 KiB After Width: | Height: | Size: 575 KiB |
@@ -132,6 +132,11 @@
|
|||||||
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,
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ public class MenuFragment extends Fragment{
|
|||||||
//info icon
|
//info icon
|
||||||
if(mobile){
|
if(mobile){
|
||||||
parent.fill(c -> c.bottom().left().addButton("", "info", ui.about::show).size(84, 45));
|
parent.fill(c -> c.bottom().left().addButton("", "info", ui.about::show).size(84, 45));
|
||||||
|
parent.fill(c -> c.bottom().right().addButton("", "discord", ui.discord::show).size(84, 45));
|
||||||
}
|
}
|
||||||
|
|
||||||
String versionText = "[#ffffffba]" + ((Version.build == -1) ? "[#fc8140aa]custom build" : Version.modifier + " build " + Version.build);
|
String versionText = "[#ffffffba]" + ((Version.build == -1) ? "[#fc8140aa]custom build" : Version.modifier + " build " + Version.build);
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ 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.input.InputHandler.*;
|
import io.anuke.mindustry.input.InputHandler.*;
|
||||||
|
import io.anuke.mindustry.net.Net;
|
||||||
import io.anuke.mindustry.type.*;
|
import io.anuke.mindustry.type.*;
|
||||||
import io.anuke.mindustry.ui.*;
|
import io.anuke.mindustry.ui.*;
|
||||||
import io.anuke.mindustry.world.blocks.*;
|
import io.anuke.mindustry.world.blocks.*;
|
||||||
@@ -282,6 +283,15 @@ public class Block extends BlockStorage{
|
|||||||
/** Called after the block is placed by this client. */
|
/** Called after the block is placed by this client. */
|
||||||
@CallSuper
|
@CallSuper
|
||||||
public void playerPlaced(Tile tile){
|
public void playerPlaced(Tile tile){
|
||||||
|
if(outputsPower && !consumesPower){
|
||||||
|
PowerNode.lastPlaced = tile.pos();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Called after the block is placed by anyone. */
|
||||||
|
@CallSuper
|
||||||
|
public void placed(Tile tile){
|
||||||
|
if(Net.client()) return;
|
||||||
|
|
||||||
if((consumesPower && !outputsPower) || (!consumesPower && outputsPower)){
|
if((consumesPower && !outputsPower) || (!consumesPower && outputsPower)){
|
||||||
int range = 10;
|
int range = 10;
|
||||||
@@ -298,19 +308,11 @@ public class Block extends BlockStorage{
|
|||||||
Call.linkPowerNodes(null, tempTiles.first(), tile);
|
Call.linkPowerNodes(null, tempTiles.first(), tile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(outputsPower && !consumesPower){
|
|
||||||
PowerNode.lastPlaced = tile.pos();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removed(Tile tile){
|
public void removed(Tile tile){
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Called after the block is placed by anyone. */
|
|
||||||
public void placed(Tile tile){
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Called every frame a unit is on this tile. */
|
/** Called every frame a unit is on this tile. */
|
||||||
public void unitOn(Tile tile, Unit unit){
|
public void unitOn(Tile tile, Unit unit){
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import io.anuke.arc.util.*;
|
|||||||
import io.anuke.mindustry.entities.type.*;
|
import io.anuke.mindustry.entities.type.*;
|
||||||
import io.anuke.mindustry.gen.*;
|
import io.anuke.mindustry.gen.*;
|
||||||
import io.anuke.mindustry.graphics.*;
|
import io.anuke.mindustry.graphics.*;
|
||||||
|
import io.anuke.mindustry.net.Net;
|
||||||
import io.anuke.mindustry.ui.*;
|
import io.anuke.mindustry.ui.*;
|
||||||
import io.anuke.mindustry.world.*;
|
import io.anuke.mindustry.world.*;
|
||||||
import io.anuke.mindustry.world.blocks.*;
|
import io.anuke.mindustry.world.blocks.*;
|
||||||
@@ -106,6 +107,14 @@ public class PowerNode extends PowerBlock{
|
|||||||
Call.linkPowerNodes(null, tile, before);
|
Call.linkPowerNodes(null, tile, before);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
lastPlaced = tile.pos();
|
||||||
|
super.playerPlaced(tile);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void placed(Tile tile){
|
||||||
|
if(Net.client()) return;
|
||||||
|
|
||||||
Predicate<Tile> valid = other -> other != null && other != tile && ((!other.block().outputsPower && other.block().consumesPower) || (other.block().outputsPower && !other.block().consumesPower)) && linkValid(tile, other)
|
Predicate<Tile> valid = other -> other != null && other != tile && ((!other.block().outputsPower && other.block().consumesPower) || (other.block().outputsPower && !other.block().consumesPower)) && linkValid(tile, other)
|
||||||
&& !other.entity.proximity().contains(tile) && other.entity.power.graph != tile.entity.power.graph;
|
&& !other.entity.proximity().contains(tile) && other.entity.power.graph != tile.entity.power.graph;
|
||||||
|
|
||||||
@@ -120,8 +129,7 @@ public class PowerNode extends PowerBlock{
|
|||||||
tempTiles.sort(Structs.comparingFloat(t -> t.dst2(tile)));
|
tempTiles.sort(Structs.comparingFloat(t -> t.dst2(tile)));
|
||||||
tempTiles.each(valid, other -> Call.linkPowerNodes(null, tile, other));
|
tempTiles.each(valid, other -> Call.linkPowerNodes(null, tile, other));
|
||||||
|
|
||||||
lastPlaced = tile.pos();
|
super.placed(tile);
|
||||||
super.playerPlaced(tile);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -29,11 +29,6 @@ public class ThermalGenerator extends PowerGenerator{
|
|||||||
drawPlaceText(Core.bundle.formatFloat("bar.efficiency", sumAttribute(Attribute.heat, x, y) * 100, 1), x, y, valid);
|
drawPlaceText(Core.bundle.formatFloat("bar.efficiency", sumAttribute(Attribute.heat, x, y) * 100, 1), x, y, valid);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void placed(Tile tile){
|
|
||||||
super.placed(tile);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onProximityAdded(Tile tile){
|
public void onProximityAdded(Tile tile){
|
||||||
super.onProximityAdded(tile);
|
super.onProximityAdded(tile);
|
||||||
|
|||||||
@@ -79,6 +79,7 @@ public class CoreBlock extends StorageBlock{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void placed(Tile tile){
|
public void placed(Tile tile){
|
||||||
|
super.placed(tile);
|
||||||
state.teams.get(tile.getTeam()).cores.add(tile);
|
state.teams.get(tile.getTeam()).cores.add(tile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import io.anuke.mindustry.entities.type.Player;
|
|||||||
import io.anuke.mindustry.game.*;
|
import io.anuke.mindustry.game.*;
|
||||||
import io.anuke.mindustry.game.EventType.GameOverEvent;
|
import io.anuke.mindustry.game.EventType.GameOverEvent;
|
||||||
import io.anuke.mindustry.gen.Call;
|
import io.anuke.mindustry.gen.Call;
|
||||||
import io.anuke.mindustry.io.*;
|
import io.anuke.mindustry.io.SaveIO;
|
||||||
import io.anuke.mindustry.maps.Map;
|
import io.anuke.mindustry.maps.Map;
|
||||||
import io.anuke.mindustry.maps.MapException;
|
import io.anuke.mindustry.maps.MapException;
|
||||||
import io.anuke.mindustry.net.Administration.PlayerInfo;
|
import io.anuke.mindustry.net.Administration.PlayerInfo;
|
||||||
|
|||||||
Reference in New Issue
Block a user