Jump to content

DarkGuardsman

Forge Modder
  • Posts

    1479
  • Joined

  • Last visited

Everything posted by DarkGuardsman

  1. getServerGuiElement must return a container.class both so it doesn't crash and so you can have items in you GUI. if you want a good reference code check out my github https://github.com/DarkGuardsman/SteamPower/tree/master/src. Tutorials can only get you so far, looking at other peoples code can get you even further. Also if you want to get really good help post your code on github reading it in these post is not easy. If you can do that i can find your errors really fast.
  2. speaking of sign class there is a method in there to send a packet to the client with the sign text. You can change it up a bit to fit your needs. /** * signs and mobSpawners use this to send text and meta-data */ public Packet getAuxillaryInfoPacket() { String[] var1 = new String[4]; System.arraycopy(this.signText, 0, var1, 0, 4); return new Packet130UpdateSign(this.xCoord, this.yCoord, this.zCoord, var1); } change packet to Packet250 or what ever the custom packet is. I used this for a while till i need to update the server from the client. However if you want to do it the more reusable way, in which you can set it up to send any info to and from the server.
  3. i noticed when i was creating mob like Entities i needed to implement IMob or my Entities didn't render. For your snow ball you might have to do something similar. Also posting src code helps a lot.
  4. For normal blocks you'll have to write you TE to detect the right click of the blockItem.If you don't have a TE(tileEntity) you'll need one to store extra info. When you TE detect the item as a block you'll need to save the block's class,or ID. From this you need too pull the block's render,texture,bound info. Then turn your block into a mirror of the block's looks with one side of it having your block's texture.
  5. A block is simple the physical existence of the block with code to change how its is placed,removed,destroyed, walked, on etc. The block also shares the same vars with all blocks. Meaning a change in one block is a change in all blocks. Also a block is limited to storing so much data usually in metadata. It normally can't save any data past the metadata. A TileEntity is the spirit of a single block. You can use it for storing data, doing per tick updates, and sending/receiving packet data. You can also use it for doing special renders,having something other than a block shape. Another is having 1000 blocks in one block by storing type info in the tileEntity.
  6. current source code and i might be able to help you out
  7. Mostly its just renaming things but also there is a tutorial on the forge wiki.
  8. oh so you want to find if its just above the block. //your'll have to fiddle with the bound box size to find only items above AxisAlignedBB bounds = AxisAlignedBB.getBoundingBox(x,y+1,z, x+1,y+2,z+1); //change EntityItem too the entity you want to find List<EntityItem> items = par1World.getEntitiesWithinAABB(EntityItem.class, bounds); if(items.size > 0) { //there is something above block } there is more likely an easier bit of code that just checks of the spot you want to place is clear, or else placing normal block would cause issues. Check line 3461 in World.class and the ItemBlock.class
  9. well you can get close to it by checking if the distance to block is less or equal to one. public boolean collectItem(EntityItem targetItem) { if(targetItem == null) { targetItem = findClosestItem(this.posX, this.posY, this.posZ,30); } else { if(!targetItem.isEntityAlive()) { targetItem = null; } } if(targetItem != null) { PathEntity PathToItem = this.worldObj.getPathEntityToEntity(this, targetItem, 30, true, false, false, true); if(hasPath()){ this.setPathToEntity(PathToItem); this.moveSpeed = 1.0F; [b]if(targetItem.getDistanceSq(this.posX,this.posY,this.posZ) < 2)[/b] { targetItem.setDead(); //TODO add item to inventory targetItem = null; } } else { this.moveSpeed = 0.23F; } } return false; } this is the code i use for collecting items. It has cod for checking distance to target.
  10. Ok, maybe when i create TileEntity and change some values in createTileEntity(World world, int metadata) it works, but if I trying to change it from client side - it fails. That's why I must create proper packet exchange. So I looked in your code, made something that look pretty the same... but it fails again. So can you or someone that reads this help with this? Maybe manuals or something? next chance i get i'll create a short tut on the subject, or at least raw code that can be copied.
  11. its been changed to GameRegistry, EntityRegistry and ClientRegistry. They do about the same but as better generalized https://github.com/DarkGuardsman/GSM-Guardsman/blob/master/src/common/guardsman/GuardsmanMain.java https://github.com/DarkGuardsman/GSM-Guardsman/blob/master/src/common/guardsman/guardsmanProxy.java
  12. and this is not: You sure in 1.3.2 Minecraft single player is a lan server. I use to think it worked fine til a lot of my stuff stopped updating correctly. Namely the rotation of my Machines for several of my mods.
  13. Might want to send a packet to the client with the angle in it so the render can get the updated angle. Also might want to send what ever other info the client needs for the render as well. If you need help making packet stuff check out my gitup https://github.com/DarkGuardsman
  14. i've seen 4 done for Forestry but have no clue how to do it. However, if you figure it out that would solve having to have a separate item texture for a TESR.
  15. I think that was the whole point of that piece of code, but you can just simply change the return statement to do what ever you want it to do. You could return a whole List/Array of the blocks or just an Integer ( int ), which returns the amount of the blocks it can find with the same Block ID. There is so much you can do with that little function yep thought i give an example and let everyone else work out what they want it too do. I use a similar version of this for harvesting wood that why it returns the first instance. It follows the same idea of Buildcraft quarry going from one top corner to another bottom corner. I have another version that will find every last instance of a block then mark it for harvesting.
  16. hard to tell from your src posted but i think you forgot to register your tileEntity. Here look at my github might help you out a bit https://github.com/DarkGuardsman/SteamPower/tree/master/src
  17. just create a searching method that start at xyz and miniz 4 from the xz coord. then work you way too xz plus 4 using a few "for"statements with an "if" statement in the middle. something like this public Block findBlock(int x,int y,int x, int blockid,int radius) { x-=radius; y-=1; z-=radius; for(int k =0; k < 2; k++) { for(int j =0; j < radius; j++) { for(int i =0; i < radius; i++) { Block block = worldObj.getblock(xyz); if(block.blockID == blockID) { return block; z++; } x++; } y++; } }
  18. it could be turned into a server side only mod but its always safe to have a client side mod.
  19. could be i guess i might need to update my .bat files so they link the path names right. Still a bit odd though seeing as this never happened before 1.3 update. Then again in 1.2.5 people had minecraft.getDir() in the client side of their mod.
  20. thanks lex i'll try that Edit: works like a charm. Just hope other mod makers see this and fix their config files.
  21. try World.setBlockWithMetaDataWithUpdate I think that will cause it to be placed and updated so it shows diffrent.
  22. This is not a big deal but all the mods i have keep dumping there config file onto my desktop. For most this wouldn't be an issue but my desktop get randomly cleaned after I've piled too much files, folder and links on it. For some reason though a few mods actual end up in the right config file and I've figured out why. Before anyone says i've not tested much i've tested on 4 pcs with all the same effect This code will cause the config file too end up in the wrong spot, or rather where ever the program that launches minecraft is at that time. For example the .bat file i use for error testing is on my desktop. Moving the .bat file around does cause a new config file to generate. Same for my minecraft.exe launcher. static Configuration config = new Configuration((new File("config/EUIndustry/SteamPower.cfg"))); this will end up in the config folder in .minecraft directory. static Configuration config = new Configuration((new File(Minecraft.getMinecraftDir(), "config/EUIndustry/SteamPower.cfg"))); The issue is this only works Client side and since mods are both client and server this can cause issues. Mainly since Minecraft.getMinecraftDir() from off the top of my head doesn't excist server side. So what i'm asking what can i do to make sure the configs for my mods ends up in the right spot without using Minecraft.getMinecraftDir().
  23. I know what you mean i was a server admin for a decent size server for a while, and updating a server is a pain when you don't know if everything is updated or stable. However, what i can tell you is most of the big mod maker are working on there mods but might be taking there time. You got to remember minecraft did change massively,server and client mod are now the same exact thing. Also on top of that big mods know they don't need to update fast or maybe they don't want to update right away.I myself use to wait 2 weeks after a version update to even start. Also instead of getting IC2 might i suggest UE it runs better, and will soon surpass IC2.
  24. Would go threw everything but just look at my code https://github.com/DarkGuardsman/GSM-Guardsman
×
×
  • Create New...

Important Information

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