mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-01-26 06:22:17 -08:00
Partial fix of editor multiblock undo/redo
This commit is contained in:
parent
024f64678c
commit
63e4bca098
6 changed files with 23 additions and 14 deletions
|
|
@ -1191,7 +1191,7 @@ public class Blocks implements ContentList{
|
|||
requirements(Category.power, with(Items.lead, 100, Items.silicon, 75, Items.phaseFabric, 25, Items.plastanium, 75, Items.thorium, 50));
|
||||
size = 2;
|
||||
powerProduction = 4.5f;
|
||||
itemDuration = 60 * 18f;
|
||||
itemDuration = 60 * 15f;
|
||||
}};
|
||||
|
||||
solarPanel = new SolarGenerator("solar-panel"){{
|
||||
|
|
@ -1991,8 +1991,8 @@ public class Blocks implements ContentList{
|
|||
|
||||
illuminator = new LightBlock("illuminator"){{
|
||||
requirements(Category.effect, BuildVisibility.lightingOnly, with(Items.graphite, 12, Items.silicon, 8));
|
||||
brightness = 0.67f;
|
||||
radius = 140f;
|
||||
brightness = 0.75f;
|
||||
radius = 160f;
|
||||
consumes.power(0.06f);
|
||||
}};
|
||||
|
||||
|
|
|
|||
|
|
@ -1290,7 +1290,7 @@ public class UnitTypes implements ContentList{
|
|||
collides = false;
|
||||
|
||||
healPercent = 15f;
|
||||
splashDamage = 320f;
|
||||
splashDamage = 240f;
|
||||
splashDamageRadius = 120f;
|
||||
}};
|
||||
}});
|
||||
|
|
|
|||
|
|
@ -50,9 +50,19 @@ public class EditorTile extends Tile{
|
|||
return;
|
||||
}
|
||||
|
||||
op(OpType.block, block.id);
|
||||
if(rotation != 0) op(OpType.rotation, (byte)rotation);
|
||||
if(team != Team.derelict) op(OpType.team, (byte)team.id);
|
||||
if(!isCenter()){
|
||||
EditorTile cen = (EditorTile)build.tile;
|
||||
cen.op(OpType.rotation, (byte)build.rotation);
|
||||
cen.op(OpType.team, (byte)build.team.id);
|
||||
cen.op(OpType.block, block.id);
|
||||
update();
|
||||
}else{
|
||||
if(build != null) op(OpType.rotation, (byte)build.rotation);
|
||||
if(build != null) op(OpType.team, (byte)build.team.id);
|
||||
op(OpType.block, block.id);
|
||||
|
||||
}
|
||||
|
||||
super.setBlock(type, team, rotation);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -157,7 +157,7 @@ public class MapEditor{
|
|||
boolean hasOverlap(int x, int y){
|
||||
Tile tile = world.tile(x, y);
|
||||
//allow direct replacement of blocks of the same size
|
||||
if(tile != null && tile.isCenter() && tile.block() != drawBlock && tile.block().size == drawBlock.size){
|
||||
if(tile != null && tile.isCenter() && tile.block() != drawBlock && tile.block().size == drawBlock.size && tile.x == x && tile.y == y){
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -168,12 +168,10 @@ public class MapEditor{
|
|||
for(int dy = 0; dy < drawBlock.size; dy++){
|
||||
int worldx = dx + offsetx + x;
|
||||
int worldy = dy + offsety + y;
|
||||
if(!(worldx == x && worldy == y)){
|
||||
Tile other = world.tile(worldx, worldy);
|
||||
Tile other = world.tile(worldx, worldy);
|
||||
|
||||
if(other != null && other.block().isMultiblock()){
|
||||
return true;
|
||||
}
|
||||
if(other != null && other.block().isMultiblock()){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -217,6 +217,7 @@ public class Tile implements Position, QuadTreeObject, Displayable{
|
|||
//assign entity and type to blocks, so they act as proxies for this one
|
||||
other.build = entity;
|
||||
other.block = block;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
org.gradle.daemon=true
|
||||
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
||||
archash=f316225521c91df6c132b13fa2044d969ec39231
|
||||
archash=aac5351b3ebb9f598e02af6dcc1aaaa31994fa9b
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue