Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -89,7 +89,7 @@ public class Units{
|
|||||||
|
|
||||||
/** @return whether a new instance of a unit of this team can be created. */
|
/** @return whether a new instance of a unit of this team can be created. */
|
||||||
public static boolean canCreate(Team team, UnitType type){
|
public static boolean canCreate(Team team, UnitType type){
|
||||||
return team.data().countType(type) < getCap(team) && !type.isBanned();
|
return !type.useUnitCap || (team.data().countType(type) < getCap(team) && !type.isBanned());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getCap(Team team){
|
public static int getCap(Team team){
|
||||||
|
|||||||
@@ -69,10 +69,10 @@ public class Reconstructor extends UnitBlock{
|
|||||||
Core.bundle.format("bar.unitcap",
|
Core.bundle.format("bar.unitcap",
|
||||||
Fonts.getUnicodeStr(e.unit().name),
|
Fonts.getUnicodeStr(e.unit().name),
|
||||||
e.team.data().countType(e.unit()),
|
e.team.data().countType(e.unit()),
|
||||||
Units.getStringCap(e.team)
|
e.unit() == null || e.unit().useUnitCap ? Units.getStringCap(e.team) : "∞"
|
||||||
),
|
),
|
||||||
() -> Pal.power,
|
() -> Pal.power,
|
||||||
() -> e.unit() == null ? 0f : (float)e.team.data().countType(e.unit()) / Units.getCap(e.team)
|
() -> e.unit() == null ? 0f : (e.unit().useUnitCap ? (float)e.team.data().countType(e.unit()) / Units.getCap(e.team) : 1f)
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -99,10 +99,10 @@ public class UnitAssembler extends PayloadBlock{
|
|||||||
Core.bundle.format("bar.unitcap",
|
Core.bundle.format("bar.unitcap",
|
||||||
Fonts.getUnicodeStr(e.unit().name),
|
Fonts.getUnicodeStr(e.unit().name),
|
||||||
e.team.data().countType(e.unit()),
|
e.team.data().countType(e.unit()),
|
||||||
Units.getStringCap(e.team)
|
e.unit().useUnitCap ? Units.getStringCap(e.team) : "∞"
|
||||||
),
|
),
|
||||||
() -> Pal.power,
|
() -> Pal.power,
|
||||||
() -> (float)e.team.data().countType(e.unit()) / Units.getCap(e.team)
|
() -> e.unit().useUnitCap ? ((float)e.team.data().countType(e.unit()) / Units.getCap(e.team)) : 1f
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -54,10 +54,10 @@ public class UnitCargoLoader extends Block{
|
|||||||
Core.bundle.format("bar.unitcap",
|
Core.bundle.format("bar.unitcap",
|
||||||
Fonts.getUnicodeStr(unitType.name),
|
Fonts.getUnicodeStr(unitType.name),
|
||||||
e.team.data().countType(unitType),
|
e.team.data().countType(unitType),
|
||||||
Units.getStringCap(e.team)
|
unitType.useUnitCap ? Units.getStringCap(e.team) : "∞"
|
||||||
),
|
),
|
||||||
() -> Pal.power,
|
() -> Pal.power,
|
||||||
() -> (float)e.team.data().countType(unitType) / Units.getCap(e.team)
|
() -> unitType.useUnitCap ? (float)e.team.data().countType(unitType) / Units.getCap(e.team) : 1f
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -92,10 +92,10 @@ public class UnitFactory extends UnitBlock{
|
|||||||
Core.bundle.format("bar.unitcap",
|
Core.bundle.format("bar.unitcap",
|
||||||
Fonts.getUnicodeStr(e.unit().name),
|
Fonts.getUnicodeStr(e.unit().name),
|
||||||
e.team.data().countType(e.unit()),
|
e.team.data().countType(e.unit()),
|
||||||
Units.getStringCap(e.team)
|
e.unit() == null ? Units.getStringCap(e.team) : (e.unit().useUnitCap ? Units.getStringCap(e.team) : "∞")
|
||||||
),
|
),
|
||||||
() -> Pal.power,
|
() -> Pal.power,
|
||||||
() -> e.unit() == null ? 0f : (float)e.team.data().countType(e.unit()) / Units.getCap(e.team)
|
() -> e.unit() == null ? 0f : (e.unit().useUnitCap ? (float)e.team.data().countType(e.unit()) / Units.getCap(e.team) : 1f)
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -362,4 +362,4 @@ public class UnitFactory extends UnitBlock{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -258,6 +258,6 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Atomic",
|
"name": "Atomic",
|
||||||
"address": ["atomic-lab.ddns.net:25709", "atomic-lab.ddns.net:25907", "atomic-de.ddns.net:35845"]
|
"address": ["atomic-de.ddns.net:35199", "atomic-de.ddns.net:35176", "atomic-de.ddns.net:35845"]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user