Merge
This commit is contained in:
@@ -2,7 +2,7 @@ package mindustry.mod;
|
||||
|
||||
import arc.audio.*;
|
||||
import arc.math.geom.*;
|
||||
import arc.mock.MockSound;
|
||||
import arc.mock.*;
|
||||
import arc.util.ArcAnnotate.*;
|
||||
|
||||
public class ModLoadingSound implements Sound{
|
||||
|
||||
@@ -51,6 +51,7 @@ public class ItemSelection{
|
||||
scrollPos = pane.getScrollY();
|
||||
});
|
||||
|
||||
table.add(pane).maxHeight(40 * 5);
|
||||
pane.setOverscroll(false, false);
|
||||
table.add(pane).maxHeight(Scl.scl(40 * 5));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import mindustry.type.*;
|
||||
import mindustry.world.*;
|
||||
import mindustry.world.meta.*;
|
||||
|
||||
import java.io.*;
|
||||
import static mindustry.Vars.world;
|
||||
|
||||
public class OverflowGate extends Block{
|
||||
public float speed = 1f;
|
||||
@@ -124,11 +124,24 @@ public class OverflowGate extends Block{
|
||||
Tile lastInput;
|
||||
float time;
|
||||
|
||||
@Override
|
||||
public byte version(){
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(Writes write){
|
||||
write.i(lastInput == null ? Pos.invalid : lastInput.pos());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(Reads read, byte revision){
|
||||
super.read(read, revision);
|
||||
if(revision == 1){
|
||||
new DirectionalItemBuffer(25, 50f).read(read);
|
||||
}else if(revision == 3){
|
||||
lastInput = world.tile(read.i());
|
||||
lastItem = items.first();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,15 +69,24 @@ public class ItemModule extends BlockModule{
|
||||
return total;
|
||||
}
|
||||
|
||||
public Item first(){
|
||||
for(int i = 0; i < items.length; i++){
|
||||
if(items[i] > 0){
|
||||
return content.item(i);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public Item take(){
|
||||
for(int i = 0; i < items.length; i++){
|
||||
int index = (i + takeRotation);
|
||||
if(index >= items.length) index -= items.length; //conditional instead of mod
|
||||
if(index >= items.length) index -= items.length;
|
||||
if(items[index] > 0){
|
||||
items[index] --;
|
||||
total --;
|
||||
takeRotation = index + 1;
|
||||
return content.item(index % items.length);
|
||||
return content.item(index);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user