Rewrote glider interface
This commit is contained in:
@@ -1,37 +0,0 @@
|
|||||||
package content.global.handlers.iface;
|
|
||||||
|
|
||||||
import static core.api.ContentAPIKt.*;
|
|
||||||
import core.game.component.Component;
|
|
||||||
import core.game.component.ComponentDefinition;
|
|
||||||
import core.game.component.ComponentPlugin;
|
|
||||||
import content.global.travel.glider.GliderPulse;
|
|
||||||
import content.global.travel.glider.Gliders;
|
|
||||||
import core.game.node.entity.player.Player;
|
|
||||||
import core.plugin.Initializable;
|
|
||||||
import core.plugin.Plugin;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the glider interface component.
|
|
||||||
* @author Emperor
|
|
||||||
* @author 'Vexia
|
|
||||||
* @version 1.0
|
|
||||||
*/
|
|
||||||
@Initializable
|
|
||||||
public final class GliderInterface extends ComponentPlugin {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Plugin<Object> newInstance(Object arg) throws Throwable {
|
|
||||||
ComponentDefinition.put(138, this);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean handle(final Player player, Component component, int opcode, int button, int slot, int itemId) {
|
|
||||||
final Gliders glider = Gliders.forId(button);
|
|
||||||
if (glider == null) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
submitWorldPulse(new GliderPulse(1, player, glider));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package content.global.handlers.iface
|
||||||
|
|
||||||
|
import core.api.submitWorldPulse
|
||||||
|
import content.global.travel.glider.GliderPulse
|
||||||
|
import content.global.travel.glider.Gliders
|
||||||
|
import core.game.interaction.InterfaceListener
|
||||||
|
import org.rs09.consts.Components
|
||||||
|
|
||||||
|
class GliderInterface : InterfaceListener {
|
||||||
|
override fun defineInterfaceListeners() {
|
||||||
|
on(Components.GLIDERMAP_138) { player, _, _, button, _, _ ->
|
||||||
|
val glider = Gliders.forId(button) ?: return@on true
|
||||||
|
submitWorldPulse(GliderPulse(1, player, glider))
|
||||||
|
return@on true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user