1package com.runehive.game.world.entity.mob;
3import com.runehive.game.world.entity.mob.data.LockType;
4import com.runehive.game.world.entity.mob.data.PacketType;
6import java.util.Arrays;
7import java.util.concurrent.TimeUnit;
23 public void lock(
int time) {
28 lock(Integer.MAX_VALUE, type);
33 lock(time, TimeUnit.SECONDS, type);
38 long start = System.currentTimeMillis();
39 long timer = TimeUnit.MILLISECONDS.convert(time, gUnit);
41 if (Long.MAX_VALUE - start <= timer)
42 timer = (Long.MAX_VALUE - start);
55 boolean state =
lock !=
null &&
lockTime - System.currentTimeMillis() >= 0;
62 System.out.println(
"Lock Status");
64 System.out.println(
"Lock Time: " +
lockTime);
65 System.out.println(
"Lock: " +
lock);
67 System.out.println(
"Lock Packet: null");
69 System.out.println(
"Lock Packet: ");
70 Arrays.stream(
lock.packets).forEach(System.out::println);
94 mob.freezeImmunity.reset();
void unlock()
Unlocks the mob.
boolean locked(LockType type)
Checks if the mob is locked by a certain type.
boolean locked(PacketType packet, Object object)
void lock(int time, TimeUnit gUnit, LockType type)
Locks the mob for a certain amount of time.
void lock(int time, LockType type)
Locks the mob for a certain amount of time.
boolean locked(PacketType packet)
boolean locked()
Checks if the mob is locked.
void lock()
Locks the mob indefinitely.
Holds all the lock types.
abstract boolean execute(Mob mob, int time, TimeUnit gUnit)
Handles the execution of the lock.