return HackUpgradeRenderHandler.enabledForPlayer(PneumaticCraft.proxy.getPlayer());
}
@Override
public void addInfo(Entity entity, List<String> curInfo){
IHackableEntity hackable = HackableHandler.getHackableForEntity(entity, PneumaticCraft.proxy.getPlayer());
if(hackable != null) {
List<RenderTarget> targets = ((EntityTrackUpgradeHandler)HUDHandler.instance().getSpecificRenderer(EntityTrackUpgradeHandler.class)).getTargets();
int hackTime = 0;
for(RenderTarget target : targets) {
if(target.entity == entity) {
hackTime = target.getHackTime();
break;
}
}
if(hackTime == 0) {
hackable.addInfo(entity, curInfo, PneumaticCraft.proxy.getPlayer());
} else {
int requiredHackTime = hackable.getHackTime(entity, PneumaticCraft.proxy.getPlayer());
int percentageComplete = hackTime * 100 / requiredHackTime;
if(percentageComplete < 100) {
curInfo.add("Hacking... (" + percentageComplete + "%%)");
} else if(hackTime < requiredHackTime + 20) {
hackable.addPostHackInfo(entity, curInfo, PneumaticCraft.proxy.getPlayer());
} else {
hackable.addInfo(entity, curInfo, PneumaticCraft.proxy.getPlayer());
}
}
}
}