Items on Glass

Discussion in 'Plugin Development' started by Alex Nolan, Mar 12, 2011.

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

    Alex Nolan

    Hi! So as most of you know, there is no way currently to place items on glass via multi-player plugin. I think I have found the "easiest" way to do this but need helping implementing and judging how realistically it can work.

    After going through the source for the minecraft server I found a couple of ways this could potentially be accomplished. One way, the most time intensive, would be to modify the "canPlace" methods of all of the items that can't be placed on glass. Another way would be to change the glass's a method to return true. I see several potential problems with both of these, especially the second one will probably added several bugs. The most important problem with these though is that they require modification of the original code :(. Since I would like to do this as simply as I can and as a plugin, this would be unacceptable, so I thought of another way to potentially do this.

    When I said "easiest" in my first paragraph, I didn't mean this would be in anyway easy, simply easier than other methods. My proposed way to let items be placed on top of glass is as follows. The plugin would be essentially lying to the client. On the client everything would be shown as glass, because that's what the plugin would tell it, but on the server it would be stone or some other block. The way the plugin would be able to tell the difference is that it would store the locations of all the "glass" somehow. (Also for compatibility there would be a glass and unglass method that would change real glass to the fake glass and back).

    This seams like a lot of work, and it is. My main problem though is that I don't know where to start, or if it is even feasible to interact with the client as described. I look forward to your guidance and advice :D.
  2. Offline


    This was asked previously. The problem is that if you tell the client that there is a glass block and a torch beside it, the client will ignore the server and just not display the torch. No server mod can change that, since it doesn't matter what the client is told.

    To figure out if it is possible, you would need to look at the code for the client and see if there is a loophole.
  3. Offline

    Alex Nolan

    Aww... whatever happened to trust? xD. Alright, thanks for the advice, I'll poke around in the client source, but if it uses that same way the server does to test if it's a valid position then I don't think there is a chance that there is a loophole.
Thread Status:
Not open for further replies.

Share This Page