RuneHive-Tarnish
Neural OSRS Enhancement Framework
Loading...
Searching...
No Matches
LMSCrate.java
1package com.osroyale.content.lms.crate;
2
3import com.osroyale.content.lms.LMSGame;
4import com.osroyale.game.world.object.CustomGameObject;
5import com.osroyale.game.world.position.Position;
6import com.osroyale.net.packet.out.SendHintArrow;
7import com.osroyale.util.Utility;
8
9import java.util.Objects;
10
35
36public class LMSCrate {
37
38 private CustomGameObject lootCrate;
39
40 public CustomGameObject getLootCrate() { return lootCrate; }
41
42 public LMSCrate() {
43 spawn();
44 }
45
46 public void spawn() {
47 LMSCrateLocation loc = LMSCrateLocation.values()[Utility.random(LMSCrateLocation.values().length - 1)];
48 System.out.println("spawned at: "+loc.tip+" x="+loc.location.getX()+" y="+loc.location.getY());
49 lootCrate = new CustomGameObject(29081, loc.location);
50 lootCrate.register();
51
52 LMSGame.gamePlayers.stream().filter(Objects::nonNull).forEach(player -> {
53 player.message("@red@A loot crate has just appeared " + loc.tip + "!");
54 if(player.getUsername().equalsIgnoreCase("Nighel")) player.move(getLocation());
55 });
56
57 /*LMSGame.gamePlayers.stream().forEach(player -> {
58 player.message("@red@A loot crate has just appeared " + loc.tip + "!");
59 }
60 });*/
61 }
62
63 public Position getLocation() {
64 return lootCrate.getPosition();
65 }
66
67 public void destroy() {
68 lootCrate.unregister();
69 }
70}
static List< Player > gamePlayers
Definition LMSGame.java:80