mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-31 23:19:43 +07:00
Risky building changes
This commit is contained in:
@ -202,9 +202,9 @@ public interface BuilderTrait extends Entity, TeamTrait{
|
||||
|
||||
if(!(tile.block() instanceof BuildBlock)){
|
||||
if(canCreateBlocks() && !current.breaking && Build.validPlace(getTeam(), current.x, current.y, current.block, current.rotation)){
|
||||
Build.beginPlace(getTeam(), current.x, current.y, current.block, current.rotation);
|
||||
Call.beginPlace(getTeam(), current.x, current.y, current.block, current.rotation);
|
||||
}else if(canCreateBlocks() && current.breaking && Build.validBreak(getTeam(), current.x, current.y)){
|
||||
Build.beginBreak(getTeam(), current.x, current.y);
|
||||
Call.beginBreak(getTeam(), current.x, current.y);
|
||||
}else{
|
||||
getPlaceQueue().removeFirst();
|
||||
return;
|
||||
@ -222,7 +222,6 @@ public interface BuilderTrait extends Entity, TeamTrait{
|
||||
BuildEntity entity = tile.entity();
|
||||
|
||||
if(entity == null){
|
||||
getPlaceQueue().removeFirst();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,7 @@
|
||||
package io.anuke.mindustry.world;
|
||||
|
||||
import io.anuke.annotations.Annotations.Loc;
|
||||
import io.anuke.annotations.Annotations.Remote;
|
||||
import io.anuke.arc.Core;
|
||||
import io.anuke.arc.Events;
|
||||
import io.anuke.arc.math.Mathf;
|
||||
@ -19,6 +21,7 @@ public class Build{
|
||||
private static final Rectangle rect = new Rectangle();
|
||||
|
||||
/**Returns block type that was broken, or null if unsuccesful.*/
|
||||
@Remote(called = Loc.server)
|
||||
public static void beginBreak(Team team, int x, int y){
|
||||
if(!validBreak(team, x, y)){
|
||||
return;
|
||||
@ -69,6 +72,7 @@ public class Build{
|
||||
}
|
||||
|
||||
/**Places a BuildBlock at this location.*/
|
||||
@Remote(called = Loc.server)
|
||||
public static void beginPlace(Team team, int x, int y, Block result, int rotation){
|
||||
if(!validPlace(team, x, y, result, rotation)){
|
||||
return;
|
||||
|
Reference in New Issue
Block a user