mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-01-10 23:28:52 +07:00
Added remote tile set/remove methods
This commit is contained in:
parent
4aa4e15de5
commit
d6dec002c1
@ -1,10 +1,11 @@
|
||||
package mindustry.world;
|
||||
|
||||
import arc.struct.*;
|
||||
import arc.func.*;
|
||||
import arc.math.*;
|
||||
import arc.math.geom.*;
|
||||
import arc.struct.*;
|
||||
import arc.util.ArcAnnotate.*;
|
||||
import mindustry.annotations.Annotations.*;
|
||||
import mindustry.content.*;
|
||||
import mindustry.entities.traits.*;
|
||||
import mindustry.entities.type.*;
|
||||
@ -215,6 +216,16 @@ public class Tile implements Position, TargetTrait{
|
||||
}
|
||||
}
|
||||
|
||||
/** remove()-s this tile, except it's synced across the network */
|
||||
public void removeNet(){
|
||||
Call.removeTile(this);
|
||||
}
|
||||
|
||||
/** set()-s this tile, except it's synced across the network */
|
||||
public void setNet(Block block, Team team, int rotation){
|
||||
Call.setTile(this, block, team, rotation);
|
||||
}
|
||||
|
||||
public byte rotation(){
|
||||
return rotation;
|
||||
}
|
||||
@ -506,4 +517,16 @@ public class Tile implements Position, TargetTrait{
|
||||
public String toString(){
|
||||
return floor.name + ":" + block.name + ":" + overlay + "[" + x + "," + y + "] " + "entity=" + (entity == null ? "null" : (entity.getClass())) + ":" + getTeam();
|
||||
}
|
||||
|
||||
//remote utility methods
|
||||
|
||||
@Remote(called = Loc.server)
|
||||
public static void removeTile(Tile tile){
|
||||
tile.remove();
|
||||
}
|
||||
|
||||
@Remote(called = Loc.server)
|
||||
public static void setTile(Tile tile, Block block, Team team, int rotation){
|
||||
tile.set(block, team, rotation);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user