Jump to content

DarkGuardsman

Forge Modder
  • Posts

    1479
  • Joined

  • Last visited

Posts posted by DarkGuardsman

  1. still reading threw the code but i noticed in you block class that on activate you don't check to make sure the world isn't remote. You need to do this so the server tells the client to open a GUI with the correct info.

    if (par1World.isRemote)
            {
                return true;
            }
            else
            {//rest of your code here
    

     

    Also why is your GUI id so high. If i'm not mistaken GUI ids are used only per mod meaning several mods can have GUI id 0 or 1.

  2. All ideas are interesting but might i suggest you use universal electricity over IC2. me and the modders that make mods for UE like to go beyond one block creations. Also IC2 like to claim rights to mods made with there API so avoid if you ever do end up programming. If you have anymore power ideas drop by and leave them there someone will pick the idea up.

    http://calclavia.com/forum/'>http://calclavia.com/forum/

    http://calclavia.com/

     

    Your micro wave idea i'm actual working on slowly for a pipe mod i write. Though i plan to use lasers for more graphic appeal but it has one issue that if part of the map unload you can lose energy transmited.

  3. I found the problem, I had certain code in the Entity AI file that used rayTrace to see if the entity was in the field of view of the player. I wanna keep that, does anyone think I could move that method into the client tick handler or some other handler and still get it to work? If yes, then any ideas as to how?...

    Just reduce the number of times it is called. eg call it only if a player is with in x range, then use the ray trace to see if that player is in range and in front on entity. You can also add a tick handler for you entity to control the tick rate to 10ticks or 2 times a second. that will keep it reacting fast enough to be life like and reduce lag.

  4. It's when I right-click the block to open the GUI.

     

    Here's TileEntityCulinary.java: http://pastebin.com/h3Qm3LDY

     

    Note: everything after line 174 is code involving CulinaryRecipe.java.

    And yes, before it's a true API I need to remove that import core.* line.

    try setting the size of the array directly private ItemStack[] inv = new ItemStack[11]; might not be the issue but could. Also add an if statement to getSlot too check if requrest slot is not over the length.

  5. i don't think any changes are needed anymore seeing as there are events to get when a block is placed. If i recall right dires007 is trying to figure this out, and me as well once i get to that point in the mod i'm working on. Shouldn't be too hard once one of use figure out how to get where,when and who placed a block. Then its up to comparing all those to a list of regions. 

  6. That might actual work i'll give it a try with what i found with the how the chest renders. Maybe i can get it to work, i'll re edit this post when i have something tested. While i'm at it though think you can link the code you use might help me a bit even if its simi 2D.

     

    Also i have no clue what a Tesselator is. If your willing can you elaborate on the subject a bit.

     

     

    Edit: Got it working with a bit of screwing around. What i ended up doing was creating a new render inside the my renderHelper class. The challenging part of that was getting the texture to bind to the model. Which i thank cpw's ironChest src for helping me solve that issue.

     

    Only thing to figure out now is how to get it to render different in the player's hand and inv. Right now in the inv it render backwards and off lined. Also when i change the render angle to -45 degrees it kills the inv render. any ideas how to fix those issues?

  7. I have several items i use to spawn blocks with custom renders. What i want to do is get the item to render like the block. similar to how the chest will render in the players hand. How would i go about doing this, and yes i have actual dug threw MC's src looking for how. What i found was that the chest uses render type 22 to render itself and has a class to help render in hand. What i can't find is how to do this with my block or item.

  8. I guess the only thing left for you to do is implement ISidedInventory on your tiles. It is one thing that I did but im not sure if that actually fixed it, cause I have no idea what that interface does except every tile implements it.

    ISidedInventory is used so mods like Redpower, buildcraft, or my mod(Assembly line) know which slot to dump items in.

     

    Also at tomtomtom0909 you might just need to cause the TE inventory to update. Normally there is a method that the furnace uses to update all slots after doing a smelt. This way you don't get ghost items client side, also posting you TE code could help.

  9. if you do it right you can get your mimic block to act like every single vanilla block. For example if you right click with a chest you can have your block turn into a chest by having the chest code inside your block&TE. It would be very complex coding but would work. However,i recommend just having blocks without function be able to be mimic-ed. This way you avoid issue and headaches trying to get it too work.

     

    Also like WiNeTel said your not replacing as much transforming you block to look like the block being placed. You will use the onBlockActivated method and get the item being clicked with. Then you will remove one item from the player's hand and store the item name,or ID in a variable inside you TileEntity. Also from inside you TileEntity you will reference the item that was placed and steal its render,textures,and effects. This way your block will look like the placed block. 

    Also if you do it that way add IF statement to check if the block being placed doesn't have a tileEntity, is a solid block, is a normal MC block, etc to prevent crashes.

×
×
  • Create New...

Important Information

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