Removed "on" prefix from all remote methods

This commit is contained in:
Anuken
2020-07-03 18:48:31 -04:00
parent 7ff2e98420
commit 8576d535bd
22 changed files with 108 additions and 84 deletions

View File

@@ -641,19 +641,19 @@ public class Tile implements Position, QuadTreeObject, Displayable{
}
@Remote(called = Loc.server, unreliable = true)
public static void onTileDamage(Tile tile, float health){
if(tile.build != null){
tile.build.health = health;
public static void tileDamage(Building build, float health){
if(build == null) return;
if(tile.build.damaged()){
indexer.notifyTileDamaged(tile.build);
}
build.health = health;
if(build.damaged()){
indexer.notifyTileDamaged(build);
}
}
@Remote(called = Loc.server)
public static void onTileDestroyed(Tile tile){
if(tile.build == null) return;
tile.build.killed();
public static void tileDestroyed(Building build){
if(build == null) return;
build.killed();
}
}

View File

@@ -48,7 +48,7 @@ public class BuildBlock extends Block{
}
@Remote(called = Loc.server)
public static void onDeconstructFinish(Tile tile, Block block, int builderID){
public static void deconstructFinish(Tile tile, Block block, int builderID){
Team team = tile.team();
Fx.breakBlock.at(tile.drawx(), tile.drawy(), block.size);
Events.fire(new BlockBuildEndEvent(tile, Groups.unit.getByID(builderID), team, true));
@@ -57,7 +57,7 @@ public class BuildBlock extends Block{
}
@Remote(called = Loc.server)
public static void onConstructFinish(Tile tile, Block block, int builderID, byte rotation, Team team, boolean skipConfig){
public static void constructFinish(Tile tile, Block block, int builderID, byte rotation, Team team, boolean skipConfig){
if(tile == null) return;
float healthf = tile.build.healthf();
tile.setBlock(block, team, rotation);
@@ -96,7 +96,7 @@ public class BuildBlock extends Block{
}
public static void constructed(Tile tile, Block block, int builderID, byte rotation, Team team, boolean skipConfig){
Call.onConstructFinish(tile, block, builderID, rotation, team, skipConfig);
Call.constructFinish(tile, block, builderID, rotation, team, skipConfig);
tile.build.placed();
Events.fire(new BlockBuildEndEvent(tile, Groups.unit.getByID(builderID), team, false));
@@ -256,7 +256,7 @@ public class BuildBlock extends Block{
builderID = builder.id();
if(progress <= 0 || state.rules.infiniteResources){
Call.onDeconstructFinish(tile, this.cblock == null ? previous : this.cblock, builderID);
Call.deconstructFinish(tile, this.cblock == null ? previous : this.cblock, builderID);
}
}

View File

@@ -53,7 +53,7 @@ public class MassDriver extends Block{
@Override
public void drawPlace(int x, int y, int rotation, boolean valid){
Drawf.dashCircle(x * tilesize, y*tilesize, range, Pal.accent);
Drawf.dashCircle(x * tilesize, y * tilesize, range, Pal.accent);
//check if a mass driver is selected while placing this driver
if(!control.input.frag.config.isShown()) return;
@@ -64,7 +64,7 @@ public class MassDriver extends Block{
float sin = Mathf.absin(Time.time(), 6f, 1f);
Tmp.v1.set(x * tilesize + offset(), y * tilesize + offset()).sub(selected.x, selected.y).limit((size / 2f + 1) * tilesize + sin + 0.5f);
float x2 = x * tilesize - Tmp.v1.x, y2 = y * tilesize - Tmp.v1.y,
x1 = selected.x + Tmp.v1.x, y1 = selected.y + Tmp.v1.y;
x1 = selected.x + Tmp.v1.x, y1 = selected.y + Tmp.v1.y;
int segs = (int)(selected.dst(x * tilesize, y * tilesize) / tilesize);
Lines.stroke(4f, Pal.gray);

View File

@@ -53,7 +53,7 @@ public class CoreBlock extends StorageBlock{
}
@Remote(called = Loc.server)
public static void onPlayerSpawn(Tile tile, Player player){
public static void playerSpawn(Tile tile, Player player){
if(player == null || tile == null) return;
CoreEntity entity = tile.bc();
@@ -171,7 +171,7 @@ public class CoreBlock extends StorageBlock{
}
public void requestSpawn(Player player){
Call.onPlayerSpawn(tile, player);
Call.playerSpawn(tile, player);
}
@Override

View File

@@ -25,7 +25,7 @@ public class UnitBlock extends PayloadAcceptor{
}
@Remote(called = Loc.server)
public static void onUnitBlockSpawn(Tile tile){
public static void unitBlockSpawn(Tile tile){
if(!(tile.build instanceof UnitBlockEntity)) return;
tile.<UnitBlockEntity>bc().spawned();
}
@@ -55,7 +55,7 @@ public class UnitBlock extends PayloadAcceptor{
@Override
public void dumpPayload(){
Call.onUnitBlockSpawn(tile);
Call.unitBlockSpawn(tile);
}
}
}