Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -109,3 +109,4 @@ VolasYouKnow
|
|||||||
Quick-Korx
|
Quick-Korx
|
||||||
Ángel Rodríguez Aguilera
|
Ángel Rodríguez Aguilera
|
||||||
Catchears
|
Catchears
|
||||||
|
younggam
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ public class Version{
|
|||||||
int dot = str.indexOf('.');
|
int dot = str.indexOf('.');
|
||||||
if(dot != -1){
|
if(dot != -1){
|
||||||
int major = Strings.parseInt(str.substring(0, dot), 0), minor = Strings.parseInt(str.substring(dot + 1), 0);
|
int major = Strings.parseInt(str.substring(0, dot), 0), minor = Strings.parseInt(str.substring(dot + 1), 0);
|
||||||
return build >= major && revision >= minor;
|
return build > major || (build == major && revision >= minor);
|
||||||
}else{
|
}else{
|
||||||
return build >= Strings.parseInt(str, 0);
|
return build >= Strings.parseInt(str, 0);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -384,6 +384,10 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
|||||||
//endregion
|
//endregion
|
||||||
//region handler methods
|
//region handler methods
|
||||||
|
|
||||||
|
public boolean canUnload(){
|
||||||
|
return block.unloadable;
|
||||||
|
}
|
||||||
|
|
||||||
/** Called when an unloader takes an item. */
|
/** Called when an unloader takes an item. */
|
||||||
public void itemTaken(Item item){
|
public void itemTaken(Item item){
|
||||||
|
|
||||||
|
|||||||
@@ -179,14 +179,23 @@ public class StackConveyor extends Block implements Autotiler{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canUnload(){
|
||||||
|
return state != stateLoad;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float efficiency(){
|
||||||
|
return 1f;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateTile(){
|
public void updateTile(){
|
||||||
// reel in crater
|
// reel in crater
|
||||||
if(cooldown > 0f) cooldown = Mathf.clamp(cooldown - speed * edelta(), 0f, recharge);
|
if(cooldown > 0f) cooldown = Mathf.clamp(cooldown - speed * edelta(), 0f, recharge);
|
||||||
|
|
||||||
if(link == -1){
|
// indicates empty state
|
||||||
return;
|
if(link == -1) return;
|
||||||
}
|
|
||||||
|
|
||||||
// crater needs to be centered
|
// crater needs to be centered
|
||||||
if(cooldown > 0f) return;
|
if(cooldown > 0f) return;
|
||||||
@@ -196,6 +205,9 @@ public class StackConveyor extends Block implements Autotiler{
|
|||||||
lastItem = items.first();
|
lastItem = items.first();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// do not continue if disabled, will still allow one to be reeled in to prevent visual stacking
|
||||||
|
if(!enabled) return;
|
||||||
|
|
||||||
if(state == stateUnload){ //unload
|
if(state == stateUnload){ //unload
|
||||||
while(lastItem != null && (!splitOut ? moveForward(lastItem) : dump(lastItem))){
|
while(lastItem != null && (!splitOut ? moveForward(lastItem) : dump(lastItem))){
|
||||||
if(items.empty()) poofOut();
|
if(items.empty()) poofOut();
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ public class Unloader extends Block{
|
|||||||
int pos = (offset + i) % proximity.size;
|
int pos = (offset + i) % proximity.size;
|
||||||
var other = proximity.get(pos);
|
var other = proximity.get(pos);
|
||||||
|
|
||||||
if(other.interactable(team) && other.block.unloadable && other.block.hasItems
|
if(other.interactable(team) && other.block.unloadable && other.canUnload() && other.block.hasItems
|
||||||
&& ((sortItem == null && other.items.total() > 0) || (sortItem != null && other.items.has(sortItem)))){
|
&& ((sortItem == null && other.items.total() > 0) || (sortItem != null && other.items.has(sortItem)))){
|
||||||
//make sure the item can't be dumped back into this block
|
//make sure the item can't be dumped back into this block
|
||||||
dumpingTo = other;
|
dumpingTo = other;
|
||||||
|
|||||||
Reference in New Issue
Block a user