Solved Out Of Bound Exception

Discussion in 'Plugin Help/Development/Requests' started by ibc2244, Jun 23, 2015.

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

    ibc2244

  2. Offline

    Bram0101

    it's probably the item break effect. try setting the 0 in the playEffect to something like 1 or 2, or set it to Material.STONE or something like that. if that doesn't work, I have no idea.
     
  3. Offline

    Boomer

    Would help seeing the whole error, just to make sure you're not looking in the wrong spot...
    I smell the error being thrown in some other module, or else, very low-level buried; Its definitely a protocol-packet error, something is too big for the packet package being sent
     
  4. Offline

    Zombie_Striker

    Out of bounds exeption means that something is out of bounds. This may seem obvious, but you are trying to get something (presumably from an array) that does not exist (out of bounds).
     
  5. Offline

    Boomer

    Except he may not be, the code is but may not be specifically from his code, but his map. Many of the json exploits throw such errors, naming a mob >16 characters throws such an error, npc player >16 characters, etc. The specific error is a protocol error - some packet data is longer than the buffer for the packet size.
    Where in his code do you see him trying to explicity access the nth byte of data in a packet buffer? ;)

    Its a secondary error effect from something else in the code, that may come about from pressing the red buzzer rather than the green, as far as he codes, thats all he does, but behind the scenes, the server is assessing the situation and doing something odder with the green buzzer...
     
  6. Offline

    ibc2244

    @Boomer
    Here's the whole log for the Error

    http://pastebin.com/vDUeVCK0

    @Bram0101
    I already tried 0, also I tried 20 but neither worked ;)

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

    Boomer

    wow, seriously server? One line and thats it?
    try commenting out the effect, period, to confirm or deny that as the source.
     
  8. Offline

    ibc2244

    @Boomer

    Ok, so I found that I only get the error when I add an effect to it. I was thinking maybe it's because the effect spawns in the block at the same time. Not sure though

    EDIT:
    I've commented out the Effects and variables to go with, same with the block but nothing happens, but... I still get the OutOfBoundsException without spawning the block and no effect plays.
     
    Last edited: Jun 23, 2015
  9. Offline

    Boomer

    Try changing it to an (Effect.ENDER_SIGNAL, 10) - i have that in one of my plugins (albeit 1.7.9) and it works. If that doesn't for you, then we look into other issues.
     
  10. Offline

    ibc2244

    @Boomer
    Can I have a different Effect because I don't want ENDER_SIGNAL I want ITEM_BREAK?
     
  11. Offline

    Boomer

    It is for testing purpsoes only -- does it work, does it fail. Temporary - does it crash the client as well.
     
  12. Offline

    ibc2244

    @Boomer
    WOOO, It works, but with Ender_Signal not Item_Break I'll try different effects and see if they work
     
  13. Offline

    Boomer

    okay, now we have something to go on. Digging through some targetted searches now...
     
  14. Offline

    ibc2244

    @Boomer
    It's only the ITEM_BREAK effect that throws the OOBE error all others are fine.

    //EDIT:

    Also what does the Int do:

    world.playEffect(loc, Effect.CRIT, -->>10);
     
  15. Offline

    Boomer

    Not that i trust this source, but try ITEM_BREAK_1 with ,0 and ,1 if the first fails

    It all depends on the effect - for some effects, its the visibility radius, for other effects, the radius of the particle spread, for other effects, how close the player must be to see the effect...

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

    ibc2244

    @Boomer
    ITEM_BREAK_1 cannot be resolved to a type.
    Is the error I'm getting in my IDE when I put that, here's how I was doing it:

    world.playEffect(loc, Effect.ITEM_BREAK_1, 10);
     
  17. Offline

    Boomer

    yeah, i didn't think that was proper-looking.
    The indications eem to be that spigot didn't impliment the packet sending for that effect correctly, and the recommendation is 'send the packet yourself' for it
    You did try with the second parameter as a 1 or 2 originally - (loc, Effect.ITEM_BREAK, 1) - already right? All the interpretations of how to use the effect hit a wall otherwise, and do indicate that it is a faulty server code.
     
  18. Offline

    ibc2244

    @Boomer
    Ye, I tried:
    ,0,1,2,3,10,20

    None of which worked.

    //EDIT
    Turns out I don't need to use ITEM_BREAK for what I'm wanting to do, I can use TILE_BREAK, (tile break ID), but know I'm wanting to place a block a certain position not below my feet.
     
    Boomer likes this.
  19. Offline

    Boomer

    Supposedly the bug in that code was fixed at the end of march, so if you have a newer version, it should be fine. If you have something a few month old, well, you're also at risk for massive json exploits (force op, etc) from signs, books, etc that have been fixed in the recent versions.

    Hmm, or maybe not: The bug status resolution on closing seems to be "Won't Fix"
     
  20. Offline

    ibc2244

    @Boomer
    I have the latest version of Spigot, 1.8.7.
     
  21. Offline

    WingedMLGPro

    @ibc2244 Try doing this:
    Code:
    @Override
            public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
                    Player player = (Player) sender;
                    if (cmd.getName().equalsIgnoreCase("CommandHere"){
                    Location loc = player.getLocation();
                    World world = player.getWorld();
                    Block block = world.getBlockAt(loc);
                  
                    block.setType(Material.WORKBENCH);
                    world.playEffect(loc, Effect.ITEM_BREAK, 0);
                  }
                    return true;
            }
    }
    This may help
     
  22. Offline

    Boomer

    Other than adding the command check to a command handler that he has already defined elsewhere, what does that do differently to resolve the particle-package issue?
     
  23. Offline

    ibc2244

    @WingedMLGPro
    That's practically what I already have except you check the Cmd.getName();
    The ItemBreak effect is broke and still kicks me and throws an error.
     
  24. Offline

    WingedMLGPro

    @ibc2244 have u tried it without the play effect?
     
  25. Offline

    xTrollxDudex

    Yes he has

    Does the problem still exist on the client? If it does, it's most likely the packet is too small. Ensure the packet being sent is encoded correctly.

    Edit: What build of spigot are you using? Use /version in the console
     
  26. Offline

    ibc2244

    @xTrollxDudex
    Spigot 1.8.7 1.8.7-RO.1-SNAPSHOT
    You are running the latest version

    Just updated it
     
    Last edited: Jun 23, 2015
  27. Offline

    xTrollxDudex

    No, I need the long version (looks like [Spigot-git.{other stuff}])
     
  28. Offline

    timtower Moderator Moderator

    Moved to Bukkit alternatives
     
  29. Offline

    ibc2244

    @xTrollxDudex
    Here ya go:
    git-Spigot-f928e7a-994b2aa (MC: .18.7) (Implementing API version 1.8.7-RO.1-SNAPSHOT)
    ...
    You are running the latest version
     
  30. Offline

    xTrollxDudex

    Dumped the packet:
    Code:
    [11:59:24 INFO]: Trolldude3 issued server command: /dissect
    
    [11:59:24 INFO]: Packet dump:
    
    [11:59:24 INFO]: ITEM_CRACK
    
    [11:59:24 INFO]: -2.6408048
    
    [11:59:24 INFO]: 65.0
    
    [11:59:24 INFO]: -13.989481
    
    [11:59:24 INFO]: 0.0
    
    [11:59:24 INFO]: 0.0
    
    [11:59:24 INFO]: 0.0
    
    [11:59:24 INFO]: 1.0
    
    [11:59:24 INFO]: 1
    
    [11:59:24 INFO]: true
    
    [11:59:24 INFO]: [0]
    Code:
    https://0paste.tk/7634#hl

    /dissect is the command

    Here is the method that does the work:
    https://0paste.tk/7635#hl
    I reckon its an error in there

    Edit: Appears to be so, the length looks to be 1, but it should be 2 according to http://wiki.vg/Protocol#Particle

    Edit 2: HAH! FIXED IT!
    You need ProtocolLib, add this line to the packet adapter:
    Code:
    container.getIntegerArrays().write(0, new int[2]);
    Full code: https://0paste.tk/7636#hl

    Edit3: You change the first value in the array to the block ID and the second value to the block data to modify the break particles (this is a guess)
     
    Last edited by a moderator: Jun 24, 2015
Thread Status:
Not open for further replies.

Share This Page