Making Blocks Invisible?

Discussion in 'Plugin Development' started by puyttre, Apr 19, 2013.

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

    puyttre

    Hey,

    I am trying to figure out a way to make a certain block invisible so that a player can't pass through the block while still not being able to see the block. I know this is possible because it was made here: http://dev.bukkit.org/server-mods/invisibleblocks/ . If anyone has any idea how this could be possible, please post!

    Thanks.
     
  2. Offline

    devilquak

    puyttre

    Boo for closed-source plugins :(

    Possibly it stores block locations and then prevents players from going into those locations. If you describe more about how the plugin works, we can pick it apart and figure it out.
     
  3. Offline

    puyttre

    I actually haven't used the plugin on my server, but judging from the description it looks like it might use packets to detect when a block is loaded. I'm not too good with packets, how about you?

    Edit: Ah yes, here is a quote from the author in the original Plugin Request thread:
     
  4. Offline

    chasechocolate

    I think it can be done with this, I'm not 100% sure because I saw it on some other thread that I can't seem to find now:
    Code:java
    1. player.sendBlockChange(block.getLocation(), block.getType(), (byte) 0);
     
  5. Offline

    Milkywayz

    Not supporting the copying of others work, but theres no such thing as a truly closed source plugin (exception being obfuscated plugins which don't get accepted on DBO), if you wanted to see how the plugin works you can always download JD-GUI and decompile the jar, you'll get very similar code to the original source.

    However, that doesn't mean you should go steal his code and call it your own just because his project is inactive, not that you would have, I just would like to clarify.
     
  6. Offline

    puyttre

    This seems to set the data value to zero. I wonder if there's a different method... or??

    Aha! The second parameter was the material ID. So if you do
    Code:java
    1. player.sendBlockChange(block.getLocation(), 0, (byte) 0);
    it sets the block to air. The only downside is that it makes the block all glitchy when the player moves over it. It would be nice if there was a way to make normal borders around it so it would act as a normal solid block.

    Thank you chasechocolate :)
     
  7. Offline

    chasechocolate

    puyttre it doesn't always have to be air. For example, if you wanted it so players could climb up walls, you would send a vine block change with a (byte) 0 as the parameter.
     
    puyttre likes this.
  8. Offline

    devilquak

    Oh, I know I can do that, I have JD-GUI myself and use it more than I play Minecraft itself. However, even though there is absolutely nothing physically preventing me from peeking at any plugin I want, I stay away from ones that are designated as closed-source. I respect other dev's privacy, as I hope they would if I were to ever go full Charlie Sheen. If someone doesn't want me peeking at their work, no matter how much I disagree with their point of view, I'll do my hardest not to look. On the rare occasion that I have peeked, it was on those plugins that did something really unique and complex that you couldn't find anywhere else, but even then I never used any of the code, as it was just a learning experience.

    In the OP's case, he can, but really shouldn't decompile the plugin to see how it works. He can't use any of the code inside anyway. If I were in his position, in a weak moment I might just take a peek, and see just what in general was going on, and feel bad afterwards. But that doesn't mean it should be done.

    I would recommend he just let the developer have his privacy, and work from what he knows. Try to get the packet method working.
     
  9. Offline

    HeavyMine13

    How can I set a pressure plate to be invisible so players can walk on it without knowing?
     
Thread Status:
Not open for further replies.

Share This Page