Jump to content

TheGreyGhost

Members
  • Posts

    3280
  • Joined

  • Last visited

  • Days Won

    8

Everything posted by TheGreyGhost

  1. Hi yes there is; many ways in fact eg if you hook into RenderWorldLastEvent, you can then draw whatever you want over the top of what has been drawn already. @ForgeSubscribe public void drawSelectionBox(RenderWorldLastEvent event) { // put your rendering code here } called from here EntityRenderer.renderWorld Is that what you were looking for? -TGG
  2. Hi Just a comment - mc.getIntegratedServer().getWorldName(); I reckon this will only work if the client and the server are running on the same machine. If a client uses this, it either won't work (or might crash). If you need it on the server only, it's easy MinecraftServer.getServer().getWorldName(); If on the client, the client should ask the server to send it via a custom packet 250 http://greyminecraftcoder.blogspot.com.au/2013/10/client-side-class-linkage-map.html http://greyminecraftcoder.blogspot.com.au/2013/10/server-side-class-linkage-map.html http://greyminecraftcoder.blogspot.com.au/2013/10/client-server-communication-using.html -TGG
  3. Hi This might be of some help? http://greyminecraftcoder.blogspot.com.au/2013/07/rendering-transparent-blocks.html or also http://greyminecraftcoder.blogspot.com.au/2013/07/block-rendering.html -TGG
  4. Hi I had a quick look, couldn't spot the problem. It should be pretty easy to debug by putting a breakpoint in, though? -TGG
  5. Hi Yes you only need to override the EntityDragon methods that you want to change. If your new class extends the old class, you can override any method in the old class, even if it's already "defined" in the old class (unless it's been declared as private or "final", but very few of the minecraft methods are). The vanilla code does this a lot, for Entitys, Blocks, all sorts of classes. For example Block.renderAsNormalBlock - overridden in BlockBed extends Block. -TGG
  6. Hi To be honest I'm not sure what's wrong with the appearance of your mobs - could you describe the problem in more detail? i.e. what you expect to see vs what you're currently seeing? After a quick look through your code I couldn't see the reason the lightsabre doesn't work. But this should be pretty easy to track down if you put a breakpoint or two in the right spot- i.e. in addRandomArmor(), to see if it's called and correctly adds the item to the inventory in renderBasicSith(), to see what happens in the rendering code and in particular whether it doesn't know your Entity is holding a lightsabre, or whether it tries to render the lightsabre but doesn't draw anything. -TGG
  7. Hi The client tells the server to dig the block, the server handles the digging and destroys the block (and sends the results back to the client). The client uses packet14 http://greyminecraftcoder.blogspot.com.au/2013/10/packets-from-client-to-server.html This is handled by NetServerHandler.handleBlockDig The methods in ItemInWorldManager are used to do the block harvesting and item damage In particular ItemInWorldManager.tryHarvestBlock This sets a flag in WorldServer.setBlock which causes the server to (a bit later) send the new block information to the client (markBlockFOrUpdate) -TGG
  8. Hi PlayerControllerMP.clickBlock does this see also PlayerControllerMP.onPlayerDestroyBlock PlayerControllerMP.onPlayerDamageBlock They use the x,y,z position to specify the block being mined, which I think is what you're asking? -TGG -TGG
  9. Hi Never used breakpoints? mate once you learn how to use them you'll wonder how you ever lived without them. Watches too. Are you using Eclipse? http://www.vogella.com/articles/EclipseDebugging/article.html and http://agile.csc.ncsu.edu/SEMaterials/tutorials/eclipse-debugger/ -TGG
  10. Hi Looking at the vanilla code I reckon you only need to register RenderDragon. The only purpose of registering the renderer is so that it can retrieve an appropriate RenderXXXX to call .doRender on, and the RenderDragon calls the rendering for all the bits. Have you tried putting a breakpoint in RenderManager.renderEntityWithPosYaw() and stepping through to see whether it gets to your render code or not? -TGG
  11. Hi That idea would work, with the restriction that the information would be lost when you shut the server down. Hence the suggestions for saving it somewhere permanent, like WorldInfo.setAdditionalProperties or in a player's item. There are other ways of course, for example saving/loading to your own configuration file somewhere. Or you could search the entire world at startup to regenerate your static list. -TGG
  12. Hi To be honest I have no idea from looking at your code but I would suggest that log statements or breakpoints are your best friend here, i.e. you want to figure out where the calls to actionPerformed are coming from exactly, and then track that back to what is generating all the clicks, and so on. Maybe your mouse is busted? :-) -TGG
  13. Hi You might find these useful http://greyminecraftcoder.blogspot.com.au/2013/07/rendering-standard-blocks-cubes.html http://greyminecraftcoder.blogspot.com.au/2013/07/rendering-non-standard-blocks.html -TGG
  14. Hi In that case, check out Item.renderItem, in particular this bit IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(par2ItemStack, type); if (customRenderer != null) { texturemanager.func_110577_a(texturemanager.func_130087_a(par2ItemStack.getItemSpriteNumber())); ForgeHooksClient.renderEquippedItem(type, customRenderer, renderBlocksInstance, par1EntityLivingBase, par2ItemStack); } (func_110577_a and func_130087_a are hopefully called something meaningful in yours) i.e. perhaps it will be enough to call texturemanager.func_110577_a(texturemanager.func_130087_a(0)); and texturemanager.func_110577_a(texturemanager.func_130087_a(1)); before your two custom renders. -TGG
  15. Hi I understand your point, in my case (since I use IntelliJ IDEA) I had to create a macro to do that copying (and I had no end of trouble trying to figure out where to copy it to), so I think your suggestion of printing the root paths as they are created would be helpful. Also, perhaps the existing error message could be enhanced to print both ResourceLocation and the folder structure, eg 2013-10-27 17:09:29 [sEVERE] [Minecraft-Client] Using missing texture, unable to load: speedytools:textures/items/WandIcon.png, (assets\speedytools\textures\items\WandIcon.png); I think your fix for Draco's issue is a good idea. -TGG
  16. Hi When I put a breakpoint in addEntityToTracker, I see two relevant threads: "Minecraft Main Thread" and "Server thread" Your helper function must run in the Server Thread, not the "Main minecraft thread". Perhaps you should try putting a breakpoint in there to make sure. -TGG
  17. Hi What are the symptoms of the problem? -TGG
  18. Hi Cute reindeer there... is that in the new update? What you're asking isn't as simple as you might think. There's some background info on Minecraft ambient occlusion here: http://greyminecraftcoder.blogspot.com.au/2013/08/lighting.html The Ambient occlusion code in vanilla is in .renderBlockWithAmbientOcclusion() and .renderStandardBlockWithAmbientOcclusion() and they assume a cube or rectangular prism. Your block is an unusual shape so the vanilla code won't handle it properly. Disclaimer - if it's different in 1.7, I don't know about that yet. If you see another vanilla block that does the same thing as what you want, perhaps the rendering code for that block might give you clues? -TGG
  19. Hi I gather this error doesn't happen very often? This exception occurs when the collection is modified (eg elements added or removed) while you are iterating through it. So either the client thread is writing to this collection (trackedEntities), or you have done something in EntityTrackerEntry.tryStartWachingThis() that alters the trackedEntities. Are you really, really sure that you're spawning the entity on the server side? I'm not sure what the object 'this' is in your helper function, but perhaps .side is not correct? If you put a breakpoint in your helper function just before the spawning, you could check the thread to make 100% sure it is the server thread. Alternatively you might try putting a try {} catch {} block around the EntityTracker.func_72788_a(), and put a breakpoint in the catch. If you are lucky, you might notice a pattern in what the client thread is doing at the time of the exception. If the error occurs fairly often, you could add breakpoints in your helper, and also in the java.util.HashMap methods with modCount++ (eg .put(K,V) ) - when the helper breakpoint occurs, enable the HashMap breakpoints and resume. If it's fairly rare, you could perhaps create your own copy of HashSet but containing println methods to log all calls to HashMap methods which affect modCount, for example public boolean add(E e) { System.out.println("MyHashSet.add modCount" + map.modCount); return map.put(e, PRESENT)==null; } Change trackedEntities to be MyHashSet instead of HashSet and with any luck the log will tell you exactly who the culprit is. -TGG
  20. Hi What do you do you mean "it does not seem to work"? i.e. what are the symptoms? -TGG
  21. Hmmm I dug into it a bit further and I agree with you that it would require a bit of base class editing to let you extract the information after a failed attempt. What do you think -? FallBackResourceManager:: public Resource getResource(ResourceLocation par1ResourceLocation) throws IOException { // snip return new SimpleResource(par1ResourceLocation, resourcepack1.getInputStream(par1ResourceLocation), inputstream, this.metadataSerializer); } } String allPathsTried = par1ResourceLocation.toString() + ", tried: "; for (int i = this.resourcePacks.size() - 1; i >= 0; --i) { ResourcePack resourcepack1 = (ResourcePack)this.resourcePacks.get(i); if (resourcepack1 instanceof FMLFolderResourcePack) { allPathsTried += ((FMLFolderResourcePack)resourcepack1).getAbsolutePath(par1ResourceLocation) + ";"; } } throw new FileNotFoundException(allPathsTried); //throw new FileNotFoundException(par1ResourceLocation.toString()); } } FMLFolderResourcePack:: public String getAbsolutePath(ResourceLocation par1ResourceLocation) { String rootAssetsName = String.format("%s/%s/%s", new Object[] {"assets", par1ResourceLocation.getroot(), par1ResourceLocation.getname()}); return (new File(this.basePath, rootAssetsName)).getAbsolutePath(); } TextureMap:: public void loadTextureAtlas(ResourceManager par1ResourceManager) { // snip catch (IOException ioexception) { Minecraft.getMinecraft().getLogAgent().logSevere("Using missing texture, unable to load: " + ioexception.getMessage()); } Produces the warning message: 2013-10-27 17:09:29 [sEVERE] [Minecraft-Client] Using missing texture, unable to load: speedytools:textures/items/WandIcon.png, tried: C:\Users\TheGreyGhost\Documents\JavaSources\SpeedyTools\out\production\speedytools\assets\speedytools\textures\items\WandIcon.png;
  22. Hi I think the EnderChest stores its information in the player, which is probably not what you want. Although I've never used it, WorldInfo appears to have space for "additional properties": WorldInfo.setAdditionalProperties WorldInfo.getAdditionalProperties You could perhaps store a list of all receivers in this property and make sure you keep it updated when the receivers are created and destroyed. I'd suggest introducing some sort of game mechanic to keep the number of receivers under control otherwise your GUI for receiver selection will become unmanageable. Best way to find out is to try it I reckon :-) -TGG
  23. Hi Hmmm that sounds like it will be tricky. The code that handles clicks on items in the inventory is GuiContainer.mouseClicked I don't see an easy way to intercept it without changing one of the base classes or (eg) writing a class that overrides PlayerControllerMP.windowClick to intercept the click, and replacing Minecraft.playerController with your new class. That's getting a bit hard to do robustly and I'm not confident it would work. -TGG
  24. Hi Given the number of people I've seen run foul of the "Using missing texture, unable to load:" problem (including myself), it might be helpful to enhance the error message so that it shows the full path attempted eg C:\Documents and Settings\TheGreyGhost\My Documents\IDEAprojects\ForgeCurrent\out\production\TestItemRendering\assets\testitemrendering\textures\items/error.png , or alternatively provides a list of the valid paths. C:\Documents and Settings\TheGreyGhost\My Documents\IDEAprojects\ForgeCurrent\out\production\TestItemRendering etc -TGG
  25. Hi What do you mean "click on a package" exactly? In the inventory screen? The method GotoLink has suggested (if I've understood his/her suggestion correctly) is called when you're holding the item and you press the right mouse button. -TGG
×
×
  • Create New...

Important Information

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