Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -20,6 +20,7 @@ public class PayloadConveyor extends Block{
|
|||||||
public @Load("@-top") TextureRegion topRegion;
|
public @Load("@-top") TextureRegion topRegion;
|
||||||
public @Load("@-edge") TextureRegion edgeRegion;
|
public @Load("@-edge") TextureRegion edgeRegion;
|
||||||
public Interp interp = Interp.pow5;
|
public Interp interp = Interp.pow5;
|
||||||
|
public float payloadLimit = 2.5f;
|
||||||
|
|
||||||
public PayloadConveyor(String name){
|
public PayloadConveyor(String name){
|
||||||
super(name);
|
super(name);
|
||||||
@@ -216,10 +217,10 @@ public class PayloadConveyor extends Block{
|
|||||||
@Override
|
@Override
|
||||||
public boolean acceptPayload(Building source, Payload payload){
|
public boolean acceptPayload(Building source, Payload payload){
|
||||||
if(source == this){
|
if(source == this){
|
||||||
return this.item == null && payload.fits();
|
return this.item == null && payload.fits(payloadLimit);
|
||||||
}
|
}
|
||||||
//accepting payloads from units isn't supported
|
//accepting payloads from units isn't supported
|
||||||
return this.item == null && progress <= 5f && payload.fits();
|
return this.item == null && progress <= 5f && payload.fits(payloadLimit);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -25,9 +25,9 @@ public interface Payload{
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @return whether this payload fits on a standard 3x3 conveyor. */
|
/** @return whether this payload fits in a given size. 2.5 is the max for a standard 3x3 conveyor. */
|
||||||
default boolean fits(){
|
default boolean fits(float s){
|
||||||
return size() / tilesize <= 2.5f;
|
return size() / tilesize <= s;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** writes the payload for saving. */
|
/** writes the payload for saving. */
|
||||||
|
|||||||
Reference in New Issue
Block a user