-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathPotionTimeLock.java
More file actions
63 lines (51 loc) · 1.91 KB
/
PotionTimeLock.java
File metadata and controls
63 lines (51 loc) · 1.91 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
package com.teamwizardry.wizardry.common.potion;
// import com.teamwizardry.wizardry.common.module.effects.ModuleEffectTimeLock;
/**
* Created by Demoniaque.
*/
/*
@Mod.EventBusSubscriber
public class PotionTimeLock extends PotionBase {
public PotionTimeLock() {
super("time_lcok", true, 0x00003C);
}
@SubscribeEvent
public static void dropItem(ItemTossEvent event) {
if (event.getPlayer().isPotionActive(ModPotions.TIME_LOCK)) event.setCanceled(true);
}
@SubscribeEvent
public static void itemPick(PlayerEvent.ItemPickupEvent event) {
if (event.player.isPotionActive(ModPotions.TIME_LOCK)) event.setCanceled(true);
}
@SubscribeEvent
public static void tickPlayer(TickEvent.WorldTickEvent event) {
if (event.side != Side.SERVER) return;
if (event.phase != TickEvent.Phase.END) return;
for (UUID caster : ModuleEffectTimeLock.timeLockedEntities.keySet()) {
NemezTracker tracker = WizardryNemezManager.getOrCreateNemezDrive(event.world, caster);
for (UUID uuid : ModuleEffectTimeLock.timeLockedEntities.get(caster)) {
List<EntityLivingBase> entities = event.world.getEntities(EntityLivingBase.class, input -> {
if (input != null) {
return input.getUniqueID().equals(uuid);
}
return false;
});
if (entities.size() == 1) {
EntityLivingBase e = entities.get(0);
if (e.isPotionActive(ModPotions.TIME_LOCK)) {
tracker.trackEntity(e);
}
}
}
}
}
@Override
public void applyAttributesModifiersToEntity(EntityLivingBase entityLivingBaseIn, @Nonnull AbstractAttributeMap attributeMapIn, int amplifier) {
super.applyAttributesModifiersToEntity(entityLivingBaseIn, attributeMapIn, amplifier);
}
@Override
public void removeAttributesModifiersFromEntity(EntityLivingBase entityLivingBaseIn, @Nonnull AbstractAttributeMap attributeMapIn, int amplifier) {
super.removeAttributesModifiersFromEntity(entityLivingBaseIn, attributeMapIn, amplifier);
}
}
*/