Files
2006Scape/2006Scape Server/plugins/plugin/click/obj/ObjectThirdClick.java
T
Josh Shippam 5db6da334d Kotlin -> Java (#586)
* Convert All Plugins To Java

* Convert Rest Of Kt To Java & Remove Kt From Maven
2023-02-05 22:30:52 +00:00

39 lines
1.3 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.ObjectThirdClickEvent;
import com.rs2.game.content.skills.thieving.Stalls;
import com.rs2.game.players.Player;
import com.rs2.world.clip.Region;
import static com.rs2.game.content.StaticObjectList.IRON_LADDER_10177;
@SubscribesTo(ObjectThirdClickEvent.class)
public final class ObjectThirdClick implements EventSubscriber<ObjectThirdClickEvent> {
@Override
public void subscribe(EventContext context, Player player, ObjectThirdClickEvent event) {
if (player.playerRights == 3) {
player.getPacketSender().sendMessage("[click= object], [type= third], [id= " + player.objectId + "], [location= x:" + player.objectX + " y:" + player.objectY + "]");
}
if (!Region.objectExists(player.objectId, player.objectX, player.objectY, player.heightLevel)) {
return;
}
if (Stalls.isObject(event.getGameObject())) {
Stalls.attemptStall(player, event.getGameObject(), player.objectX, player.objectY);
return;
}
switch (event.getGameObject()) {
case IRON_LADDER_10177:
player.getPlayerAssistant().movePlayer(1798, 4407, 3);
break;
}
}
}