mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-23 14:17:48 +07:00
Merge branch 'master' into patch-2
This commit is contained in:
@ -593,38 +593,38 @@ public class NetServer implements ApplicationListener{
|
|||||||
if(player.isBuilder()){
|
if(player.isBuilder()){
|
||||||
player.builder().clearBuilding();
|
player.builder().clearBuilding();
|
||||||
player.builder().updateBuilding(building);
|
player.builder().updateBuilding(building);
|
||||||
|
|
||||||
|
if(requests != null){
|
||||||
|
for(BuildPlan req : requests){
|
||||||
|
if(req == null) continue;
|
||||||
|
Tile tile = world.tile(req.x, req.y);
|
||||||
|
if(tile == null || (!req.breaking && req.block == null)) continue;
|
||||||
|
//auto-skip done requests
|
||||||
|
if(req.breaking && tile.block() == Blocks.air){
|
||||||
|
continue;
|
||||||
|
}else if(!req.breaking && tile.block() == req.block && (!req.block.rotate || (tile.build != null && tile.build.rotation == req.rotation))){
|
||||||
|
continue;
|
||||||
|
}else if(con.rejectedRequests.contains(r -> r.breaking == req.breaking && r.x == req.x && r.y == req.y)){ //check if request was recently rejected, and skip it if so
|
||||||
|
continue;
|
||||||
|
}else if(!netServer.admins.allowAction(player, req.breaking ? ActionType.breakBlock : ActionType.placeBlock, tile, action -> { //make sure request is allowed by the server
|
||||||
|
action.block = req.block;
|
||||||
|
action.rotation = req.rotation;
|
||||||
|
action.config = req.config;
|
||||||
|
})){
|
||||||
|
//force the player to remove this request if that's not the case
|
||||||
|
Call.removeQueueBlock(player.con, req.x, req.y, req.breaking);
|
||||||
|
con.rejectedRequests.add(req);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
player.builder().plans().addLast(req);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(player.isMiner()){
|
if(player.isMiner()){
|
||||||
player.miner().mineTile(mining);
|
player.miner().mineTile(mining);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(requests != null){
|
|
||||||
for(BuildPlan req : requests){
|
|
||||||
if(req == null) continue;
|
|
||||||
Tile tile = world.tile(req.x, req.y);
|
|
||||||
if(tile == null || (!req.breaking && req.block == null)) continue;
|
|
||||||
//auto-skip done requests
|
|
||||||
if(req.breaking && tile.block() == Blocks.air){
|
|
||||||
continue;
|
|
||||||
}else if(!req.breaking && tile.block() == req.block && (!req.block.rotate || (tile.build != null && tile.build.rotation == req.rotation))){
|
|
||||||
continue;
|
|
||||||
}else if(con.rejectedRequests.contains(r -> r.breaking == req.breaking && r.x == req.x && r.y == req.y)){ //check if request was recently rejected, and skip it if so
|
|
||||||
continue;
|
|
||||||
}else if(!netServer.admins.allowAction(player, req.breaking ? ActionType.breakBlock : ActionType.placeBlock, tile, action -> { //make sure request is allowed by the server
|
|
||||||
action.block = req.block;
|
|
||||||
action.rotation = req.rotation;
|
|
||||||
action.config = req.config;
|
|
||||||
})){
|
|
||||||
//force the player to remove this request if that's not the case
|
|
||||||
Call.removeQueueBlock(player.con, req.x, req.y, req.breaking);
|
|
||||||
con.rejectedRequests.add(req);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
player.builder().plans().addLast(req);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
con.rejectedRequests.clear();
|
con.rejectedRequests.clear();
|
||||||
|
|
||||||
if(!player.dead()){
|
if(!player.dead()){
|
||||||
|
@ -228,7 +228,7 @@ public class FloorRenderer implements Disposable{
|
|||||||
int chunksx = Mathf.ceil((float)(world.width()) / chunksize),
|
int chunksx = Mathf.ceil((float)(world.width()) / chunksize),
|
||||||
chunksy = Mathf.ceil((float)(world.height()) / chunksize);
|
chunksy = Mathf.ceil((float)(world.height()) / chunksize);
|
||||||
cache = new Chunk[chunksx][chunksy];
|
cache = new Chunk[chunksx][chunksy];
|
||||||
cbatch = new MultiCacheBatch(chunksize * chunksize * 6);
|
cbatch = new MultiCacheBatch(chunksize * chunksize * 7);
|
||||||
|
|
||||||
Time.mark();
|
Time.mark();
|
||||||
|
|
||||||
|
@ -17,13 +17,13 @@ import mindustry.world.blocks.environment.*;
|
|||||||
import static mindustry.Vars.*;
|
import static mindustry.Vars.*;
|
||||||
|
|
||||||
public abstract class FilterOption{
|
public abstract class FilterOption{
|
||||||
public static final Boolf<Block> floorsOnly = b -> (b instanceof Floor && !(b instanceof OverlayFloor)) && !headless && Core.atlas.isFound(b.icon(mindustry.ui.Cicon.full));
|
public static final Boolf<Block> floorsOnly = b -> (b instanceof Floor && !(b instanceof OverlayFloor)) && !headless && Core.atlas.isFound(b.icon(Cicon.full));
|
||||||
public static final Boolf<Block> wallsOnly = b -> (!b.synthetic() && !(b instanceof Floor)) && !headless && Core.atlas.isFound(b.icon(mindustry.ui.Cicon.full));
|
public static final Boolf<Block> wallsOnly = b -> (!b.synthetic() && !(b instanceof Floor)) && !headless && Core.atlas.isFound(b.icon(Cicon.full)) && b.inEditor;
|
||||||
public static final Boolf<Block> floorsOptional = b -> b == Blocks.air || ((b instanceof Floor && !(b instanceof OverlayFloor)) && !headless && Core.atlas.isFound(b.icon(mindustry.ui.Cicon.full)));
|
public static final Boolf<Block> floorsOptional = b -> b == Blocks.air || ((b instanceof Floor && !(b instanceof OverlayFloor)) && !headless && Core.atlas.isFound(b.icon(Cicon.full)));
|
||||||
public static final Boolf<Block> wallsOptional = b -> b == Blocks.air || ((!b.synthetic() && !(b instanceof Floor)) && !headless && Core.atlas.isFound(b.icon(mindustry.ui.Cicon.full)));
|
public static final Boolf<Block> wallsOptional = b -> b == Blocks.air || ((!b.synthetic() && !(b instanceof Floor)) && !headless && Core.atlas.isFound(b.icon(Cicon.full)));
|
||||||
public static final Boolf<Block> wallsOresOptional = b -> b == Blocks.air || (((!b.synthetic() && !(b instanceof Floor)) || (b instanceof OverlayFloor)) && !headless && Core.atlas.isFound(b.icon(mindustry.ui.Cicon.full)));
|
public static final Boolf<Block> wallsOresOptional = b -> b == Blocks.air || (((!b.synthetic() && !(b instanceof Floor)) || (b instanceof OverlayFloor)) && !headless && Core.atlas.isFound(b.icon(Cicon.full))) && b.inEditor;
|
||||||
public static final Boolf<Block> oresOnly = b -> b instanceof OverlayFloor && !headless && Core.atlas.isFound(b.icon(mindustry.ui.Cicon.full));
|
public static final Boolf<Block> oresOnly = b -> b instanceof OverlayFloor && !headless && Core.atlas.isFound(b.icon(mindustry.ui.Cicon.full));
|
||||||
public static final Boolf<Block> anyOptional = b -> floorsOnly.get(b) || wallsOnly.get(b) || oresOnly.get(b) || b == Blocks.air;
|
public static final Boolf<Block> anyOptional = b -> (floorsOnly.get(b) || wallsOnly.get(b) || oresOnly.get(b) || b == Blocks.air) && b.inEditor;
|
||||||
|
|
||||||
public abstract void build(Table table);
|
public abstract void build(Table table);
|
||||||
|
|
||||||
|
@ -4,11 +4,5 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"address": "nydustry.nydus.app:6060"
|
"address": "nydustry.nydus.app:6060"
|
||||||
},
|
|
||||||
{
|
|
||||||
"address": "mindustry.pl:6000"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"address": "mindustry.pl:6666"
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -1,4 +1,10 @@
|
|||||||
[
|
[
|
||||||
|
{
|
||||||
|
"address": "mindustry.pl:6000"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address": "mindustry.pl:6666"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"address": "routerchain.ddns.net"
|
"address": "routerchain.ddns.net"
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user