mirror of
https://github.com/2006-Scape/2006Scape.git
synced 2026-07-03 00:31:51 +00:00
81e6344dd8
* Update Boundary.java * fix xp to level up * tomato shop * fix longsword attack anim * Update MeleeData.java * fix dagger/longsword/shortsword anims * Update MeleeData.java * obby maul and warhammer interfaces and halberd anims * Pickaxe anims randomly uses the anim for either stab str or crush str. Cheaphax before system redesign * adds razmires builder shop * pom.xml update
39 lines
1.4 KiB
Java
39 lines
1.4 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.StaticObjectList;
|
|
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;
|
|
}
|
|
|
|
//TODO when plugins occur, move the handling of this to the specific plugin for those map areas.
|
|
if(event.getGameObject() == StaticObjectList.CRATE_6839) {
|
|
player.getShopAssistant().openShop(146);
|
|
}
|
|
|
|
}
|
|
|
|
}
|