mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-17 11:05:12 +00:00
MarkData to NPCs [1.12 Backport]
This commit is contained in:
1 parent
7f2a375323
commit
8ec795c98a
22 files changed
+473
-17
No files matched your search
@@ -403,4 +403,15 @@ public class ServerEventsHandler {
|
||||
public void populateChunk(PopulateChunkEvent.Post event){
|
||||
NPCSpawning.performWorldGenSpawning(event.world, event.chunkX, event.chunkZ, event.rand);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void playerTracking(PlayerEvent.StartTracking event){
|
||||
if(!(event.target instanceof EntityNPCInterface) || event.target.worldObj.isRemote)
|
||||
return;
|
||||
|
||||
MarkData data = MarkData.get((EntityNPCInterface) event.target);
|
||||
if(data.marks.isEmpty())
|
||||
return;
|
||||
Server.sendData((EntityPlayerMP)event.entityPlayer, EnumPacketClient.MARK_DATA, event.target.getEntityId(), data.getNBT());
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user