mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-20 19:19:43 +00:00
Large Unused Attribute Push
This commit is contained in:
1 parent
4faa851078
commit
5818060656
13 files changed
+553
No files matched your search
@@ -0,0 +1,21 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user