Fixed #2515
This commit is contained in:
@@ -101,13 +101,12 @@ public class Blocks implements ContentList{
|
||||
hasShadow = false;
|
||||
}
|
||||
|
||||
public void drawBase(Tile tile){}
|
||||
public void load(){}
|
||||
public void init(){}
|
||||
public boolean isHidden(){
|
||||
return true;
|
||||
}
|
||||
@Override public void drawBase(Tile tile){}
|
||||
@Override public void load(){}
|
||||
@Override public void init(){}
|
||||
@Override public boolean isHidden(){ return true; }
|
||||
|
||||
@Override
|
||||
public TextureRegion[] variantRegions(){
|
||||
if(variantRegions == null){
|
||||
variantRegions = new TextureRegion[]{Core.atlas.find("clear")};
|
||||
@@ -211,9 +210,7 @@ public class Blocks implements ContentList{
|
||||
cacheLayer = CacheLayer.slag;
|
||||
}};
|
||||
|
||||
stone = new Floor("stone"){{
|
||||
|
||||
}};
|
||||
stone = new Floor("stone");
|
||||
|
||||
craters = new Floor("craters"){{
|
||||
variants = 3;
|
||||
@@ -265,9 +262,7 @@ public class Blocks implements ContentList{
|
||||
((ShallowLiquid)sandWater).set(Blocks.water, Blocks.sand);
|
||||
((ShallowLiquid)darksandWater).set(Blocks.water, Blocks.darksand);
|
||||
|
||||
holostone = new Floor("holostone"){{
|
||||
|
||||
}};
|
||||
holostone = new Floor("holostone");
|
||||
|
||||
grass = new Floor("grass"){{
|
||||
attributes.set(Attribute.water, 0.1f);
|
||||
@@ -334,8 +329,7 @@ public class Blocks implements ContentList{
|
||||
variants = 2;
|
||||
}};
|
||||
|
||||
saltRocks = new StaticWall("saltrocks"){{
|
||||
}};
|
||||
saltRocks = new StaticWall("saltrocks");
|
||||
|
||||
sporePine = new StaticTree("spore-pine"){{
|
||||
variants = 0;
|
||||
@@ -349,15 +343,11 @@ public class Blocks implements ContentList{
|
||||
variants = 0;
|
||||
}};
|
||||
|
||||
shrubs = new StaticWall("shrubs"){{
|
||||
shrubs = new StaticWall("shrubs");
|
||||
|
||||
}};
|
||||
whiteTreeDead = new TreeBlock("white-tree-dead");
|
||||
|
||||
whiteTreeDead = new TreeBlock("white-tree-dead"){{
|
||||
}};
|
||||
|
||||
whiteTree = new TreeBlock("white-tree"){{
|
||||
}};
|
||||
whiteTree = new TreeBlock("white-tree");
|
||||
|
||||
sporeCluster = new Rock("spore-cluster"){{
|
||||
variants = 3;
|
||||
@@ -1157,7 +1147,7 @@ public class Blocks implements ContentList{
|
||||
rtgGenerator = new DecayGenerator("rtg-generator"){{
|
||||
requirements(Category.power, with(Items.lead, 100, Items.silicon, 75, Items.phasefabric, 25, Items.plastanium, 75, Items.thorium, 50));
|
||||
size = 2;
|
||||
powerProduction = 4f;
|
||||
powerProduction = 4.5f;
|
||||
itemDuration = 500f;
|
||||
}};
|
||||
|
||||
@@ -1177,7 +1167,7 @@ public class Blocks implements ContentList{
|
||||
size = 3;
|
||||
health = 700;
|
||||
itemDuration = 360f;
|
||||
powerProduction = 14f;
|
||||
powerProduction = 15f;
|
||||
consumes.item(Items.thorium);
|
||||
heating = 0.02f;
|
||||
consumes.liquid(Liquids.cryofluid, heating / coolantPower).update(false);
|
||||
|
||||
@@ -431,16 +431,16 @@ public class Control implements ApplicationListener, Loadable{
|
||||
ui.showStartupInfo("[accent]v6[] is currently in [accent]pre-alpha[].\n" +
|
||||
"[lightgray]This means:[]\n" +
|
||||
"- Content is missing\n" +
|
||||
"- [scarlet]Mobile[] is not supported.\n" +
|
||||
"- Most [scarlet]Unit AI[] does not work\n" +
|
||||
"- Many units are [scarlet]missing[] or unfinished\n" +
|
||||
"- Many units are unfinished\n" +
|
||||
"- The campaign is completely unfinished\n" +
|
||||
"- Everything you see is subject to change or removal." +
|
||||
"\n\nReport bugs or crashes on [accent]Github[].");
|
||||
}));
|
||||
}
|
||||
|
||||
//play tutorial on stop
|
||||
//play tutorial on start
|
||||
//TODO no tutorial right now
|
||||
if(!settings.getBool("playedtutorial", false)){
|
||||
//Core.app.post(() -> Core.app.post(this::playTutorial));
|
||||
}
|
||||
|
||||
@@ -185,8 +185,6 @@ public class World{
|
||||
continue;
|
||||
}
|
||||
|
||||
tile.updateOcclusion();
|
||||
|
||||
if(tile.build != null){
|
||||
tile.build.updateProximity();
|
||||
}
|
||||
|
||||
@@ -39,13 +39,6 @@ public class EditorTile extends Tile{
|
||||
super.setFloor(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateOcclusion(){
|
||||
super.updateOcclusion();
|
||||
|
||||
ui.editor.editor.renderer().updatePoint(x, y);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBlock(Block type, Team team, int rotation){
|
||||
if(state.isGame()){
|
||||
@@ -85,8 +78,12 @@ public class EditorTile extends Tile{
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void preChanged(){
|
||||
super.preChanged();
|
||||
protected void fireChanged(){
|
||||
if(state.isGame()){
|
||||
super.fireChanged();
|
||||
}else{
|
||||
ui.editor.editor.renderer().updatePoint(x, y);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -200,20 +200,16 @@ public class BaseGenerator{
|
||||
}
|
||||
|
||||
boolean isTaken(Block block, int x, int y){
|
||||
if(block.isMultiblock()){
|
||||
int offsetx = -(block.size - 1) / 2;
|
||||
int offsety = -(block.size - 1) / 2;
|
||||
int offsetx = -(block.size - 1) / 2;
|
||||
int offsety = -(block.size - 1) / 2;
|
||||
int pad = 1;
|
||||
|
||||
for(int dx = 0; dx < block.size; dx++){
|
||||
for(int dy = 0; dy < block.size; dy++){
|
||||
if(overlaps(dx + offsetx + x, dy + offsety + y)){
|
||||
return true;
|
||||
}
|
||||
for(int dx = -pad; dx < block.size + pad; dx++){
|
||||
for(int dy = -pad; dy < block.size + pad; dy++){
|
||||
if(overlaps(dx + offsetx + x, dy + offsety + y)){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
}else{
|
||||
return overlaps(x, y);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
@@ -390,6 +390,8 @@ public class Sector{
|
||||
/** Has an enemy base. */
|
||||
base,
|
||||
/** Has spore weather. */
|
||||
spores
|
||||
spores,
|
||||
/** Path from core to spawns requires traversing water. */
|
||||
navalPath
|
||||
}
|
||||
}
|
||||
|
||||
@@ -449,10 +449,6 @@ public class Tile implements Position, QuadTreeObject, Displayable{
|
||||
return block.solid && block.fillsTile && !block.synthetic() ? data : 0;
|
||||
}
|
||||
|
||||
//TODO remove this method?
|
||||
public void updateOcclusion(){
|
||||
}
|
||||
|
||||
protected void preChanged(){
|
||||
if(build != null){
|
||||
//only call removed() for the center block - this only gets called once.
|
||||
@@ -475,8 +471,7 @@ public class Tile implements Position, QuadTreeObject, Displayable{
|
||||
other.block = Blocks.air;
|
||||
|
||||
//manually call changed event
|
||||
other.updateOcclusion();
|
||||
world.notifyChanged(other);
|
||||
other.fireChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -533,9 +528,7 @@ public class Tile implements Position, QuadTreeObject, Displayable{
|
||||
}
|
||||
}
|
||||
|
||||
updateOcclusion();
|
||||
|
||||
world.notifyChanged(this);
|
||||
fireChanged();
|
||||
|
||||
//recache when static block is added
|
||||
if(block.isStatic()){
|
||||
@@ -543,6 +536,10 @@ public class Tile implements Position, QuadTreeObject, Displayable{
|
||||
}
|
||||
}
|
||||
|
||||
protected void fireChanged(){
|
||||
world.notifyChanged(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void display(Table table){
|
||||
Block toDisplay = overlay.itemDrop != null ? overlay : floor;
|
||||
|
||||
@@ -70,7 +70,7 @@ public class NuclearReactor extends PowerGenerator{
|
||||
@Override
|
||||
public void updateTile(){
|
||||
ConsumeLiquid cliquid = consumes.get(ConsumeType.liquid);
|
||||
Item item = consumes.<ConsumeItems>get(ConsumeType.item).items[0].item;
|
||||
Item item = consumes.getItem().items[0].item;
|
||||
|
||||
int fuel = items.get(item);
|
||||
float fullness = (float)fuel / itemCapacity;
|
||||
|
||||
@@ -34,6 +34,10 @@ public class Consumers{
|
||||
return get(ConsumeType.power);
|
||||
}
|
||||
|
||||
public ConsumeItems getItem(){
|
||||
return get(ConsumeType.item);
|
||||
}
|
||||
|
||||
public boolean hasPower(){
|
||||
return has(ConsumeType.power);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user