mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-12 03:37:27 +07:00
Merge pull request #2807 from MEEPofFaith/patch-1
Define payload capacity of payload conveyors on the conveyor itself.
This commit is contained in:
commit
9a92e0246e
@ -20,6 +20,7 @@ public class PayloadConveyor extends Block{
|
||||
public @Load("@-top") TextureRegion topRegion;
|
||||
public @Load("@-edge") TextureRegion edgeRegion;
|
||||
public Interp interp = Interp.pow5;
|
||||
public float payloadLimit = 2.5f;
|
||||
|
||||
public PayloadConveyor(String name){
|
||||
super(name);
|
||||
@ -216,10 +217,10 @@ public class PayloadConveyor extends Block{
|
||||
@Override
|
||||
public boolean acceptPayload(Building source, Payload payload){
|
||||
if(source == this){
|
||||
return this.item == null && payload.fits();
|
||||
return this.item == null && payload.fits(payloadLimit);
|
||||
}
|
||||
//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
|
||||
|
@ -25,9 +25,9 @@ public interface Payload{
|
||||
return false;
|
||||
}
|
||||
|
||||
/** @return whether this payload fits on a standard 3x3 conveyor. */
|
||||
default boolean fits(){
|
||||
return size() / tilesize <= 2.5f;
|
||||
/** @return whether this payload fits in a given size. 2.5 is the max for a standard 3x3 conveyor. */
|
||||
default boolean fits(float s){
|
||||
return size() / tilesize <= s;
|
||||
}
|
||||
|
||||
/** writes the payload for saving. */
|
||||
|
Loading…
Reference in New Issue
Block a user