Jump to content

Draco18s

Members
  • Posts

    16559
  • Joined

  • Last visited

  • Days Won

    156

Everything posted by Draco18s

  1. It doesn't work because of the client-server architecture. A SSP game and a SMP game with one connected user are indistinguishable.
  2. Are you having chest pains? @OP: Look at my code! Github link is in my sig. Ba da dum ch
  3. One of the two of them (onAddedToWorld, I think) returns an int. This returned int is the block's metadata. You should really look at blocks in vanilla that already use the desired behavior.
  4. You don't have an onBlockPlaced or onBlockAddedToWorld function to set the block's metadata.
  5. No, I can't, because I am not versed in wiki template syntax. All I know is: It works. If you can't paste it into your wiki and get it to work, I cannot help you.
  6. Are you seriously having trouble understanding the concept of "copy and paste"?
  7. PROTIP: try clicking the link that says "create it now"
  8. You also need to set the hardness. (this.blockHardness = 3) or this.setBlockHardness(3F).//the F indicates that the value is a float, not a double
  9. This: http://www.minecraftwiki.net/wiki/Template:Grid/Crafting_Table If you hit "edit" at the top, you'll see that the rendered page (the documentation on how to use the template) is not the same as the page's actual wiki syntax.
  10. I have blocks that I "render twice" in order to get an overlay. Icon camo = Block.blocksList[wid].getIcon(l, meta); //meta for the block's facing so that it grabs the icon of the face of the block that it is attached to renderer.renderBlockUsingTexture(Block.blocksList[wid], x, y, z, camo); //render the original block at an offset location renderer.renderBlockUsingTexture(Block.stone, x, y, z, block.getIcon(0, 0)); //render my overlay in the same location The same could be done for entities, but you'd have to rewrite their renderers.
  11. Like I said, it depends on what you're doing.
  12. It's called read the javadocs.
  13. Technically you can do this with vanilla. However, either: a) you'll need to make base class edits to handle a "double" rendering pass (essentially rendering a second texture on new quads where they need to go) b) reflections (to do the same, but without editing the base classes)
  14. http://www.minecraftwiki.net/wiki/Data_values#Heads
  15. Depends on what you're doing. The one time I used it, I set the radius to about 5 (because it was a BlockContainer and the packet dealt with items in the GUI, which could only be accessed by someone within 4 blocks). That project is more or less abandoned now, but it was a valid use. Got another project I should finish up that needs some (more) packet-y stuff, and I think that will come in handy there too (TE is out of synch when placed, but interacting with it causes it to update because that is being handled already).
  16. You can limit who gets packets too. PacketDispatcher.sendToPlayersInRange(packet, distance) (Note: function name guess--I know it exists, but I don't remember the exact name)
  17. Or you could just code your own packet data (you can literally shove anything into an NBT tag, which can be shoved into a Packet250, which can be sent to the client). And yes. world.markBlockForUpdate() will do what you need. It specifically makes sure that the client receives the block's current status.
  18. Not to be rude, but I'm going to be rude. How about you do your own damn research? The information is out there and this forum is not here for you to use like your own personal lazy-google.
  19. Wikia has templates. Don't know if it uses the same syntax as the Minecraft wiki, but it'd be easy enough to find out.
  20. Unless you're Eloraam. This tutorial should help out.
  21. class myblock extends BlockContainer Seriously, find a vanilla block that does what you want (cough, a chest, cough) and look at its code.
  22. slot.putStack(ItemStack item) Le gasp
  23. Here's what redstone wire does: Vanilla Redstone behaviour: - Block update event received - Check if can stay - Update strength of block - Calculate the changes in current - Get the current strength - Get the current strength again but this time with the other set of coordinates, gives the same result - Toggle off flag so wires don't give power themselves - Get the strongest indirect power from the world - Toggle the flag back on - If the indirect power is greater than the current strength minus 1, set the strength to the indirect power - For every cardinal direction, check the strength unless the block is the origin (the block is never the origin) - * If any side has a greater strength than the current strength, subtract one and set it to the current strength * Otherwise subtract the current strength or set it to 0 - If the indirect power is smaller than the current strength minus 1, set the strength to the indirect power (repeat?) - If the resulting strength isn't equal to the original strength, update the block and add the surrounding blocks to a list that holds the blocks that need to update - Copy the list of to-be-updated blocks to a new list - Clear the old list - For every block in the list, trigger a block update
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.