diff --git a/build.gradle b/build.gradle index 9ea249e419..ffdbefc4bd 100644 --- a/build.gradle +++ b/build.gradle @@ -26,7 +26,7 @@ allprojects { appName = 'Mindustry' gdxVersion = '1.9.8' roboVMVersion = '2.3.0' - uCoreVersion = 'c28462b127' + uCoreVersion = '1d353d76e9' getVersionString = { String buildVersion = getBuildVersion() diff --git a/core/src/io/anuke/mindustry/entities/Unit.java b/core/src/io/anuke/mindustry/entities/Unit.java index e234c4936a..71d1fe1dac 100644 --- a/core/src/io/anuke/mindustry/entities/Unit.java +++ b/core/src/io/anuke/mindustry/entities/Unit.java @@ -33,17 +33,11 @@ import static io.anuke.mindustry.Vars.state; import static io.anuke.mindustry.Vars.world; public abstract class Unit extends DestructibleEntity implements SaveTrait, TargetTrait, SyncTrait, DrawTrait, TeamTrait, CarriableTrait, InventoryTrait{ - /** - * total duration of hit flash effect - */ + /**Total duration of hit flash effect*/ public static final float hitDuration = 9f; - /** - * Percision divisor of velocity, used when writing. For example a value of '2' would mean the percision is 1/2 = 0.5-size chunks. - */ + /**Percision divisor of velocity, used when writing. For example a value of '2' would mean the percision is 1/2 = 0.5-size chunks.*/ public static final float velocityPercision = 8f; - /** - * Maximum absolute value of a velocity vector component. - */ + /**Maximum absolute value of a velocity vector component.*/ public static final float maxAbsVelocity = 127f / velocityPercision; private static final Vector2 moveVector = new Vector2(); diff --git a/core/src/io/anuke/mindustry/entities/units/UnitDrops.java b/core/src/io/anuke/mindustry/entities/units/UnitDrops.java index 2ba240de70..4ea154cae6 100644 --- a/core/src/io/anuke/mindustry/entities/units/UnitDrops.java +++ b/core/src/io/anuke/mindustry/entities/units/UnitDrops.java @@ -3,6 +3,7 @@ package io.anuke.mindustry.entities.units; import io.anuke.mindustry.Vars; import io.anuke.mindustry.content.Items; import io.anuke.mindustry.entities.effect.ItemDrop; +import io.anuke.mindustry.game.Team; import io.anuke.mindustry.type.Item; import io.anuke.ucore.util.Mathf; @@ -11,7 +12,7 @@ public class UnitDrops{ private static Item[] dropTable; public static void dropItems(BaseUnit unit){ - if(Vars.itemGroup.size() > maxItems){ + if(Vars.itemGroup.size() > maxItems || unit.getTeam() != Team.red){ return; } diff --git a/core/src/io/anuke/mindustry/world/blocks/BuildBlock.java b/core/src/io/anuke/mindustry/world/blocks/BuildBlock.java index 49e26841b2..1836b9dba8 100644 --- a/core/src/io/anuke/mindustry/world/blocks/BuildBlock.java +++ b/core/src/io/anuke/mindustry/world/blocks/BuildBlock.java @@ -217,6 +217,9 @@ public class BuildBlock extends Block{ if(recipe != null){ ItemStack[] requirements = recipe.requirements; + if(requirements.length != accumulator.length || totalAccumulator.length != requirements.length){ + setDeconstruct(previous); + } for(int i = 0; i < requirements.length; i++){ accumulator[i] += Math.min(requirements[i].amount * amount / 2f, requirements[i].amount/2f - totalAccumulator[i]); //add scaled amount progressed to the accumulator diff --git a/core/src/io/anuke/mindustry/world/blocks/power/PowerNode.java b/core/src/io/anuke/mindustry/world/blocks/power/PowerNode.java index 3759f48182..c1eca5d14d 100644 --- a/core/src/io/anuke/mindustry/world/blocks/power/PowerNode.java +++ b/core/src/io/anuke/mindustry/world/blocks/power/PowerNode.java @@ -227,7 +227,7 @@ public class PowerNode extends PowerBlock{ } protected boolean shouldDistribute(Tile tile, Tile other){ - return other != null && other.getTeamID() == tile.getTeamID() && other.entity.power.amount / other.block().powerCapacity <= tile.entity.power.amount / powerCapacity && + return other != null && other.entity != null && other.block().hasPower && other.getTeamID() == tile.getTeamID() && other.entity.power.amount / other.block().powerCapacity <= tile.entity.power.amount / powerCapacity && !(other.block() instanceof PowerGenerator); //do not distribute to power generators }