mirror of
https://github.com/2006-Scape/2006Scape.git
synced 2026-07-04 08:39:05 +00:00
Kotlin -> Java (#586)
* Convert All Plugins To Java * Convert Rest Of Kt To Java & Remove Kt From Maven
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
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)
|
||||
class ObjectFirstClick : EventSubscriber<ObjectFirstClickEvent> {
|
||||
|
||||
override fun subscribe(context: EventContext, player: Player, event: ObjectFirstClickEvent) {
|
||||
|
||||
if (player.playerRights >= 3) {
|
||||
player.packetSender.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.gameObject)) {
|
||||
player.mining.startMining(player, event.gameObject, player.objectX, player.objectY, player.clickObjectType)
|
||||
return
|
||||
}
|
||||
|
||||
when (event.gameObject) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package plugin.click.obj;
|
||||
|
||||
import com.rs2.event.EventContext;
|
||||
import com.rs2.event.EventSubscriber;
|
||||
import com.rs2.event.SubscribesTo;
|
||||
import com.rs2.event.impl.ObjectFourthClickEvent;
|
||||
import com.rs2.game.content.skills.farming.Farming;
|
||||
import com.rs2.game.players.Player;
|
||||
import com.rs2.world.clip.Region;
|
||||
|
||||
@SubscribesTo(ObjectFourthClickEvent.class)
|
||||
public final class ObjectFourthClick implements EventSubscriber<ObjectFourthClickEvent> {
|
||||
|
||||
@Override
|
||||
public void subscribe(EventContext context, Player player, ObjectFourthClickEvent event) {
|
||||
if (player.playerRights == 3) {
|
||||
player.getPacketSender().sendMessage("[click= object], [type= fourth], [id= " + player.objectId + "], [location= x:" + player.objectX + " y:" + player.objectY + "]");
|
||||
}
|
||||
|
||||
if (!Region.objectExists(player.objectId, player.objectX, player.objectY, player.heightLevel)) {
|
||||
return;
|
||||
}
|
||||
|
||||
Farming.guide(player, player.objectX, player.objectY);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
package plugin.click.obj
|
||||
|
||||
import com.rs2.event.EventContext
|
||||
import com.rs2.event.EventSubscriber
|
||||
import com.rs2.event.SubscribesTo
|
||||
import com.rs2.event.impl.ObjectFourthClickEvent
|
||||
import com.rs2.game.content.skills.farming.Farming
|
||||
import com.rs2.game.players.Player
|
||||
import com.rs2.world.clip.Region
|
||||
|
||||
@SubscribesTo(ObjectFourthClickEvent::class)
|
||||
class ObjectFourthClick : EventSubscriber<ObjectFourthClickEvent> {
|
||||
|
||||
override fun subscribe(context: EventContext, player: Player, event: ObjectFourthClickEvent) {
|
||||
|
||||
if (player.playerRights >= 3) {
|
||||
player.packetSender.sendMessage("[click= object], [type= fourth], [id= ${player.objectId}], [location= x:${player.objectX} y:${player.objectY} ], [PLUGIN]");
|
||||
}
|
||||
|
||||
if (!Region.objectExists(player.objectId, player.objectX, player.objectY, player.heightLevel)) {
|
||||
return
|
||||
}
|
||||
|
||||
Farming.guide(player, player.objectX, player.objectY)
|
||||
|
||||
when (event.gameObject) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package plugin.click.obj;
|
||||
|
||||
import com.rs2.event.EventContext;
|
||||
import com.rs2.event.EventSubscriber;
|
||||
import com.rs2.event.SubscribesTo;
|
||||
import com.rs2.event.impl.ObjectSecondClickEvent;
|
||||
import com.rs2.game.content.skills.thieving.Stalls;
|
||||
import com.rs2.game.players.Player;
|
||||
import com.rs2.world.clip.Region;
|
||||
|
||||
@SubscribesTo(ObjectSecondClickEvent.class)
|
||||
public final class ObjectSecondClick implements EventSubscriber<ObjectSecondClickEvent> {
|
||||
|
||||
@Override
|
||||
public void subscribe(EventContext context, Player player, ObjectSecondClickEvent event) {
|
||||
if (player.playerRights == 3) {
|
||||
player.getPacketSender().sendMessage("[click= object], [type= second], [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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
package plugin.click.obj
|
||||
|
||||
import com.rs2.event.EventContext
|
||||
import com.rs2.event.EventSubscriber
|
||||
import com.rs2.event.SubscribesTo
|
||||
import com.rs2.event.impl.ObjectSecondClickEvent
|
||||
import com.rs2.game.content.skills.thieving.Stalls
|
||||
import com.rs2.game.players.Player
|
||||
import com.rs2.world.clip.Region
|
||||
|
||||
@SubscribesTo(ObjectSecondClickEvent::class)
|
||||
class ObjectSecondClick : EventSubscriber<ObjectSecondClickEvent> {
|
||||
|
||||
override fun subscribe(context: EventContext, player: Player, event: ObjectSecondClickEvent) {
|
||||
|
||||
if (player.playerRights >= 3) {
|
||||
player.packetSender.sendMessage("[click= object], [type= second], [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.gameObject)) {
|
||||
Stalls.attemptStall(player, event.gameObject, player.objectX, player.objectY)
|
||||
return
|
||||
}
|
||||
|
||||
when (event.gameObject) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
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.StaticObjectList.IRON_LADDER_10177
|
||||
import com.rs2.game.content.skills.thieving.Stalls
|
||||
import com.rs2.game.players.Player
|
||||
import com.rs2.world.clip.Region
|
||||
|
||||
@SubscribesTo(ObjectThirdClickEvent::class)
|
||||
class ObjectThirdClick : EventSubscriber<ObjectThirdClickEvent> {
|
||||
|
||||
override fun subscribe(context: EventContext, player: Player, event: ObjectThirdClickEvent) {
|
||||
|
||||
if (player.playerRights >= 3) {
|
||||
player.packetSender.sendMessage("[click= object], [type= third], [id= ${player.objectId}], [location= x:${player.objectX} y:${player.objectY} ], [PLUGIN]");
|
||||
}
|
||||
|
||||
if (!Region.objectExists(player.objectId, player.objectX, player.objectY, player.heightLevel)) {
|
||||
return
|
||||
}
|
||||
|
||||
if (Stalls.isObject(event.gameObject)) {
|
||||
Stalls.attemptStall(player, event.gameObject, player.objectX, player.objectY)
|
||||
return
|
||||
}
|
||||
|
||||
when (event.gameObject) {
|
||||
IRON_LADDER_10177 -> player.playerAssistant.movePlayer(1798, 4407, 3);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user