Rune Activation Events / API #111


  • Other
  • Waiting
Open
Assigned to rivkiin
  • _ForgeUser18917312 created this issue Feb 23, 2015

    What is the enhancement in mind? How should it look and feel?

    I run a Minecraft server where I have developed my own Bukkit plugin to add instances and some other features, including player surveillance. I am aware that Runecraft is closed source, and understand the reasoning. However, I would love being able to listen in on rune usage through, say, Rune Activation Events or an API or some sort. Some use cases I can think of:

    Random Events
    Let's say you want to add some danger to players relying on teleporters a lot. Being able to listen on an event could allow you to intercept a teleporter activation and, instead of teleporting them to their desired destination, teleport them to a random location. Or an instance that they have to complete to move on. Or some other random waypoint.

    Surveillance
    It's nice that Runecraft logs when people use teleporters, but I know I would love having a more verbose output, including source and destination locations. Being able to listen in on certain rune usage would allow me to log it in my database for investigations into accusations of cheating.

    Per-Rune Permissions
    I would not have use for this use case, but some servers may like to allow their players to limit rune usage to a set of players or a clan or what have you. Being able to block certain runes depending on what player you are would be useful.

    Please provide any additional information below.

    I understand entirely if you do not want to allow this kind of access to your plugin. If that is not the case, I would love to see it come to fruition.

    Additionally, I don't know if you're looking for more developers, but I would be more than happy to join and help out in the development and bug squashing!

    Thanks,

    Graham
    [email protected]

  • _ForgeUser18917312 added the tags New Other Feb 23, 2015
  • Rivkiin unassigned issue from _ForgeUser765911 Mar 3, 2015
  • Rivkiin self-assigned this issue Mar 3, 2015
  • _ForgeUser4929249 posted a comment Mar 6, 2015

    Random events, This might not be a good idea, except say April first, adding danger to the use of runecraft would make it less likely not more likely to be used.

    Surveillance, I know this has been talked about for verbose usage of runes, we are still looking at making changes to the code to allow this, as well as tracking rune usage.

    Per-rune Permissions, This has been a topic that the devs have discussed due to some changes in coding staff, and time available this has not yet been implemented, it is on the need to do list, as well as having the ability to fix broken runes, and magic.dat files.

    As for developer access, I would not be the one to answer this inquiry.

  • _ForgeUser18917312 posted a comment Mar 14, 2015

    RE: Random Events:

    I was more talking of there being an event API that server plugin developers could use to listen in on rune usage, and then have the ability to modify the outcome of that rune. It would not, by any means, be built into Runecraft.

    Imagine this structure (rough example I am writing on the fly):

    class RuneActivateEvent extends Event {
        boolean isCancelled() {...}
        void setCancelled() {...}
        RuneType getRuneType() {...}
        RuneEventSettings getRuneEventSettings() {...}
    }
    
    enum RuneType {
        TELEPORTER, WAYPOINT, ... etc;
    }
    
    interface RuneEventSettings {
        RuneType getRuneType();
    }
    
    class TeleporterRuneEventSettings implements RuneEventSettings {
        RuneType getRuneType() { return RuneType.TELEPORTER; }
        Location getTeleporterLocation() { ... }
        Location getWaypointLocation() { ... }
        void setTeleporterLocation(Location location) { ... }
    }
    

    And lets also imagine that there is an API for accessing all the waypoint locations:

    class Waypoints {
        static List<Location> getAllWaypointLocations() { ... }
    }
    

    Lets say I have my own server plugin in which I want to add a little bit of danger to the use of Teleporters. Essentially, when someone uses a teleporter, I want to make them have a 0.1% chance to teleport to a random other waypoint:

    class MyServerRunecraftListener extends Listener {
        private static final Random rand = new Random();
    
        @EventHandler
        void onRuneActivation(RuneActivateEvent event) {
            switch (event.getRuneType()) {
                case TELEPORTER:
                    if (rand.nextInt(1000) == 0) {
                        Location newDestination = Waypoints.getAllWaypointLocations().get(rand.nextInt(Waypoints.getAllWaypointLocations().size()));
                        ((TeleporterRuneEventSettings) event.getRuneEventSettings()).setWaypointLocation(newDestination);
                    }
                default:
                    break;
            }
        }
    }
    

    Or there could be an event per rune, but this is just an example.


    Edited Mar 14, 2015
  • Rivkiin removed a tag New Mar 23, 2015
  • Rivkiin added a tag Accepted Mar 23, 2015
  • Rivkiin removed a tag Accepted Mar 23, 2015
  • Rivkiin added a tag Fixed Mar 23, 2015
  • Rivkiin closed issue Mar 23, 2015
  • Rivkiin removed a tag Fixed May 3, 2015
  • Rivkiin added a tag Waiting May 3, 2015
  • Rivkiin reopened issue May 3, 2015

To post a comment, please login or register a new account.