mirror of
https://github.com/2006-Scape/2006Scape.git
synced 2026-07-03 08:39:04 +00:00
5db6da334d
* Convert All Plugins To Java * Convert Rest Of Kt To Java & Remove Kt From Maven
33 lines
1.2 KiB
Java
33 lines
1.2 KiB
Java
package plugin.click.obj;
|
|
|
|
import com.rs2.event.EventContext;
|
|
import com.rs2.event.EventSubscriber;
|
|
import com.rs2.event.SubscribesTo;
|
|
import com.rs2.event.impl.ObjectFirstClickEvent;
|
|
import com.rs2.game.content.skills.core.Mining;
|
|
import com.rs2.game.players.Player;
|
|
import com.rs2.world.clip.Region;
|
|
|
|
@SubscribesTo(ObjectFirstClickEvent.class)
|
|
public final class ObjectFirstClick implements EventSubscriber<ObjectFirstClickEvent> {
|
|
|
|
@Override
|
|
public void subscribe(EventContext context, Player player, ObjectFirstClickEvent event) {
|
|
if (player.playerRights == 3) {
|
|
player.getPacketSender().sendMessage("[click= object], [type= first], [id= " + player.objectId + "], [location= x:" + player.objectX + " y:" + player.objectY + "]");
|
|
}
|
|
|
|
if (!Region.objectExists(player.objectId, player.objectX, player.objectY, player.heightLevel)) {
|
|
return;
|
|
}
|
|
|
|
// if its a rock we can mine, mine it
|
|
if (Mining.rockExists(event.getGameObject())) {
|
|
player.getMining().startMining(player, event.getGameObject(), player.objectX, player.objectY, player.clickObjectType);
|
|
return;
|
|
}
|
|
|
|
}
|
|
|
|
}
|