Cached Block#offset()
This commit is contained in:
@@ -87,7 +87,7 @@ abstract class PayloadComp implements Posc, Rotc, Hitboxc{
|
||||
/** @return whether the tile has been successfully placed. */
|
||||
boolean dropBlock(BlockPayload payload){
|
||||
Building tile = payload.entity;
|
||||
int tx = Vars.world.toTile(x - tile.block().offset()), ty = Vars.world.toTile(y - tile.block().offset());
|
||||
int tx = Vars.world.toTile(x - tile.block().offset), ty = Vars.world.toTile(y - tile.block().offset);
|
||||
Tile on = Vars.world.tile(tx, ty);
|
||||
if(on != null && Build.validPlace(tile.block(), tile.team(), tx, ty, tile.rotation())){
|
||||
int rot = (int)((rotation + 45f) / 90f) % 4;
|
||||
|
||||
@@ -117,11 +117,11 @@ public class BuildPlan{
|
||||
}
|
||||
|
||||
public float drawx(){
|
||||
return x*tilesize + block.offset();
|
||||
return x*tilesize + block.offset;
|
||||
}
|
||||
|
||||
public float drawy(){
|
||||
return y*tilesize + block.offset();
|
||||
return y*tilesize + block.offset;
|
||||
}
|
||||
|
||||
public BuildPlan configure(Object config){
|
||||
|
||||
Reference in New Issue
Block a user