Simple Plugin

Discussion in 'Archived: Plugin Requests' started by Drizzy, Nov 18, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    Drizzy

    So basically I want the plugin to do this, because it's the only way to recognise it best.

    When people advertise IP's for servers, it's usually something with a sub-domain. Such as Play.bukkitPvP.net for example.

    Sites are usually something like Bukkit.org

    So can someone make a plugin where it recognises if it has 2 fullstops within words like a sub-domain and block it? Or is there a more efficient way, thanks.

    I want it to replace the fullstops with nothing if so.
     
  2. Offline

    JOSHSLAYDE

    Drizzy

    I am not quite sure, but I think it is possible to do that with the ChatTweaks plugin.
     
  3. Offline

    Guccify

    Not sure what version you're on, but here's what I wrote for the method:

    Code:java
    1. @EventHandler
    2. public void onPlayerChatEvent(AsyncPlayerChatEvent evt) {
    3. if (!evt.getPlayer().hasPermission("YourPluginName.link")) {
    4. String message = evt.getMessage();
    5. if (message.matches("(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)")) {
    6. evt.setCancelled(true);
    7. return;
    8. }
    9. }
    10. }


    This only checks if it's a numerical IP, as my regex is a bit spotty, so I wasn't able to get a domain pattern working. A bit of googling will get you one though.T
     
    17xDillz1997 likes this.
  4. Offline

    Jayke_

  5. Offline

    JOSHSLAYDE

    Drizzy
    Jayke_

    I am going to note that plugin for feature forum responses. I wasn't aware of it.
     
  6. Offline

    17xDillz1997

    Jayke_
    He might want links but not IPs. :(
     
  7. Offline

    Jayke_

  8. Offline

    17xDillz1997

    Well he included sub-domains and would of just said Domains so I'm guessing he probably wanted links allowed. No need to be like that.
     
    Drizzy likes this.
  9. Offline

    Jayke_


    You don't need a subdomain to have a valid minecraft server IP, so I don't see why he wouldn't want regular domains restricted aswell.
     
  10. Offline

    RW_Craft

  11. Offline

    Drizzy

    Usually people have sub domain IP's so I want mainly things that look like Sub domains blocked. He is right.

    RW_Craft
    Thx ur a star ;D
     
  12. Offline

    Jayke_


    The latest version of my plugin only blocks subdomain IPs anyways so...
     
Thread Status:
Not open for further replies.

Share This Page