Merge branch '6.0' of https://github.com/Anuken/Mindustry into object-config
# Conflicts: # core/src/mindustry/entities/traits/BuilderTrait.java # core/src/mindustry/entities/type/TileEntity.java # core/src/mindustry/game/EventType.java # core/src/mindustry/game/Schematics.java # core/src/mindustry/input/InputHandler.java # core/src/mindustry/io/TypeIO.java # core/src/mindustry/world/Block.java # core/src/mindustry/world/blocks/distribution/Sorter.java
This commit is contained in:
@@ -2,6 +2,7 @@ package mindustry.game;
|
||||
|
||||
import arc.*;
|
||||
import arc.assets.*;
|
||||
import arc.math.geom.*;
|
||||
import arc.struct.*;
|
||||
import arc.files.*;
|
||||
import arc.graphics.*;
|
||||
@@ -14,7 +15,7 @@ import arc.util.serialization.*;
|
||||
import mindustry.*;
|
||||
import mindustry.content.*;
|
||||
import mindustry.ctype.ContentType;
|
||||
import mindustry.entities.traits.BuilderTrait.*;
|
||||
import mindustry.entities.units.*;
|
||||
import mindustry.game.EventType.*;
|
||||
import mindustry.game.Schematic.*;
|
||||
import mindustry.input.*;
|
||||
@@ -315,7 +316,7 @@ public class Schematics implements Loadable{
|
||||
for(int cy = y; cy <= y2; cy++){
|
||||
Tile linked = world.ltile(cx, cy);
|
||||
|
||||
if(linked != null && linked.entity != null && linked.entity.block.isVisible() && !(linked.block() instanceof BuildBlock)){
|
||||
if(linked != null && linked.entity != null && linked.entity.block().isVisible() && !(linked.block() instanceof BuildBlock)){
|
||||
int top = linked.block().size/2;
|
||||
int bot = linked.block().size % 2 == 1 ? -linked.block().size/2 : -(linked.block().size - 1)/2;
|
||||
minx = Math.min(linked.x + bot, minx);
|
||||
@@ -344,9 +345,9 @@ public class Schematics implements Loadable{
|
||||
Tile tile = world.ltile(cx, cy);
|
||||
|
||||
if(tile != null && tile.entity != null && !counted.contains(tile.pos()) && !(tile.block() instanceof BuildBlock)
|
||||
&& (tile.entity.block.isVisible() || (tile.entity.block instanceof CoreBlock && Core.settings.getBool("coreselect")))){
|
||||
&& (tile.entity.block().isVisible() || (tile.entity.block() instanceof CoreBlock && Core.settings.getBool("coreselect")))){
|
||||
Object config = tile.entity.config();
|
||||
if(tile.block().posConfig){
|
||||
if(config instanceof Point2){
|
||||
config = Pos.get(Pos.x(config) + offsetX, Pos.y(config) + offsetY);
|
||||
}
|
||||
|
||||
@@ -375,7 +376,7 @@ public class Schematics implements Loadable{
|
||||
/** Loads a schematic from base64. May throw an exception. */
|
||||
public static Schematic readBase64(String schematic){
|
||||
try{
|
||||
return read(new ByteArrayInputStream(Base64Coder.decode(schematic)));
|
||||
return read(new ByteArrayInputStream(Base64Coder.decode(schematic.trim())));
|
||||
}catch(IOException e){
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user