mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-24 22:57:50 +07:00
Bugfixes
This commit is contained in:
@ -321,7 +321,7 @@ public class BlockIndexer{
|
|||||||
int quadrantY = tile.y / quadrantSize;
|
int quadrantY = tile.y / quadrantSize;
|
||||||
itemSet.clear();
|
itemSet.clear();
|
||||||
|
|
||||||
Tile rounded = world.tile(Mathf.clamp(quadrantX * quadrantSize + quadrantSize / 2, 0, world.width() - 1), Mathf.clamp(quadrantY * quadrantSize + quadrantSize / 2, 0, world.height() - 1));
|
Tile rounded = world.rawTile(Mathf.clamp(quadrantX * quadrantSize + quadrantSize / 2, 0, world.width() - 1), Mathf.clamp(quadrantY * quadrantSize + quadrantSize / 2, 0, world.height() - 1));
|
||||||
|
|
||||||
//find all items that this quadrant contains
|
//find all items that this quadrant contains
|
||||||
for(int x = Math.max(0, rounded.x - quadrantSize / 2); x < rounded.x + quadrantSize / 2 && x < world.width(); x++){
|
for(int x = Math.max(0, rounded.x - quadrantSize / 2); x < rounded.x + quadrantSize / 2 && x < world.width(); x++){
|
||||||
|
@ -287,7 +287,7 @@ public class Control implements ApplicationListener, Loadable{
|
|||||||
|
|
||||||
public void playTutorial(){
|
public void playTutorial(){
|
||||||
//TODO implement
|
//TODO implement
|
||||||
ui.showInfo("death");
|
//ui.showInfo("death");
|
||||||
/*
|
/*
|
||||||
Zone zone = Zones.groundZero;
|
Zone zone = Zones.groundZero;
|
||||||
ui.loadAnd(() -> {
|
ui.loadAnd(() -> {
|
||||||
|
@ -100,8 +100,12 @@ public class MapIO{
|
|||||||
ver.region("preview_map", stream, counter, in -> ver.readMap(in, new WorldContext(){
|
ver.region("preview_map", stream, counter, in -> ver.readMap(in, new WorldContext(){
|
||||||
@Override public void resize(int width, int height){}
|
@Override public void resize(int width, int height){}
|
||||||
@Override public boolean isGenerating(){return false;}
|
@Override public boolean isGenerating(){return false;}
|
||||||
@Override public void begin(){}
|
@Override public void begin(){
|
||||||
@Override public void end(){}
|
world.setGenerating(true);
|
||||||
|
}
|
||||||
|
@Override public void end(){
|
||||||
|
world.setGenerating(false);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Tile tile(int index){
|
public Tile tile(int index){
|
||||||
|
@ -179,6 +179,7 @@ public class Block extends UnlockableContent{
|
|||||||
public Block(String name){
|
public Block(String name){
|
||||||
super(name);
|
super(name);
|
||||||
this.solid = false;
|
this.solid = false;
|
||||||
|
initEntity();
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO rename to draw() once class refactoring is done.
|
//TODO rename to draw() once class refactoring is done.
|
||||||
@ -507,25 +508,7 @@ public class Block extends UnlockableContent{
|
|||||||
Arrays.sort(requirements, Structs.comparingInt(i -> i.item.id));
|
Arrays.sort(requirements, Structs.comparingInt(i -> i.item.id));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
protected void initEntity(){
|
||||||
public void displayInfo(Table table){
|
|
||||||
ContentDisplay.displayBlock(table, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ContentType getContentType(){
|
|
||||||
return ContentType.block;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Called after all blocks are created. */
|
|
||||||
@Override
|
|
||||||
@CallSuper
|
|
||||||
public void init(){
|
|
||||||
//initialize default health based on size
|
|
||||||
if(health == -1){
|
|
||||||
health = size * size * 40;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(entityType == null){
|
if(entityType == null){
|
||||||
|
|
||||||
//attempt to find the first declared class and use it as the entity type
|
//attempt to find the first declared class and use it as the entity type
|
||||||
@ -563,6 +546,26 @@ public class Block extends UnlockableContent{
|
|||||||
entityType = TileEntity::create;
|
entityType = TileEntity::create;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void displayInfo(Table table){
|
||||||
|
ContentDisplay.displayBlock(table, this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ContentType getContentType(){
|
||||||
|
return ContentType.block;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Called after all blocks are created. */
|
||||||
|
@Override
|
||||||
|
@CallSuper
|
||||||
|
public void init(){
|
||||||
|
//initialize default health based on size
|
||||||
|
if(health == -1){
|
||||||
|
health = size * size * 40;
|
||||||
|
}
|
||||||
|
|
||||||
buildCost = 0f;
|
buildCost = 0f;
|
||||||
for(ItemStack stack : requirements){
|
for(ItemStack stack : requirements){
|
||||||
|
Reference in New Issue
Block a user