Skip to content

EntityListener doesnt check config for minecart permissions. #8

@humandperson

Description

@humandperson

I could be incredibly wrong, as i have not coded since my ap computer science class in freshman year of high school, but entityCanBeTeleported boolean never actually checks if getAllowMinecarts ends up being true.

i feel like this is a simple fix where you just add

if(plugin.getAllowMinecarts() == false && entity instanceof Minecart)
            return false;

but i could totally be wrong.

going above and beyond, having specific reasons why something didnt teleport would be nice. eg. starting at line 329 of EntityListener including the proposed fix:

        if(plugin.getAllowMobs() == false && entity instanceof Mob)
            player.sendMessage(ChatColor.RED + "Serverwide, players are not allowed to teleport a mob. Contact a Moderator if you believe this to be a mistake."); 
            return false;

        if(plugin.getAllowItems() == false && entity instanceof Item)
            player.sendMessage(ChatColor.RED + "Serverwide, players are not allowed to teleport an item(s). Contact a Moderator if you believe this to be a mistake."); 
            return false;

        if(plugin.getAllowMinecarts() == false && entity instanceof Minecart)
            player.sendMessage(ChatColor.RED + "Serverwide, players are not allowed to teleport a minecart. Contact a Moderator if you believe this to be a mistake."); 
            return false;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions