use of team.covertdragon.springfestival.module.fortune.fortunevaluesystem.machines.AbstractTileFVMachine in project SpringFestival by TeamCovertDragon.
the class FortuneValueManager method updatePlayerFortuneValue.
private void updatePlayerFortuneValue(EntityPlayerMP player) {
IFortuneValueSystem system = player.getCapability(CapabilityLoader.fortuneValue, null);
if (system != null) {
// Update player fortune level
system.addFortune(system.getIncreasingPoint());
system.setBufPoint(0);
// Tick FV machines
for (AbstractTileFVMachine machine : system.getFVMachines()) {
if (machine.getWorld().getTileEntity(machine.getPos()) == null) {
TASKS.add(new FortuneManagerActions.ActionDeleteMachine(machine, system));
continue;
}
if (system.shrinkFortune(machine.getRequiredFV())) {
machine.onFVProvided();
}
}
} else {
throw new RuntimeException("Unable to read fv system info for player " + player.getGameProfile().getName());
}
}
Aggregations