Fixed many various bugs

This commit is contained in:
Anuken
2019-06-06 23:29:21 -04:00
parent 1b4b1d5c9f
commit d0b5b49bf8
8 changed files with 56 additions and 4 deletions

View File

@@ -11,13 +11,20 @@ public class DefaultWaves{
if(spawns == null && UnitTypes.dagger != null){
spawns = Array.with(
new SpawnGroup(UnitTypes.dagger){{
end = 8;
end = 10;
unitScaling = 2f;
}},
new SpawnGroup(UnitTypes.crawler){{
begin = 5;
end = 13;
unitAmount = 2;
unitScaling = 1.5f;
}},
new SpawnGroup(UnitTypes.wraith){{
begin = 12;
end = 14;
end = 16;
unitScaling = 1f;
}},
@@ -39,7 +46,7 @@ public class DefaultWaves{
new SpawnGroup(UnitTypes.dagger){{
begin = 8;
unitScaling = 1;
unitAmount = 1;
unitAmount = 4;
spacing = 2;
}},

View File

@@ -66,7 +66,7 @@ public class Rules{
/** Whether this is the editor gamemode. */
public boolean editor = false;
/** Items that the player starts with here. Not applicable to zones.*/
public Array<ItemStack> startingItems = Array.with(new ItemStack(Items.copper, 100));
public Array<ItemStack> startingItems = Array.with(new ItemStack(Items.copper, 200));
/** Copies this ruleset exactly. Not very efficient at all, do not use often. */
public Rules copy(){

View File

@@ -11,6 +11,11 @@ public class ItemStack implements Comparable<ItemStack>{
this.amount = amount;
}
//serialization only
public ItemStack(){
}
public boolean equals(ItemStack other){
return other != null && other.item == item && other.amount == amount;
}

View File

@@ -1,5 +1,7 @@
package io.anuke.mindustry.world.blocks;
import io.anuke.mindustry.type.Item;
import io.anuke.mindustry.type.Liquid;
import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.Tile;
@@ -28,6 +30,28 @@ public class BlockPart extends Block{
return parts[dx + maxSize/2][dy + maxSize/2];
}
@Override
public boolean acceptItem(Item item, Tile tile, Tile source){
return tile.link().block().acceptItem(item, tile.link(), source);
}
@Override
public void handleItem(Item item, Tile tile, Tile source){
tile.link().block().handleItem(item, tile.link(), source);
}
@Override
public void handleLiquid(Tile tile, Tile source, Liquid liquid, float amount){
Block block = tile.link().block();
block.handleLiquid(tile.link(), source, liquid, amount);
}
@Override
public boolean acceptLiquid(Tile tile, Tile source, Liquid liquid, float amount){
Block block = tile.link().block();
return block.hasLiquids && block.acceptLiquid(tile.link(), source, liquid, amount);
}
@Override
public Tile linked(Tile tile){
return tile.getNearby(-dx, -dy);

View File

@@ -60,6 +60,11 @@ public class ForceProjector extends Block{
consumes.add(new ConsumeLiquidFilter(liquid -> liquid.temperature <= 0.5f && liquid.flammability < 0.1f, 0.1f)).boost().update(false);
}
@Override
public boolean outputsItems(){
return false;
}
@Override
public void load(){
super.load();

View File

@@ -45,6 +45,11 @@ public class MendProjector extends Block{
hasItems = true;
}
@Override
public boolean outputsItems(){
return false;
}
@Override
public void load(){
super.load();

View File

@@ -43,6 +43,11 @@ public class OverdriveProjector extends Block{
canOverdrive = false;
}
@Override
public boolean outputsItems(){
return false;
}
@Override
public void load(){
super.load();

View File

@@ -42,6 +42,7 @@ public class Junction extends Block{
Item item = content.item(BufferItem.item(l));
Tile dest = tile.getNearby(i);
if(dest != null) dest = dest.link();
//skip blocks that don't want the item, keep waiting until they do
if(dest == null || !dest.block().acceptItem(item, dest, tile)){