[INACTIVE][TP] Tele++ v1.3.3- Full-featured teleportation suite [677]

Discussion in 'Inactive/Unsupported Plugins' started by phaed, Mar 18, 2011.

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

    phaed

  2. Offline

    DontMakeWaves

    I like that I can disable some of the features of this plugin. I don't want to mess with permissions. Thanks.
     
  3. Offline

    lycano

    Hi everybody,

    i wonder why nobody posts the following java.nullPointerException if using TelePlusPlus 1.3.2 with the current craftbukkit build 670.

    Im using craftbukkit #670 and some Plugins (currently) BigBrother, Permissions, Essentials, EssentialsChat, EssentialsSpawn, Help

    Error Log hidden in spoiler
    Show Spoiler

    2011-04-08 17:40:09 [SEVERE] java.lang.NullPointerException
    2011-04-08 17:40:09 [SEVERE] at net.sacredlabyrinth.Phaed.TelePlusPlus.managers.ItemManager.PutItemInHand(ItemManager.java:54)
    2011-04-08 17:40:09 [SEVERE] at net.sacredlabyrinth.Phaed.TelePlusPlus.managers.CommandManager.processCommand(CommandManager.java:505)
    2011-04-08 17:40:09 [SEVERE] at net.sacredlabyrinth.Phaed.TelePlusPlus.TelePlusPlus.onCommand(TelePlusPlus.java:78)
    2011-04-08 17:40:09 [SEVERE] at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
    2011-04-08 17:40:09 [SEVERE] at com.earth2me.essentials.Essentials.onCommand(Essentials.java:553)
    2011-04-08 17:40:09 [SEVERE] at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
    2011-04-08 17:40:09 [SEVERE] at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:80)
    2011-04-08 17:40:09 [SEVERE] at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:254)
    2011-04-08 17:40:09 [SEVERE] at net.minecraft.server.NetServerHandler.c(NetServerHandler.java:596)
    2011-04-08 17:40:09 [SEVERE] at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:559)
    2011-04-08 17:40:09 [SEVERE] at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:553)
    2011-04-08 17:40:09 [SEVERE] at net.minecraft.server.Packet3Chat.a(SourceFile:24)
    2011-04-08 17:40:09 [SEVERE] at net.minecraft.server.NetworkManager.a(NetworkManager.java:198)
    2011-04-08 17:40:09 [SEVERE] at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:72)
    2011-04-08 17:40:09 [SEVERE] at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
    2011-04-08 17:40:09 [SEVERE] at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:368)
    2011-04-08 17:40:09 [SEVERE] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:283)
    2011-04-08 17:40:09 [SEVERE] at net.minecraft.server.ThreadServerApplication.run(SourceFile:375)

    The exception occurs if you have a feather or a fishing rod (stack/nonstacked) in your inventory and u use /tp mover or /tp tool

    I fixed it by replacing the for loop inside ItemManager.java that simply errors if an item is not stackable or not found. Furthermore (but no offence) i dont like the behavoir of this function. It gets the complete inventory and substract -1 if a stack was found and replaces the full inventory. It should prevent dupeing fethers or fishing rods by simply using this command but there was a workaround to dupe anyway ,) The idea behind this is nice but i think it could be done without touching the whole inventory so i used another aproach to reach this goal.

    (Note: No offence, just my 50 cents)

    In addition i fixed another dupe behavior (you could actually dupe a fishing rod cause it will placed in your inventory but not removed cause you cannot setAmount() - 1 and to be precice if you have a single feather in your inventory it wasn't removed cause its not a stack ;)

    Last but not least i added a checker if you have the item already in hand it will not give you an extra fether or fishing rod. Instead it will throw you a message. "Can't you feel it? You already have this item in hand"

    The author can (and i hope he/she will) change the message or remove it ;) I just added it to note the user about his own ... stupidity or happyness by typing in /tp mover more than twice ;)

    Notes to the patch
    Show Spoiler

    This was a quick and dirty fix (i think) im not a java programmer. My home is in the php/javascript/css world. I dont know if using

    "HashMap<Integer, ? extends ItemStack> inv_stacks = inv.all(item);"

    for an inventory hash was the right aproach but this is what eclipse suggests me. I needed an Hash or Array that will contain the stacks found in the inventory ... If i understand that correctly it will extend the ItemStack Class and adds a variable to it like in php by $this->parent->${mynewvar}? Maybe this could be better placed into another class? I dunno im totally new to it ;) Maybe someone will explain this to me later ^^


    Diff Patch (Q&D) diff-TelePlusPlus_1.3.2_nullPointerException.patch (TelePlusPlus GitHub Repo needed; date 2011-04-09)
    Show Spoiler

    Code:
    Only in TelePlusPlus-orig: plugin.yml
    diff -u -r TelePlusPlus-orig/src/net/sacredlabyrinth/Phaed/TelePlusPlus/managers/ItemManager.java TelePlusPlus/src/net/sacredlabyrinth/Phaed/TelePlusPlus/managers/ItemManager.java
    --- TelePlusPlus-orig/src/net/sacredlabyrinth/Phaed/TelePlusPlus/managers/ItemManager.java    2011-04-03 21:08:16.000000000 +0200
    +++ TelePlusPlus/src/net/sacredlabyrinth/Phaed/TelePlusPlus/managers/ItemManager.java    2011-04-09 15:31:27.612000000 +0200
    @@ -2,6 +2,7 @@
    
     import net.sacredlabyrinth.Phaed.TelePlusPlus.TelePlusPlus;
    
    +import java.util.HashMap;
     import java.util.List;
    
     import org.bukkit.ChatColor;
    @@ -34,33 +35,47 @@
         ItemStack handitem = player.getItemInHand();
         Inventory inv = player.getInventory();
    
    -    if (!handitem.getType().equals(Material.AIR))
    +    if (!handitem.getType().equals(item))
         {
    -        if(inv.firstEmpty() == -1)
    -        {
    -        player.sendMessage(ChatColor.RED + "No space in your inventory");
    +        if (!handitem.getType().equals(Material.AIR))
    +        {
    +            if(inv.firstEmpty() == -1)
    +            {
    +            player.sendMessage(ChatColor.RED + "No space in your inventory");
    +            return false;
    +            }
    +
    +            inv.setItem(inv.firstEmpty(), handitem);
    +        }
    +
    +        if (inv.contains(item))
    +        {
    +            HashMap<Integer, ? extends ItemStack> inv_stacks = inv.all(item);
    +
    +            for (int h_key: inv_stacks.keySet())
    +            {
    +                ItemStack stack = inv_stacks.get( h_key );
    +                if (stack.getAmount() > 1 )
    +                {
    +                    stack.setAmount( stack.getAmount() - 1 );
    +                    break;
    +                }
    +
    +                if (stack.getAmount() == 1)
    +                {
    +                    inv.clear(h_key);
    +                    break;
    +                }
    +            }
    +        }
    +
    +        player.setItemInHand(new ItemStack(item, 1));
    +    } else {
    +        player.sendMessage(ChatColor.RED + "Can't you feel it? You already have this item in hand");
             return false;
    -        }
    -
    -        inv.setItem(inv.firstEmpty(), handitem);
         }
    
    -    if (inv.contains(item))
    -    {
    -        ItemStack[] stacks = inv.getContents();
    -
    -        for (int i = 0; i < stacks.length; i++)
    -        {
    -        if (stacks[i].getType().equals(item))
    -        {
    -            stacks[i].setAmount(stacks[i].getAmount() - 1);
    -            inv.setContents(stacks);
    -            break;
    -        }
    -        }
    -    }
    
    -    player.setItemInHand(new ItemStack(item, 1));
         return true;
         }
    -}
    +}
    \ No newline at end of file
    


    I didn't uploaded a jar file cause i think the author himself will fix it soon (hopefully). But if you know how to extract and patch the ItemManager.java file you can use TelePlusPlus 1.3.2 on an craftbukkit #670 server.

    (If some ppl horrobly wants the jar i could fork it on github and upload the jar there if its not fixed in time.)

    Regards, Lycano
     
  4. Offline

    gamerluke

    Seems to not work for me, Got current Bukkit
     
  5. Offline

    lycano

    Feature Request:
    Is there a way to disable/enable teleport|mover binds?

    I didn't found any way to disable the teleport bindings. In fact they are currently active if TelePlusPlus is loaded (#670). Clear actually only clears the history. Maybe a disable bind would be nice?

    If i use one feather from my stack and put it into my hand i can teleport without triggering /tp tool
    same goes for /tp mover

    would be nice if a /tp mover and /tp tool binds will only trigger if you spawn it via /tp tool|mover and disable on manually using /tp disable|toolless or something that fits =)

    Dunno if its much work to trigger the disable function on throw item in hand (if equipped). So that no extra disable trigger is necessary.

    Shure you can disable the whole TP module via Permissions but in my opinion it is logic that you must use /tp tool|mover to gain extra power and if you drop it this power is gone

    Regards. Lycano

    Is the patch not working or TelePlusPlus 1.3.2 in its current released state? What build exactly do you use of cb?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 12, 2016
  6. Offline

    gamerluke

    The current reccomended build and then current state yes
     
  7. Offline

    lycano

    (Edit @ 2011-04-11 11:20)
    * Removed temporarily uploaded jar link from this post as it is now obsolete

    @phead, thank you! ^.^
     
  8. Offline

    phaed

    Change Log
    Version 1.3.2a - Merged lycano's fixes for 670
    • fixed /tp mover|tool bug when using bukkit #670
    • fixed "preventing the user from duping items FEATHER, FISHING_ROD by using commands /tp tool|mover"
    • changed the way of inventory processing in that case (should speed up things a bit)
    • (Q&D-way of creating a new variable inside changed function -> needs to be reviewed)
     
  9. Offline

    ExCrafter

    My friends don't seem to be able to do quick jump with the feather after I switched from TelePlus. Do I need to use Permissions now?
     
  10. Offline

    phaed

    Read OP please.
     
  11. Offline

    ExCrafter

    Sorry I just figured it out lol. I wasn't aware that I had to OP them. Thanks!
     
  12. Offline

    oliverw92

    Would it be possible to add an option in the config for the 'force-to' thing - it's really annoying having to do /warp force-to pvp, rather than just /warp pvp. It also confuses our users.
     
  13. Offline

    phaed

    I think you got your plugins confused.
     
  14. Offline

    oliverw92

    I think i just did [pig]
     
  15. Offline

    phaed

    Change Log
    Version 1.3.3

    • Upgraded for 677
     
  16. Offline

    andrewkm

    any confliction with worldedit and essentials here guys?
     
  17. Offline

    lycano

    @andrewkm: I dont have any problems using Tele++ with Essentials. I dont use Worldedit so idk but i can guess. You can configure the item ids for tpp mover and tool. If Worldedit is using the same id just change one of them and it should work.
     
  18. Offline

    lolligertyp

    I tried /tp world2 but it won't work, "Not a valid world or player.". But in my bukkit folder is a world2 folder with my world2 and with WorldWarp it works fine!
     
  19. Offline

    lycano

    @lolligertyp: are you shure you checked Permissions (if you use permissions) and disable.world.tp is set to false?
     
    lolligertyp likes this.
  20. Offline

    lolligertyp

    config.yml (Tele++):
    Code:
    log:
        tp:
            player: true
            coords: true
            here: true
            toggle: true
            back: true
            origin: true
        others:
            player: true
            coords: true
        world:
            tp: true
        jump:
            top: false
            up: false
            jump: true
        mod:
            above: true
            mass: true
            tool: true
            mover: true
        request: true
    notify:
        tp:
            player: true
            coords: true
            here: true
            toggle: true
            back: true
            origin: true
        others:
            player: true
            coords: true
        world:
            tp: true
        jump:
            top: false
            up: false
            jump: true
        mod:
            above: true
            mass: true
            tool: true
            mover: true
        request: true
    say:
        tp:
            player: true
            coords: true
            here: true
            toggle: true
            back: true
            origin: true
        others:
            player: true
            coords: true
        world:
            tp: true
        jump:
            top: false
            up: false
            jump: true
        mod:
            above: true
            mass: true
            tool: true
            mover: true
        request: true
    disable:
        tp:
            player: false
            coords: false
            here: false
            toggle: false
            clear: false
            back: false
            origin: false
        others:
            player: false
            coords: false
        world:
            tp: false
        jump:
            top: false
            up: false
            jump: false
        mod:
            above: false
            mass: false
            tool: false
            mover: false
        request: false
    glassed:
        fall-block-distance: 5
        fall-immunity: true
        fall-immunity-seconds: 5
    settings:
        through-blocks: [0, 6, 8, 9, 10, 11, 37, 38, 39, 40, 50, 51, 55, 59, 63, 65, 66, 69, 68, 70, 72, 75, 76, 77, 83, 92, 93, 94 ]
        purge-requests-minutes: 5
        tool-item: 288
        mover-item: 346  
    Permissions for all worlds:
    Code:
    plugin:
        permissions:
            system: default
    groups:
        Neuling:
            default: true
            info:
                prefix: ''
                suffix: ''
                build: false
            inheritance:
            permissions:
    
        Normal:
            default: true
            info:
                prefix: ''
                suffix: ''
                build: true
            inheritance:
            permissions:
                - 'general.time.*'
                - 'general.spawn'
                - 'tpp.tp.player'
                - 'tpp.tp.back'
                - 'tpp.world.tp'
                - 'general.player-info'
                - 'myhome.home.*'
                - 'mywarp.warp.*'
                - 'godmode.*'
                - 'tpack.*'
                - 'godPowers.godmode'
                - 'godPowers.die'
                - 'godPowers.heal'
                - 'wings.fly'
                - 'craftbook.*'
                - 'creaturebox.dropspawner'
                - 'creaturebox.placespawner'
        Admin:
            default: false
            info:
                prefix: '&4'
                suffix: ''
                build: true
            inheritance:
            permissions:
                - '*'
    
    users:
        lolligertyp:
            group: Admin
            permissions:
        Tom:
            group: Normal
            permissions:
        _Headhunter_:
            group: Normal
            permissions:
        janwie97:
            group: Normal
            permissions:
        bodolive:
            group: Normal
            permissions:
        Serrox:
            group: Normal
            permissions:
        Pedobaer:
            group: Normal
            permissions:
        linfaceone:
            group: Normal
            permissions:
        butterfly:
            group: Normal
            permissions:
        xXNightmareXx:
            group: Normal
            permissions:
        TestUser:
            group: Normal
            permissions:
    And I'm in the ops.txt, so I have all permissions.
     
  21. Offline

    lycano

    @lolligertyp: what do you mean with "for all worlds"? To clarify: each worlds must have its own .yml. file. E.g. for world you must have world.yml and for world2 you must have world2.yml placed in your Permissions directory.
     
  22. Offline

    lolligertyp

    Yeah, I mean that I have this config in all ymls, so world.yml=world2.yml=supercoolewelt.yml
     
  23. Offline

    lycano

    I'll check that after work in about 6 h
     
  24. Offline

    phaed

  25. Offline

    andrewkm

    Can we lock this thread or something then.
     
Thread Status:
Not open for further replies.

Share This Page