Change Packets / Make one block look like another.

Discussion in 'Plugin Development' started by Kepler_, Sep 9, 2012.

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


    I want to be able to make all of one type of a block in a world look like another.
    I have nether portals in my spawn...
    ... but the obsidian doesn't fit the spawn's theme of stone slabs. How make all obsidian in the spawn world look like double stone slabs (ID=43:6)?

    Also, i cant use worldedit, etc. to change the obsidian because i have a plugin that makes the portals teleport to a specific place. Changing the obsidian will make the plugin not work.

  2. Offline


    Personally I think it looks fine. But the packets won't change anything, as texture is defined by block ID. So there really isn't anything you can do :/
  3. Offline


    Player has a sendBlockChange method, it should do what you want. It allows you to disguise blocks as other blocks. The only issue here is that you'd have to send these to players whenever they get near the blocks, which ends up as a big complicated process.

    Another option is using a method similar to this one, to make it so it replaces all blocks of one type to another. This is probably more feasible for what you're doing. Just be aware that this may have issues with Players and block breaking(durability of blocks), but in your case, I don't think Players will be breaking the blocks.
  4. Offline


    sendBlockChange would only work up until the blocks were clicked on or otherwise had an update, and it would have to be sent multiple times for every player and if actually changing the block's type isn't an option because of a plugin... change your texture pack? lol
  5. Offline


    Textures for blocks are handled client side, by block ID. How they act is also defined by block ID. If you changed the block ID of bedrock to that of slabs, it would look like slabs, but not be indestructible/have any of its previous qualities. It would also confuse the real slab. You'd have to do something like:

    2. net.minecraft.server.Block.byId[] = null;
    3. net.minecraft.server.Block.byId[] = net.minecraft.server.Block.STONE_SLAB;

    But that would change all obsidian to stone slabs, and it would lose the property of even sustaining the creation of a portal. I'm pretty sure that would give an IllegalArgumentException: slot <stone slab id> is already occupied when writing <new block>.

    There really isn't a way do do this properly w/o Spout, and even there it would be glitchy, at best.
    evilmidget38 likes this.
  6. Offline


    sendBlockChange "disguises" another block with what ever block you want.
  7. Offline


    This is quite possible without Spout. Changing the packets sent to the client only changes what it appears to the client, not the server. The blocks server side couldn't care less what block ids are sent to the client. Orebfuscator is an excellent example of this.
    bobacadodl likes this.
  8. Offline


    Couldn't you use sendblockchange and whenever the block gets updated, disguise it again?
  9. Offline


    You could do a sendblockchange of block id 43 for the doubleslab, or if it is still in the game send 44 with a data of 6 for the look of the top of a stone slab over the whole block.

    Edit: Seems they removed it. :'( Actually it is still "there", but forced to actually be a slab instead of a full block.
  10. I think the easiest way would be to change the "plugin that makes the portals teleport to a specific place". If it uses the PlayerPortalEvent it may need a complete rewrite, through...
  11. Offline


    How does orebfuscator change the look of blocks? That seems like what i am looking for.
  12. Offline


    I'm not trying to be rude, but have you even read the posts on this thread? Everyone's been mentioning the sendblockchange method...
    ProSl3nderMan likes this.
  13. Offline


    I have. I was wondering if orebfuscator used the sendblockchange method, or some other method.
  14. Offline


Thread Status:
Not open for further replies.

Share This Page