Need help with anti-grieving mod to protect against mining laser

  • There is a problem with mining laser being used for grieving on multiplayer servers.




    I'm developing a mod, that is already used on several servers.


    It's called Chunk Protection and runs on server-side only.


    Players can use the command "/chunk claim" to claim a private chunk that is protected from other players placing or breaking blocks there.


    With the command "/chunk add [playername]" they can add players that are allowed to edit that chunk as well.


    This works fine for players, but it doesn't protect against mining lasers (or cc turtles).




    The mod listens for the PlayerInteractEvent, that is called when a player clicks on a block, and checks if the player is allowed to alter blocks in that chunk. If not, the event is canceled and nothing happens.




    Does someone know how my mod can detect when a mining laser breaks a block, so it can protect against that as well?


    Or maybe it would be possible that the laser calls the PlayerInteractEvent with the username of the player who fired it?




    Kind regards,


    Evert


    http://powerbeat.org/minecraft/server_mods/

  • Shouldn't this go to the Addon Discussion section as it discusses the modding of IC2?


    I think it makes more sense in Support because it is asking for help with coding a mod that is meant mostly for vanilla stuff, and just wants to add compatibility for one thing.

    Is the answer to this question no?


    Quote

    Hey don't take it so hard. Ignorance is part of this generation it seems. -the wise words of XFmax-o-l

  • I think it makes more sense in Support because it is asking for help with coding a mod that is meant mostly for vanilla stuff, and just wants to add compatibility for one thing.

    My Protection mod is specially made to combine with Forge mods. Vanilla servers can use a Bukkit server with a lot of plugins available that offer the same functionality (often better than my mod), but not compatible with most Forge mods.


  • Does someone know how my mod can detect when a mining laser breaks a block, so it can protect against that as well?


    Or maybe it would be possible that the laser calls the PlayerInteractEvent with the username of the player who fired it?


    There's the problem. PlayerInteractEvent doesn't tell you that the player is breaking a block, it only tells you that they clicked on it.
    Mining lasers don't click blocks, so they don't fire PlayerInteractEvents.


    Unfortunately Forge doesn't have an actual event for block breaking, so you'll have to pester CPW or LexManos until they add it.

    Disappointed with the bugs and nerfedness of AtomicStryker Corp's Advanced Machines, and the unupdatedness of Snyke's Enterprises?
    Need low-lag renewable power?
    Come to ImmTech Intragalactical this thread for free UUM!

    Note: UUM may stand for Unnerfed Unbuggy Updated Machines and may not be actual UUM. The extra U was lost due to a bit error.
    Battery snot included.

  • There's the problem. PlayerInteractEvent doesn't tell you that the player is breaking a block, it only tells you that they clicked on it.
    Mining lasers don't click blocks, so they don't fire PlayerInteractEvents.


    Unfortunately Forge doesn't have an actual event for block breaking, so you'll have to pester CPW or LexManos until they add it.

    yeah what even happen to that? It sounded like be a week away at most a half a year ago lol.

    Check out Our Brand New GT New Horizons Server .:Here:.
    Check out Our Brand New GT New Horizons Let's Play Series .:Here:.