Jump to content

Laike_Endaril

Members
  • Posts

    166
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Laike_Endaril

  1. Thanks for the reply, and sorry for my late response! I will look into capabilities.
  2. While it's not my specialty in minecraft modding, I do know that many systems require textures to follow very specific...specifications, so I would double check the file itself. In particular, many systems require that the texture have both its width and height be a power of 2 (16, 32, 64...) I just saw a case in discord recently where someone's file was 257x256 instead of 256x256, and that ended up being their issue. Beyond that possibility, I am likely no help.
  3. I'm currently dealing with a system that stores LivingEntity instances and some related data in a map, based on certain conditions. In order to prevent memory leakage, I need to remove entries from said map as appropriate. This *could* be accomplished by iterating through every map entry * every entity in every world and seeing if any world contains it, on a timer, but that's a bit inefficient compared to an event-based system. As far as events go, I have not been able to find an event specifically for "any time an entity is unloaded" (latest stable forge release; 2768), but if one exists, please tell me! For now, I tried the next best thing, and used a combination of other events. This is working for *some* cases but not all. For example, if I spawn a zombie in an enclosed structure (not in a permanently loaded chunk / "spawn chunk") and move very far away, I receive no messages involving said zombie. If I place a llama outside the structure, I *do* receive a message for that in the chunk unload. Also, even if the zombie has a name via nametag, I still receive no message. Current code: Edit: For now, I've supplemented this with the periodic double-iteration I was trying to avoid. I'm still using the above methods to keep the map size to a minimum and reduce processing due to the periodic iterations.
  4. In general I'm not sure I'd suggest using those methods for something you want to happen "every tick". There are several different forge handles that fire on tick events, but I think the one you'd be most interested in is TickEvent.WorldTickEvent (this is the tick that usually happens 20 times per second for each given dimension, and is shown if you run the in-game command "/forge tps") The other tick events can also be found in the same class (TickEvent). Any chance you could tell us what it is you're trying to do every tick? Better make sure it's not too expensive or you'll break the game pretty fast. Edit 1 =============== If you decide to subscribe your block itself to the world tick event, make sure you have it check the event to see what world it is for, or else each block will be using the event once for each loaded dimension.
  5. Several of the existing "dungeon" mods out there do, in fact, generate the entire dungeon inside the terrain at once (loading all necessary unloaded/non-existing chunks in the process). That being said, I agree with Animefan in that this is a terrible way to do things (it often causes a massive server TPS drop). So I suggest getting inventive in how you generate your structure "one chunk at a time". Them quotation marks are not an accident. For example, if you have a very, very specific structure (ie. no/very few random parts) you can have all the data for said structure already existing in the form of a set of data that is quick and easy to push into chunks (in the form of a file, or simply data that is created inside your mod when it is first loaded, etc). At this point, you just need to make sure you transfer your data correctly. This could involve, for one thing, making sure your structure never generates only partially due to what I like to call "loaded chunk collisions". For example, say a player has traveled in a large circle, ofc. loading all the chunks in the area. Let's say that by some miracle (or the player's intention) there is only 1 unloaded chunk left in the center of this circle. If you decide to start generating a structure purely on chance and decide to start generating it in that one chunk, things may not go well (this is an extreme example, but it's just to illustrate the idea). Pre-generated structures have their uses, but in many cases you may want a bit more flexibility. One way is to simply expand on the first method, but dynamically generate a few structures while the game is loading instead of during runtime, keeping track of their chunk footprints, etc. Another way could be to generate the structure in "rooms" or "tiles" which are each a chunk large, and can connect with each other in a modular manner. This method allows you to literally generate the structure one chunk at a time, but forces a few conditions on you. For example, when you decide to start generating in a given chunk, you should probably make that chunk's "room" have an entrance to your structure. If you have eg. a boss or treasure room at the "end" then each time you create a "room" you'll need to see if there are any remaining unloaded chunks adjacent for you to make more rooms with in the future. If not, you'll need to force your structure to generate an end room in the current chunk. And finally, one of the most complex, but most flexible ways. Using noise algorithms such as those used for minecraft's normal terrain generation. I honestly haven't studied noise algorithms enough to tell you exactly how they work, but basically, they are what allows a player to travel in a giant circle and have the terrain still connect in a sensible way when the circle hits itself, if you know what I mean. A while back I took *someone else's* noise algorithm engine and messed with a bunch of variables it used to make some interesting things like volcanoes. This was not for minecraft, was not in java, and was 2D, not 3D, so don't ask me for advice with noise algorithms in minecraft... I'm sure some crafty people out there can think up a few other ways to generate structures one chunk at a time as well. I haven't gotten around to coding any of these yet, but I thought these up because one of my mod ideas is a dungeon generator that doesn't load extra chunks for generation (to replace roguelike dungeons and a few other dungeon generator mods I had to remove from my modpack due to the cascading worldgen issue Animefan mentioned).
  6. I haven't touched world gen at all yet (though I plan to eventually for 2 of my mod ideas) but one way is to see how others are doing it by looking at existing mods with released source code. Usually if I take this approach, I search curseforge for a mod that seems similar to what I want to try, then go to the mod page and see if it has the "source" tab. Here's curseforge's mods with the "worldgen" tag: https://minecraft.curseforge.com/mc-mods/world-gen You can also select a more specific worldgen tag on the left on that page, such as "dimensions", "biomes" or "structures". And here is one that adds a dimension, and has source available (fairly recent source too, which is good). Disclaimer: I have no experience with the mod itself, I just found it in a quick search is all: https://github.com/Darkhax-Minecraft/Hunting-Dimension Beyond that I'd say maybe start looking through some of these classes: DimensionType WorldProvider (and its subclasses: WorldProviderSurface, WorldProviderHell, and WorldProviderEnd) I'm sure there are some other good classes to look at, but again I haven't actually done any world gen...yet.
  7. Just noticed your view distance is 16. If you're in multiplayer mode, that doesn't change the number of chunks loaded on the server. The server has its own setting that overrides it, so it won't make a difference there. If you're in single player, it DOES change the number of chunks loaded, and it will have an exponential effect on performance as you increase it...try decreasing it a bit and see if that helps.
  8. I honestly can't think of a good reason for your FPS to be low with those specs. I'm just as confused as you are if you're seeing a significant change in FPS between single player mode and multiplayer mode. I suppose a mod with some faulty code which only runs in integrated mode could cause something like that. The core/thread count won't matter much since the game runs mostly on a single thread, but even so you shouldn't have a problem with 3.8Ghz (I have slightly lower clock rate and am running a fairly intensive 100+ modpack that I'm working on)
  9. ...is still pretty low imo, but I'm glad you've got it running at least! hf
  10. Well at least your TPS is a perfect 20 now. I'd keep the RAM set to a number that gives you the best TPS, then mess with video settings, any shaders, etc. to try for a higher FPS.
  11. In Biomes class, line 102: DEFAULT = OCEAN; I think Biomes.DEFAULT is probably supposed to be used more for biome generation and not for mob spawning.
  12. Looks like you're trying to run on 2G of RAM. I saw someone else with 2G as well recently (though the error they posted was due to something else I believe). In this case you most certainly need to increase the allocated RAM for minecraft. Look in the options/settings of your launcher for anything that says "RAM" or "memory". If it has settings for both maximum and minimum, maximum is the more important one (but I just set them both to the same value).
  13. Other than it being related to NEI and potions (or maybe a particular potion), I don't have a lot to say about that one. JEI will handle most of your needs on its own, but if you want the additional features from NEI you might have to go through and disable mods trial-and-error style, because I have no clue which potion it's loading there.
  14. Nice! I won't be looking through your source though (or at least not anytime soon if I do); just wanted a mod name to look out for so I can try it out once you release. I just stopped working on mods for a while to test out my modpack as it stands right now and see what I need to remove/tweak. I'll put your mod name down on my modpack TODO list as something to try out when it releases.
  15. If it's not optifine or better foliage, well...I'd start checking all the other mods. I would do it in groups to speed up the process (and make sure you keep track of which ones you changed each run). The most likely suspects are going to be coremods (they're listed at the start of the crash reports you posted)
  16. Depends on which launcher you're using. The only launchers I've used are the FTB legacy launcher and MultiMC (and ofc the vanilla launcher but I assume you're not using that). For MultiMC it's in settings -> java -> minimum memory allocation / maximum memory allocation. For FTB legacy launcher it's in options -> RAM maximum. For any other launchers you'll have to ask someone else, google it, or look around in the settings/options for the keywords "RAM" or "memory"
  17. I believe if you run the game from a console it will show the errors in the console when it crashes (eg. if you're on windows, open up command prompt, navigate to your game directory, and run the game). Most launchers (like the FTB launcher or MultiMC) already have a console built-in that should show this output as well.
  18. That sounds pretty cool. I've been working on a magic-themed pack so the first thing I thought of was some kind of spell that made an entity more prone to being struck by lightning or something, but I hadn't considered the idea of making the lightning more realistic. Edit: If you finish the mod I'd be interested in using it. Already have a mod name in mind for me to look for? (That is...if you're ok with others using it in a modpack?)
  19. Nice! That's a far cleaner solution than what I had suggested. I'm pretty curious what you'll make using that system. Sorry about that. It does, in fact, crash when I test it (with a bad field name), but not directly. It crashes because I'm using that code in the constructor of my main mod class, so even though that particular error was caught, it ends up crashing (because the mod didn't load properly and not because of the exception I had caught).
  20. You're right. It just doesn't prevent the game from crashing. Edit: Earlier I should have said "The game still crashes after e.printStackTrace prints its output."
  21. e.printStackTrace() crashes the game after printing. That's a fantastic point.
  22. One reason that it may not always work is that I'm guessing the method only looks for entities that have their origin point within that range. Ie. something with a large bounding box (like the ender dragon) could have its origin point (the point referred to by its posX, etc) outside your entity's bounding box, but still have a (large) part of its own bounding box overlapping that of your entity. This is all assuming the method you posted doesn't account for entity bounding boxes when you give it a range.
×
×
  • Create New...

Important Information

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