Having two versions of 1 block?

Discussion in 'Plugin Development' started by emtffkev, Mar 22, 2011.

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

    emtffkev

    I know you can't create a new type of block via bukkit (or have been told so at least). Is it possible to reuse an existing block that is already in game and simply give it different properties?

    What I am trying to do is change (or add) an iron block that emits light.

    Basically I want to create a new recipe, make it emit light, and keep the default iron block in game as well.
     
  2. Offline

    Mixcoatl

    Blocks have properties that are intrinsic to them. You cannot create a block that intrinsically behaves differently than other instances of that block. However, you can use a block of a certain type to trigger behaviors or effects. For example, you might have a block type, say IronBlock, that when placed on top of another block, modifies the lighting of the surrounding blocks.
    Also: while Bukkit supports getting the light level of a block, it doesn't presently support setting it. You can get this functionality by invoking one of the obfuscated methods on the world handle returned by the CraftWorld class, but it is more or less guaranteed to break with each subsequent release of Minecraft.
     
  3. Offline

    emtffkev

    Would it be easier to simply change what texture is used for glowstone to make it share a texture with iron blocks?

    This would be so each user on the server (which doesn't have Nether enabled) didn't have to have a custom texture pack replacing the glowstone texture to make it look like an iron block. This would essentially change all glowstone blocks to look like iron, but behave like glowstone?
     
  4. Offline

    Mixcoatl

    There are no server-side textures, presently. The client uses whichever texture the player has configured. You can ask or recommend that players use a specific texture, but there is no means to enforce it.
    If you don't mind that, then, yes, it would be easier to re-texture glowstone. :D
     
  5. Offline

    emtffkev

    Sorry Mixcoat, I don't think I worded my response correctly.

    I don't mean to re-texture the glowstone itself, but rather at the server level tell it which texture to use. So rather than using the texture for glowstone, it instructs it to use the texture for iron block. I've been doing some SSP mods lately and I may be getting confused on just what you can do client side and what you can do server side.
     
  6. Offline

    Livewire

    Not 100% sure how Minecraft does its stuff but my guess is that the server doesn't tell the client what to make the block look like, but rather that the server simply tells the client what block it is and let the client handle the rest.

    I'm guessing if you could find a way for the server to think it's an ironblock and thus tell the client it's an ironblock but actually have it treated as a glowstone block, that'd work, but I'm rubbish with Java, and from what I'm seeing tossed around in discussions it sounds like the only way to make Minecraft think it's an ironblock is to tell it it's an ironblock.
     
Thread Status:
Not open for further replies.

Share This Page