mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 23:37:32 +00:00
21 lines
679 B
Java
21 lines
679 B
Java
package noppes.npcs.attribute;
|
|||
|
|
|
||
|
|
import net.minecraft.server.MinecraftServer;
|
||
|
|
import net.minecraft.entity.player.EntityPlayer;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Tick handler that runs every tick and, every 10 ticks, checks all players for equipment changes.
|
||
|
|
*/
|
||
|
|
public class PlayerAttributeTickHandler {
|
||
|
|
private int tickCount = 0;
|
||
|
|
|
||
|
|
public void onTick() {
|
||
|
|
tickCount++;
|
||
|
|
if (tickCount % 10 == 0) {
|
||
|
|
for (Object o : MinecraftServer.getServer().getConfigurationManager().playerEntityList) {
|
||
|
|
EntityPlayer player = (EntityPlayer) o;
|
||
|
|
PlayerAttributeManager.getTracker(player.getUniqueID()).updateIfChanged(player);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|