Jump to content

Elyon

Members
  • Posts

    270
  • Joined

  • Last visited

Everything posted by Elyon

  1. Look into these subjects: Minecraft forge coremod Java reflection Java ASM
  2. I don't know what Techne spits out, but it should be simple to convert it to use tessellators. Failing that, you can call Tessellator.instance.draw() in the beginning of your method, and Tessellator.instance.startDrawingQuads() in the end. Using the tessellator would be preferred though, I think. Keep in mind the texture atlas containing the icon you set for the block is bound. If it's a static block with a single simple texture, though, I don't see why you wouldn't want to just use the tessellator in an ISimpleBlockRenderingHandler.
  3. I am not sure what leaves do to differentiate between having been placed by a player, and having been spawned by a tree, but it seems like something akin to using a single bit of metadata - the third least significant bit, in this case. While you can of course not use this for blocks that have directions, etc., perhaps this can be of use when determining whether, say, dirt or stone was placed by a player. There would be several ways to go about this, I presume - but relying on metadata in blocks that don't expect metadata is just asking for trouble.
  4. Define exit the world, please. Oh, and what shall happen to the connected clients while the server doesn't have a world? Also, moving around files in the world folder directly? To what effect? Surely there must be a better approach to what you want to do than to move around files in the world folder directly
  5. Why can't you see the vanilla code? It should be in forge/build/tmp/recompSrc/net/minecraft
  6. While I much prefer Github personally, there is no good reason not to host your repository remotely. BitBucket, private server, anything but just crossing your fingers. Besides, add a license, and it will be illegal to outright steal your source code. Software development in general thrives on the ability to be inspired by the work of others, though.
  7. Wow, this is an interesting issue. Or rather, an interesting context (or lack thereof). I am not sure, but I think you will want to have a look at what launchIntegratedServer does, and replicate parts of it (starting a new thread, etc.) without replicating others (drawing to the screen, etc.). Best of luck, and colour me curious.
  8. I am often digging through some rarely-used code, at least judging by the amount of obfuscation. Is there any way I could be helpful in the process? I myself have thought about writing proper API documentation for fields and functions that I feel could benefit from it (which, frankly, is most of them) - but as you so rightly put, there is no sense in doubling or even tripling efforts if a bit of cooperation is possible Not to mention 1.8 is "right around the corner", relatively speaking.
  9. forge/build/tmp/recompSrc/net/minecraftforge/common/util/EnumHelper.java is the deobfuscated version. What issue are you having? Make sure your import statement is correct, as described above.
  10. Welp. For future reference, the Nether is dimension -1, not 1. The chunk now loads as expected, and the command block clock chirps away even while I am in the overworld, having never entered the Nether. Now, I am wondering how to fetch the Nether chunks while in the Overworld on the client. Since I have no experience with packets in Minecraft, this seems a daunting task. I will give it a go and report my findings. In the meantime, any additional pointers to the best course of action will be immensely positively received
  11. Hmm. I will try having a go at outputting the values of the various fields of the ForgeChunkManager cache, to see if I can pinpoint the issue. I figured as much. Well, thank you, now I know that approach is probably the best (only) way to go about it. I have already written quite a bit of a custom world renderer, so it shouldn't be too difficult to keep another instance of RenderGlobal around specifically for that renderer. I realise the client was never meant to be in more than one dimension at once, but I am sure I can work around that. I may turn to asking more questions about this approach, once I can get the server chunk loader (a prerequisite for client chunk loading, I presume) working. Again, thank you for your input. I will update this thread once I solve the issues mentioned.
  12. Ah, yes. The log. The "Forcing chunk" message is being printed (and only once, when the block is added). From that, and from the fact there is no errors or warnings or otherwise indications that the call had failed, I make the assumption that the ForgeChunkManager#forceChunk call succeeds, as well. There aren't any gotcha's regarding cross-dimension chunk loading, I presume? As for chunk loading cross-dimension on the client side - I guess I will have to reimplement what I need for my idea to work, then. It really is vital for me that both the Overworld and the Nether are rendered simultaenously without unloading one or the other, sadly. EDIT: You are right, there is no good reason to even keep a CommonProxy, when I might just as well put the code there in my main mod class. Thank you!
  13. Hi! I have been toying with forced chunk loading through the ForgeChunkManager . I have tried following the suggestions in this and that topic, but either they are too vague or I am too daft to make it work. Either way, I am successfully registering my (stub) LoadingCallback class in CommonProxy : public void preInit(FMLPreInitializationEvent event) { super.preInit(event); ForgeChunkManager.setForcedChunkLoadingCallback(Chocolate.instance, null); } As it needs to work for both the combined client/server singleplayer experience, as well as for dedicated servers, I felt I couldn't put it in ServerProxy . My Block class similarly successfully requests a ticket and forces the chunk: @Override public void onBlockAdded(World world, int x, int y, int z) { super.onBlockAdded(world, x, y, z); if (!world.isRemote && this.ticket == null) { this.ticket = ForgeChunkManager.requestTicket(Chocolate.instance, DimensionManager.getWorld(1), ForgeChunkManager.Type.NORMAL); if (this.ticket != null) { ForgeChunkManager.forceChunk(this.ticket, new ChunkCoordIntPair(0, 0)); FMLLog.info("Forcing chunk ( %d , %d )", 0, 0); } } } I have tried to paste only the related bits of code, but please let me know if I ought to paste more code. These are the only bits I have that relate to chunk loading, though. Note that I am well aware the ticket field (and indeed, the instance) of my Block class is shared across all blocks of that class. Currently I am simply testing whether I can force chunk ( 0 , 0 ) in the Nether to be loaded while I am in the overworld. I built a simple command block clock completely within chunk ( 0 , 0 ) that outputs "Nether" to the chat once per second whenever it is loaded. If I travel to the Nether, it joyfully chirps "Nether" every second, but as soon as I leave the Nether, it ceases to do so. Certainly, I am just missing something obvious, here - but I have no idea what grave oversight I have made. ----- As a bonus/follow-up question that need not be answered (I will be working on it myself, soon as I can get regular cross-dimensional chunk loading working): How would I go about force-loading chunks not only serverside, but clientside as well? I would like to be able to load chunks cross-dimension for rendering remote Nether regio-- uh. Remote chunks in the Nether. Yes. Any feedback/constructive criticism will be appreciated Thanks!
  14. Welcome to the forums Forge already uses that exact file, though. See the repository name?
  15. Chill? Man? Yep. Okay Glad you figured out what you needed to do
  16. ... huh? What do you want to do? Look in vanilla classes that do what you want, see how they do it. IDs are being phased out for just about everything, I believe.
  17. If you don't need special functionality, and you don't need to store more than 4 bits of data for the block, you may as well look into implementing [url=http://www.minecraftforge.net/wiki/ISimpleBlockRenderingHandler]ISimpleBlockRenderingHandler[/url] , and registering the implemented class with the RenderingRegistry . This way, you can have several blocks using the same BlockRenderingHandler without resorting to a TileEntitySpecialRenderer , and avoiding code duplication. If I recall correctly, registered ISimpleBlockRenderingHandler s are also cached, improving performance over a TileEntitySpecialRenderer. I might be wrong, there, though. Either way, it sounds like an ISimpleBlockRenderingHandler will suffice in your use case. Enjoy
  18. What version of Forge are you using? I have no issues importing or using EnumHelper, here. Have you checked that the files EnumHelper.(java|class) exist? For fear of insulting your java knowledge - you are importing, specifically, net.minecraftforge.common.util.EnumHelper , yes?
  19. You don't want buildings? What do you want, then? You want your villages (which consists of what?) to appear and disappear based on door numbers? ... But without buildings, there are no doors (probably). What is the village collection supposed to represent, and what will it do?
  20. Please use [ code ] tags for short snippets of code, and gists for larger amounts Do you want your village to coexist with other villages? Do you want to use the vanilla buildings in your village? If you would please be a bit more specific about what you need - not just "I need to add this code", but rather "I want this and this result", I think we can find a way around your needs without having to rely on coremods. Also, I believe the general sentiment is, if you don't know how to make a coremod, you shouldn't be making one. There are plenty of resources both on this forum - and on the web - on how to go about making coremods in the general sense. If you can't tailor those guides and instructions to suit your specific needs, you probably should really be looking into how to achieve what you want to do without making a coremod. In fact, you should probably always be very sure you need a coremod before you choose to make one. Your current need sounds like it can be managed without a coremod, so let's approach it from that angle to begin with, shall we? Note: If you end up making a coremod, and you are having specific issues that to your knowledge should work, yet do not seem to, you are more than welcome to ask for advice, here. I don't think anyone will be willing to take you from Goth to Boss on coremods without very serious justification and commitment on your end.
  21. Paste what you have now, along with any error logs you might be getting. Please paste as a gist - that has line numbers, syntax highlighting, and unlike other popular paste-sites - no ads. Additionally, it allows us to fork your code.
  22. This might still be relevant. Specifically, VillagerRegistry#registerVillageCreationHandler . If that is not what you had in mind, there are hooks for adding your own structures to worldgen as well - I don't know them, specifically, but you should definitely not have to tamper with vanilla classes.
  23. What code do you need to add, where do you need to add it, and why do you need to add it? Are you absolutely certain there is no way around a coremod?
×
×
  • Create New...

Important Information

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