Solved Blocks being set back to default ID

Discussion in 'Plugin Development' started by jimbo8, Nov 25, 2013.

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

    jimbo8

    Hi!

    For some reason, whenever you use/place a block of any kind, it's set back to default. For example;

    When you place a cobblestone slab, it turns into normal stone slabs.
    If you throw a strength potion, before it gets throwed, it turns into a water bottle.

    I'm pretty sure that this has to do with my plugin, so that's why i've posted it here. I might have messed something up anywhere, but i got 60-70 classes in my plugin and don't want to go through every single class, so i though maybe anyone else had an idea :p

    Thanks!
     
  2. Offline

    SuperOmegaCow

    jimbo8 well we would need you to post some code or the whole project.
     
  3. Offline

    NathanWolf

    Did this start happening just recently? Maybe you changed something you could share as a clue?

    I assume you did not get 60-70 classes into a writing a plugin before noticing this behavior... :D
     
  4. Offline

    jimbo8

    It happened about a week ago, but i kinda ignored it and continued coding :p

    But we are close to a server release, so this is one of the more important stuff now.

    SuperOmegaCow
    I could try to find some code, but not the whole project.. It's kinda private ;)

    NathanWolf
    I will try ;)
    I've made a few 10'ish classes after i noticed it, so, yeah.. I'm not the builder on the server, so i didn't notice it before he told me. He also had a break for a week or something like that, and within that week i made a few more functions.
     
  5. Offline

    NathanWolf

    It sounds like one would be a BlockPlace event handler doing something funky... for thrown potions I've no idea.
     
  6. Offline

    jimbo8

    NathanWolf

    It all happens before the event itself gets activated.

    I haven't set up any methods that involves potions, but i might suspect that i'm cancelling a event somewhere. I'll look some more and say what i find.

    [EDIT]

    Took a quick look through my listeners, couldn't find anything around that "part".
    Some pictures:
    Before i placed/used them:
    http://i.imgur.com/9Gl1zjl.png

    After:

    http://i.imgur.com/3OtOdTF.png

    btw, sorry for bad english :p
     
  7. Offline

    LazyLemons

    It's clear that what is happening is that you are setting the data of an ItemStack to 0 after an interact, or a block place, etc. You can't possibly expect more help from us without posting some of your code.
     
    Skye and NathanWolf like this.
  8. Offline

    xTrollxDudex

    jimbo8
    Well, do you know why people keep plugins private?
    For several reasons:
    1) They think they're too good to get help from anyone
    2) They think people steal code (we don't, we can probably code something similar more efficiently in about an hour)
    3) Sensitive data (which you don't have, or can be easily removed) and finally,
    4) Too much time and effort, this guys just gonna copy code (well no, no one wants to do that unless they are the laziest person on earth or just want to bet plugins, you know why? We don't feel accomplished by copying code)

    All these reasons are stupid and easily countered, why not help us and yourself solve the problem and share code so we can help you
     
  9. Offline

    jimbo8

    I'm sorry, but this is for a big project, and i don't want everyone to copypaste every single thing!

    We are a team developing this plugin, and they agree'd with me, but as said, i don't even know where to look.

    I also said that we can give parts of a code where we think the problem might be, but we have no idea for what caused this. One of the developers said that the blocks may have lost their metadata, even though we haven't touched metadata yet.
     
  10. Offline

    xTrollxDudex

    There are a lot of big open source projects
     
  11. Offline

    jimbo8

    Yeah, but that's their choice. In Norway, there aren't many servers, so there's not many developers either. Everyone that got a "dream" of starting a server, does whatever they can to get one of these plugins.
     
  12. Offline

    Shevchik

    Then if you can't provide code so we can help you - just call the moderator to close the thread.
     
  13. Offline

    jimbo8

    I don't think you get it.

    I need some help for what COULD have made it, like a Listener i have triggered with an accident or something like that, there could be no other way. As said, i'll try to find some more code when i get home to share, but i won't share the whole project. I can share all of my Listeners when i get home, but as said, not the whole project.
     
  14. Offline

    LucasEmanuel

    jimbo8
    I don't think you get it. The reason this is happening can have so many reasons we could spend years compiling a list of each and every one of them. From a single misplaced bracket or semicolon to several lines of code in a class that from the looks of it has nothing with the event to do. Unless you actually provide us with some real code from your project we can not help you.
     
  15. Offline

    jimbo8

    LucasEmanuel

    As said, i'll share every Listener class and eventually some command-classes.

    I don't want to start a big discussion here, let's go back to topic and i'll edit this post later on with the classes :)

    Fixed it, nevermind!

    I put every single listener in a comment to see which one it was, and found out that in the toolrepair class, a method was misplaced, and therefor, set the itemstack to 0. Setting as solved now.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 5, 2016
Thread Status:
Not open for further replies.

Share This Page