-
Notifications
You must be signed in to change notification settings - Fork 53
Expand file tree
/
Copy pathServerEventsHandler.java
More file actions
519 lines (458 loc) · 23.6 KB
/
Copy pathServerEventsHandler.java
File metadata and controls
519 lines (458 loc) · 23.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
package noppes.npcs;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.relauncher.Side;
import kamkeel.npcs.controllers.SyncController;
import kamkeel.npcs.network.PacketHandler;
import kamkeel.npcs.network.enums.EnumSoundOperation;
import kamkeel.npcs.network.enums.EnumSyncAction;
import kamkeel.npcs.network.enums.EnumSyncType;
import kamkeel.npcs.network.packets.data.ClonerPacket;
import kamkeel.npcs.network.packets.data.MarkDataPacket;
import kamkeel.npcs.network.packets.data.SoundManagementPacket;
import kamkeel.npcs.network.packets.data.VillagerListPacket;
import kamkeel.npcs.network.packets.data.gui.GuiOpenPacket;
import kamkeel.npcs.network.packets.data.large.SyncPacket;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.passive.EntityVillager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.ChatComponentTranslation;
import net.minecraft.util.MathHelper;
import net.minecraft.util.StatCollector;
import net.minecraft.village.MerchantRecipeList;
import net.minecraftforge.event.entity.EntityJoinWorldEvent;
import net.minecraftforge.event.entity.living.LivingAttackEvent;
import net.minecraftforge.event.entity.living.LivingDeathEvent;
import net.minecraftforge.event.entity.living.LivingEvent;
import net.minecraftforge.event.entity.living.LivingHurtEvent;
import net.minecraftforge.event.entity.player.EntityInteractEvent;
import net.minecraftforge.event.entity.player.PlayerEvent;
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
import net.minecraftforge.event.entity.player.PlayerInteractEvent.Action;
import net.minecraftforge.event.terraingen.PopulateChunkEvent;
import noppes.npcs.blocks.tiles.ITileIcon;
import noppes.npcs.config.ConfigDebug;
import noppes.npcs.config.ConfigMain;
import noppes.npcs.constants.EnumGuiType;
import noppes.npcs.constants.EnumPartyObjectives;
import noppes.npcs.constants.EnumQuestType;
import noppes.npcs.constants.EnumRoleType;
import noppes.npcs.controllers.PartyController;
import noppes.npcs.controllers.ServerCloneController;
import noppes.npcs.controllers.data.Animation;
import noppes.npcs.controllers.data.AnimationData;
import noppes.npcs.controllers.data.Line;
import noppes.npcs.controllers.data.MarkData;
import noppes.npcs.controllers.data.Party;
import noppes.npcs.controllers.data.PlayerData;
import noppes.npcs.controllers.data.PlayerQuestData;
import noppes.npcs.controllers.data.Quest;
import noppes.npcs.controllers.data.QuestData;
import noppes.npcs.entity.EntityNPCInterface;
import noppes.npcs.items.ItemExcalibur;
import noppes.npcs.items.ItemShield;
import noppes.npcs.items.ItemSoulstoneEmpty;
import noppes.npcs.quests.QuestKill;
import noppes.npcs.roles.RoleFollower;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
public class ServerEventsHandler {
public static EntityVillager Merchant;
public static Entity mounted;
@SubscribeEvent
public void invoke(EntityInteractEvent event) {
ItemStack item = event.entityPlayer.getCurrentEquippedItem();
if (item == null)
return;
boolean isRemote = event.entityPlayer.worldObj.isRemote;
boolean npcInteracted = event.target instanceof EntityNPCInterface;
if (!isRemote && ConfigMain.OpsOnly && !MinecraftServer.getServer().getConfigurationManager().func_152596_g(event.entityPlayer.getGameProfile())) {
return;
}
if (!isRemote && item.getItem() == CustomItems.soulstoneEmpty) {
if (event.target instanceof EntityLivingBase) {
((ItemSoulstoneEmpty) item.getItem()).store((EntityLivingBase) event.target, item, event.entityPlayer);
if (ConfigDebug.PlayerLogging && FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER) {
LogWriter.script(String.format("[%s] (Player) %s PICKED ENTITY %s", "SOULSTONE", event.entityPlayer.getCommandSenderName(), event.target));
}
}
}
if (item.getItem() == CustomItems.wand && npcInteracted && !isRemote) {
if (!CustomNpcsPermissions.hasPermission(event.entityPlayer, CustomNpcsPermissions.NPC_GUI)) {
return;
}
event.setCanceled(true);
NoppesUtilServer.sendOpenGui(event.entityPlayer, EnumGuiType.MainMenuDisplay, (EntityNPCInterface) event.target);
if (ConfigDebug.PlayerLogging && FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER) {
LogWriter.script(String.format("[%s] (Player) %s OPEN NPC %s (%s, %s, %s) [%s]", "WAND", event.entityPlayer.getCommandSenderName(), ((EntityNPCInterface) (event.target)).display.getName(), (int) (event.target).posX, (int) (event.target).posY, (int) (event.target).posZ, (event.target).worldObj.getWorldInfo().getWorldName()));
}
} else if (item.getItem() == CustomItems.cloner && !isRemote && !(event.target instanceof EntityPlayer)) {
if (!CustomNpcsPermissions.hasPermission(event.entityPlayer, CustomNpcsPermissions.TOOL_CLONER))
return;
NBTTagCompound compound = new NBTTagCompound();
if (!event.target.writeToNBTOptional(compound))
return;
PlayerData data = PlayerData.get(event.entityPlayer);
ServerCloneController.Instance.cleanTags(compound);
PacketHandler.Instance.sendToPlayer(new ClonerPacket(compound), (EntityPlayerMP) event.entityPlayer);
data.cloned = compound;
if (event.target instanceof EntityNPCInterface) {
NoppesUtilServer.setEditingNpc(event.entityPlayer, (EntityNPCInterface) event.target);
}
event.setCanceled(true);
} else if (item.getItem() == CustomItems.scripter && !isRemote && npcInteracted) {
if (!CustomNpcsPermissions.hasPermission(event.entityPlayer, CustomNpcsPermissions.TOOL_SCRIPTER))
return;
NoppesUtilServer.setEditingNpc(event.entityPlayer, (EntityNPCInterface) event.target);
event.setCanceled(true);
GuiOpenPacket.openGUI((EntityPlayerMP) event.entityPlayer, EnumGuiType.Script, 0, 0, 0);
if (ConfigDebug.PlayerLogging && FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER) {
LogWriter.script(String.format("[%s] (Player) %s OPEN NPC %s (%s, %s, %s) [%s]", "SCRIPTER", event.entityPlayer.getCommandSenderName(), ((EntityNPCInterface) (event.target)).display.getName(), (int) (event.target).posX, (int) (event.target).posY, (int) (event.target).posZ, (event.target).worldObj.getWorldInfo().getWorldName()));
}
} else if (item.getItem() == CustomItems.mount) {
if (!CustomNpcsPermissions.hasPermission(event.entityPlayer, CustomNpcsPermissions.TOOL_MOUNTER))
return;
event.setCanceled(true);
mounted = event.target;
if (isRemote)
CustomNpcs.proxy.openGui(MathHelper.floor_double(mounted.posX), MathHelper.floor_double(mounted.posY), MathHelper.floor_double(mounted.posZ), EnumGuiType.MobSpawnerMounter, event.entityPlayer);
} else if (item.getItem() == CustomItems.wand && event.target instanceof EntityVillager) {
if (!CustomNpcsPermissions.hasPermission(event.entityPlayer, CustomNpcsPermissions.EDIT_VILLAGER))
return;
event.setCanceled(true);
Merchant = (EntityVillager) event.target;
if (!isRemote) {
EntityPlayerMP player = (EntityPlayerMP) event.entityPlayer;
player.openGui(CustomNpcs.instance, EnumGuiType.MerchantAdd.ordinal(), player.worldObj, 0, 0, 0);
MerchantRecipeList merchantrecipelist = Merchant.getRecipes(player);
if (merchantrecipelist != null) {
PacketHandler.Instance.sendToPlayer(new VillagerListPacket(merchantrecipelist), player);
}
}
}
}
@SubscribeEvent
public void partyDamagedEvent(LivingAttackEvent event) {
if (!(event.source != null && event.source.getEntity() instanceof EntityPlayer) || !(event.entityLiving instanceof EntityPlayer) || FMLCommonHandler.instance().getEffectiveSide().isClient())
return;
// Check for Friendly Fire
if (ConfigMain.PartyFriendlyFireEnabled) {
EntityPlayer sourcePlayer = (EntityPlayer) event.source.getEntity();
PlayerData playerData = PlayerData.get(sourcePlayer);
PlayerData targetData = PlayerData.get((EntityPlayer) event.entityLiving);
if (playerData.partyUUID != null && playerData.partyUUID.equals(targetData.partyUUID)) {
Party party = PartyController.Instance().getParty(playerData.partyUUID);
if (party != null && !party.friendlyFire())
event.setCanceled(true);
}
}
}
@SubscribeEvent
public void invoke(LivingHurtEvent event) {
if (!(event.entityLiving instanceof EntityPlayer))
return;
EntityPlayer player = (EntityPlayer) event.entityLiving;
if (event.source.isUnblockable() || event.source.isFireDamage())
return;
if (!player.isBlocking())
return;
ItemStack item = player.getCurrentEquippedItem();
if (item == null || !(item.getItem() instanceof ItemShield))
return;
if (((ItemShield) item.getItem()).material.getDamageVsEntity() < player.getRNG().nextInt(9))
return;
float damage = item.getItemDamage() + event.ammount;
item.damageItem((int) event.ammount, player);
if (damage > item.getMaxDamage())
event.ammount = damage - item.getMaxDamage();
else {
event.ammount = 0;
event.setCanceled(true);
}
}
@SubscribeEvent
public void invoke(PlayerInteractEvent event) {
EntityPlayer player = event.entityPlayer;
Block block = player.worldObj.getBlock(event.x, event.y, event.z);
if (event.action == Action.LEFT_CLICK_BLOCK && player.getHeldItem() != null && player.getHeldItem().getItem() == CustomItems.teleporter) {
event.setCanceled(true);
}
if (block == Blocks.crafting_table && event.action == Action.RIGHT_CLICK_BLOCK && !player.worldObj.isRemote) {
PacketHandler.Instance.sendToPlayer(new SyncPacket(
EnumSyncType.WORKBENCH_RECIPES,
EnumSyncAction.RELOAD,
-1,
SyncController.getCurrentRevision(EnumSyncType.WORKBENCH_RECIPES),
SyncController.workbenchNBT()
), (EntityPlayerMP) player);
}
if (block == CustomItems.carpentyBench && event.action == Action.RIGHT_CLICK_BLOCK && !player.worldObj.isRemote) {
PacketHandler.Instance.sendToPlayer(new SyncPacket(
EnumSyncType.CARPENTRY_RECIPES,
EnumSyncAction.RELOAD,
-1,
SyncController.getCurrentRevision(EnumSyncType.CARPENTRY_RECIPES),
SyncController.carpentryNBT()
), (EntityPlayerMP) player);
}
if ((block == CustomItems.banner || block == CustomItems.wallBanner || block == CustomItems.sign) && event.action == Action.RIGHT_CLICK_BLOCK) {
ItemStack item = player.inventory.getCurrentItem();
if (item == null || item.getItem() == null)
return;
int y = event.y;
int meta = player.worldObj.getBlockMetadata(event.x, event.y, event.z);
if (meta >= 7)
y--;
ITileIcon tile = (ITileIcon) player.worldObj.getTileEntity(event.x, y, event.z);
if (!tile.canEdit()) {
if (item.getItem() == CustomItems.wand && CustomNpcsPermissions.hasPermission(player, CustomNpcsPermissions.EDIT_BLOCKS)) {
tile.setTime(System.currentTimeMillis());
if (player.worldObj.isRemote)
player.addChatComponentMessage(new ChatComponentTranslation("availability.editIcon"));
}
return;
}
if (!player.worldObj.isRemote) {
tile.setIcon(item.copy());
player.worldObj.markBlockForUpdate(event.x, y, event.z);
event.setCanceled(true);
}
}
}
@SubscribeEvent
public void invoke(LivingDeathEvent event) {
if (event.entityLiving.worldObj.isRemote)
return;
if (event.source.getEntity() != null) {
if (event.source.getEntity() instanceof EntityPlayer) {
doExcalibur((EntityPlayer) event.source.getEntity(), event.entityLiving);
}
if (event.source.getEntity() instanceof EntityNPCInterface) {
EntityNPCInterface npc = (EntityNPCInterface) event.source.getEntity();
Line line = npc.advanced.getKillLine();
if (line != null)
npc.saySurrounding(line.formatTarget(event.entityLiving));
EventHooks.onNPCKilledEntity(npc, event.entityLiving);
}
EntityPlayer player = null;
if (event.source.getEntity() instanceof EntityPlayer)
player = (EntityPlayer) event.source.getEntity();
else if (event.source.getEntity() instanceof EntityNPCInterface && ((EntityNPCInterface) event.source.getEntity()).advanced.role == EnumRoleType.Follower)
player = ((RoleFollower) ((EntityNPCInterface) event.source.getEntity()).roleInterface).owner;
if (player != null) {
doQuest(player, event.entityLiving, true);
if (event.entityLiving instanceof EntityNPCInterface)
doFactionPoints(player, (EntityNPCInterface) event.entityLiving);
}
}
if (event.entityLiving instanceof EntityPlayer) {
PlayerData data = PlayerData.get((EntityPlayer) event.entityLiving);
data.save();
}
}
@SubscribeEvent
public void onPlayerClone(PlayerEvent.Clone event) {
if (event.entity.worldObj.isRemote)
return;
NBTTagCompound storedData = event.original.getEntityData().getCompoundTag("CNPCStoredData");
if (!storedData.hasNoTags()) {
event.entityPlayer.getEntityData().setTag("CNPCStoredData", storedData);
}
}
@SubscribeEvent
public void onPlayerRespawn(cpw.mods.fml.common.gameevent.PlayerEvent.PlayerRespawnEvent event) {
if (event.player == null || event.player.worldObj == null || event.player.worldObj.isRemote)
return;
PlayerData data = PlayerData.get(event.player);
data.setGUIOpen(false);
data.editingNpc = null;
}
private void doExcalibur(EntityPlayer player, EntityLivingBase entity) {
ItemStack item = player.getCurrentEquippedItem();
if (item == null || item.getItem() != CustomItems.excalibur)
return;
PacketHandler.Instance.sendToPlayer(new SoundManagementPacket(EnumSoundOperation.PLAY_MUSIC, "customnpcs:songs.excalibur"), (EntityPlayerMP) player);
player.addChatMessage(new ChatComponentTranslation("<" + StatCollector.translateToLocal(item.getItem().getUnlocalizedName() + ".name") + "> " + ItemExcalibur.quotes[player.getRNG().nextInt(ItemExcalibur.quotes.length)]));
}
private void doFactionPoints(EntityPlayer player, EntityNPCInterface npc) {
npc.advanced.factions.addPoints(player);
}
private void doQuest(EntityPlayer player, EntityLivingBase entity, boolean all) {
PlayerData playerData = PlayerData.get(player);
if (playerData == null) {
return;
}
PlayerQuestData questData = playerData.questData;
if (questData == null) {
return;
}
boolean checkCompletion = false;
String entityName = EntityList.getEntityString(entity);
if (entity instanceof EntityPlayer)
entityName = "Player";
Party party = playerData.getPlayerParty();
Quest partyQuest = null;
if (party != null) {
if (party.getQuestData() != null) {
partyQuest = party.getQuestData().quest;
if (partyQuest != null && (partyQuest.type == EnumQuestType.Kill || partyQuest.type == EnumQuestType.AreaKill))
doPartyQuest(player, party, entity);
else
partyQuest = null;
}
}
ArrayList<QuestData> activeQuestValues = new ArrayList<>(questData.activeQuests.values());
for (QuestData data : activeQuestValues) {
if (data.quest == null) {
continue;
}
if (data.quest.type != EnumQuestType.Kill && data.quest.type != EnumQuestType.AreaKill)
continue;
if (partyQuest != null && partyQuest.getId() == data.quest.getId())
continue;
if (data.quest.partyOptions.allowParty && data.quest.partyOptions.onlyParty)
continue;
if (data.quest.type == EnumQuestType.AreaKill && all) {
List<EntityPlayer> list = player.worldObj.getEntitiesWithinAABB(EntityPlayer.class, entity.boundingBox.expand(10, 10, 10));
for (EntityPlayer pl : list)
if (pl != player)
doQuest(pl, entity, false);
}
String name = entityName;
QuestKill quest = (QuestKill) data.quest.questInterface;
Class entityType = EntityNPCInterface.class;
if (quest.targetType == 2) {
try {
entityType = Class.forName(quest.customTargetType);
} catch (ClassNotFoundException notFoundException) {
continue;
}
}
if (quest.targetType > 0 && !(entityType.isInstance(entity)))
continue;
if (entity.getCommandSenderName() != null && quest.targets != null && quest.targets.containsKey(entity.getCommandSenderName())) {
name = entity.getCommandSenderName();
} else if (entity.getCommandSenderName() == null || quest.targets == null || !quest.targets.containsKey(name)) {
continue;
}
checkCompletion = true;
HashMap<String, Integer> killed = quest.getKilled(data);
if (!killed.containsKey(name)) {
killed.put(name, 1);
} else if (killed.get(name) < quest.targets.get(name)) {
int amount = killed.get(name);
killed.put(name, amount + 1);
}
quest.setKilled(data, killed);
playerData.updateClient = true;
}
if (!checkCompletion)
return;
questData.checkQuestCompletion(playerData, EnumQuestType.Kill);
}
private void doPartyQuest(EntityPlayer player, Party party, EntityLivingBase entity) {
PlayerData pdata = PlayerData.get(player);
QuestData data = party.getQuestData();
if (data == null)
return;
if (pdata == null)
return;
if (data.quest.type != EnumQuestType.Kill && data.quest.type != EnumQuestType.AreaKill)
return;
String name = EntityList.getEntityString(entity);
if (entity instanceof EntityPlayer)
name = "Player";
QuestKill quest = (QuestKill) data.quest.questInterface;
if (data.quest.partyOptions.objectiveRequirement == EnumPartyObjectives.Leader && !party.getLeaderUUID().equals(player.getUniqueID()))
return;
Class entityType = EntityNPCInterface.class;
if (quest.targetType == 2) {
try {
entityType = Class.forName(quest.customTargetType);
} catch (ClassNotFoundException notFoundException) {
return;
}
}
if (quest.targetType > 0 && !(entityType.isInstance(entity)))
return;
if (quest.targets.containsKey(entity.getCommandSenderName()))
name = entity.getCommandSenderName();
else if (!quest.targets.containsKey(name))
return;
if (data.quest.partyOptions.objectiveRequirement == EnumPartyObjectives.All) {
HashMap<String, Integer> killed = quest.getPlayerKilled(data, player.getCommandSenderName());
if (!killed.containsKey(name)) {
killed.put(name, 1);
} else if (killed.get(name) < quest.targets.get(name)) {
int amount = killed.get(name);
killed.put(name, amount + 1);
}
quest.setPlayerKilled(data, killed, player.getCommandSenderName());
} else {
HashMap<String, Integer> killed = quest.getKilled(data);
if (!killed.containsKey(name)) {
killed.put(name, 1);
} else if (killed.get(name) < quest.targets.get(name)) {
int amount = killed.get(name);
killed.put(name, amount + 1);
}
quest.setKilled(data, killed);
pdata.updateClient = true;
}
PartyController.Instance().pingPartyQuestObjectiveUpdate(party);
PartyController.Instance().checkQuestCompletion(party, EnumQuestType.Kill);
}
@SubscribeEvent
public void world(PlayerEvent.SaveToFile event) {
PlayerData data = PlayerData.get((EntityPlayer) event.entity);
data.save();
}
@SubscribeEvent
public void world(EntityJoinWorldEvent event) {
if (event.world.isRemote || !(event.entity instanceof EntityPlayer))
return;
PlayerData data = PlayerData.get((EntityPlayer) event.entity);
data.updateCompanion(event.world);
}
@SubscribeEvent
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 EntityPlayerMP || event.target instanceof EntityNPCInterface) || event.target.worldObj.isRemote)
return;
AnimationData animationData = AnimationData.getData(event.target);
if (animationData != null && animationData.isClientAnimating()) {
AnimationData playerAnimData = AnimationData.getData(event.entityPlayer);
if (playerAnimData != null) {
Animation currentAnimation = animationData.currentClientAnimation;
NBTTagCompound compound = currentAnimation.writeToNBT();
playerAnimData.viewAnimation(currentAnimation, animationData, compound,
animationData.isClientAnimating(), currentAnimation.currentFrame, currentAnimation.currentFrameTime);
}
}
if (event.target instanceof EntityNPCInterface) {
MarkData data = MarkData.get((EntityNPCInterface) event.target);
if (data.marks.isEmpty())
return;
PacketHandler.Instance.sendToPlayer(new MarkDataPacket(event.target.getEntityId(), data.getNBT()), (EntityPlayerMP) event.entityPlayer);
}
}
@SubscribeEvent
public void entityTick(LivingEvent.LivingUpdateEvent event) {
AnimationData data = AnimationData.getData(event.entityLiving);
if (data != null) {
data.increaseTime();
}
}
}