mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-01-26 06:22:17 -08:00
Cleanup
This commit is contained in:
parent
7472fe5c12
commit
e4d3c8fb05
1 changed files with 4 additions and 4 deletions
|
|
@ -758,7 +758,7 @@ public class UnitType extends UnlockableContent implements Senseable{
|
|||
}
|
||||
}
|
||||
|
||||
protected void checkEntityMapping(){
|
||||
protected void checkEntityMapping(Unit example){
|
||||
if(constructor == null) throw new IllegalArgumentException(Strings.format("""
|
||||
No constructor set up for unit '@': Assign `constructor = [your unit constructor]`. Vanilla defaults are:
|
||||
"flying": UnitEntity::create
|
||||
|
|
@ -777,8 +777,6 @@ public class UnitType extends UnlockableContent implements Senseable{
|
|||
// In most cases, if the constructor is a Vanilla class, things should work just fine.
|
||||
if(EntityMapping.map(name) == null) EntityMapping.nameMap.put(name, constructor);
|
||||
|
||||
Unit example = constructor.get();
|
||||
|
||||
// Sanity checks; this is an EXTREMELY COMMON pitfalls Java modders fall into.
|
||||
int classId = example.classId();
|
||||
if(
|
||||
|
|
@ -801,7 +799,9 @@ public class UnitType extends UnlockableContent implements Senseable{
|
|||
public void init(){
|
||||
super.init();
|
||||
|
||||
checkEntityMapping();
|
||||
Unit example = constructor.get();
|
||||
|
||||
checkEntityMapping(example);
|
||||
|
||||
allowLegStep = example instanceof Legsc || example instanceof Crawlc;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue