Object sense support / Bugfixes

This commit is contained in:
Anuken
2020-09-09 19:02:40 -04:00
parent c03e3f56aa
commit 5259969384
14 changed files with 101 additions and 23 deletions

View File

@@ -1226,6 +1226,13 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
return 0;
}
@Override
public Object senseObject(LAccess sensor){
if(sensor == LAccess.type) return block;
return noSensed;
}
@Override
public double sense(Content content){
if(content instanceof Item && items != null) return items.get((Item)content);

View File

@@ -85,6 +85,13 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
return 0;
}
@Override
public Object senseObject(LAccess sensor){
if(sensor == LAccess.type) return type;
return noSensed;
}
@Override
public double sense(Content content){
if(content == stack().item) return stack().amount;