Suggestion - NoTalk

Discussion in 'Archived: Plugin Requests' started by SmilerRyan, Aug 14, 2014.

?

Can you make this for me?

  1. yes

    50.0%
  2. no

    50.0%
  1. Offline

    SmilerRyan

    Hey, i would like a plugin called No-Talk, a Simple Way To Block MineChat etc

    Name: No-Talk
    Category: Chat,Utility
    Commands: about plugin permissions (/thelp )
    permissions: NoTalk.Bypass (Allow Use of talking)
    When I'd like it: within this week or month

    I would like like to it to block talking unless a player moves
    i would also find a config to change the command to kick a player if they try to talk helpful
    if it blocks hitting, water and tnt for moving etc it would be a great plugin for all servers.
    i hope this plugin gets started, i have found up info about this and didnt get it to work as im not a programer
    these two methods are from this thread: Blocking MineChat (& Similars)
    Code:
    public class AntiMineChat extends JavaPlugin implements Listener
    {
        //Storing Player objects is fine as long as you make sure you clean up after yourself
        private Map<Player, Location> locations;
     
        public AntiMineChat()
        {
            locations = new HashMap<Player, Location>();
        }
     
        @Override
        public void onEnable()
        {
            getServer().getPluginManager().registerEvents(this, this);
        }
     
        @EventHandler
        public void onPlayerJoin(PlayerJoinEvent event)
        {
            locations.put(event.getPlayer(), event.getPlayer().getLocation());
        }
     
        @EventHandler
        public void onPlayerQuit(PlayerQuitEvent event)
        {
            //Clean up the Player reference - Not doing this causes a memory leak, amongst other issues
            locations.remove(event.getPlayer());
        }
     
        @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
        public void onPlayerTeleport(PlayerTeleportEvent event)
        {
            //Update stored location if they teleport, to compensate for commands or plugins teleporting players on login
            locations.put(event.getPlayer(), event.getTo());
        }
     
        @EventHandler(ignoreCancelled = true)
        public void onPlayerChat(AsyncPlayerChatEvent event)
        {
            try
            {
                //Use distanceSquared() to avoid repeated sqrt() calls
                if(event.getPlayer().getLocation().distanceSquared(locations.get(event.getPlayer())) < 1.0D)
                {
                    event.setCancelled(true);
                    event.getPlayer().sendMessage(ChatColor.RED + "You cannot chat without having moved first");
                }
            }
            catch(IllegalArgumentException e)
            {
                //Do nothing, Player is in a different world than the stored location
            }
        }
    }
    Code:
    public class AntiMineChat extends JavaPlugin implements Listener
    {
        //Use a set for fast contains() calls
        private Set<Player> moved;
     
        public AntiMineChat()
        {
            moved = new HashSet<Player>();
        }
     
        @Override
        public void onEnable()
        {
            getServer().getPluginManager().registerEvents(this, this);
        }
     
        @EventHandler
        public void onPlayerQuit(PlayerQuitEvent event)
        {
            //Clean up the Player reference - Not doing this causes a memory leak, amongst other issues
            moved.remove(event.getPlayer());
        }
     
        @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
        public void onPlayerMove(PlayerMoveEvent event)
        {
            if(!moved.contains(event.getPlayer()))
            {
                moved.add(event.getPlayer());
            }
        }
     
        @EventHandler(ignoreCancelled = true)
        public void onPlayerChat(AsyncPlayerChatEvent event)
        {
            if(moved.contains(event.getPlayer()))
            {
                event.setCancelled(true);
                event.getPlayer().sendMessage(ChatColor.RED + "You cannot chat without having moved first");
            }
        }
    }
     
  2. Offline

    drpk

    SmilerRyan by "I would like like to it to block talking unless a player moves" do you mean if a player doesn't move within a configurable amount of time, they cannot talk?
     
  3. Offline

    567legodude

    He wants players to be unable to talk until they move, just to make sure that they are actually playing.
     
  4. Offline

    nathnana2002

    What if they're on Minechat?
     
  5. Offline

    NathanG_

     
  6. Offline

    Geekxboy

    SmilerRyan Here you go: Download Link

    Permission is NotTalk.Bypass and it defaults to OP
    I added a config to send the player a message if they try to talk but haven't moved yes, option to disable or enable that message and an option to enable or disable bypassing
     
  7. Offline

    SmilerRyan

  8. Offline

    timtower Administrator Administrator Moderator

    SmilerRyan 1. Please keep the conversation on the thread and not on skype.
    2. Why did you made a project without asking for permission first? No logic in that.
     
  9. Offline

    SmilerRyan

    so, you think i need to remove the post? how would i if that is what i need to do?
     
  10. Offline

    timtower Administrator Administrator Moderator

    SmilerRyan Well, I my opinion Geekxboy should make the project if he wants it.
    I suggest that you wait for him to respond.
     
  11. Offline

    SmilerRyan

    i changed the ownership of the project if that is what you meant?
     
  12. Offline

    Geekxboy

    There is no point in this plugin having a dev page while its this simple and has limited features.

    I requested that the project be deleted as I never authorized you to release the plugin. Dont EVER do that again without my permission
     
    extended_clip and timtower like this.
  13. Offline

    SmilerRyan

    ok, i didn't know as this is the first time, but as you would like it removed, i need to know how i can do it. like i aid, i tranfered the ownership to you, im guessing that only you can remove it? sorry for any inconvenience caused. :(
     
  14. Offline

    timtower Administrator Administrator Moderator

    SmilerRyan He already asked for removal, and there is a report button in the bottom right corner as well.
     

Share This Page