Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/01/19 in Posts

  1. In the way you are attempting to copy, it gives you an edge over other people without being ok-ed by the server. Yes, this is frowned upon. No you will not receive assistance in this matter.
    1 point
  2. As you know, for any given block, only states returned by getStateFromMeta(int) are stored to disk. Additional states returned by getValidStates() are not. Your best bet would be to see what properties in the set of states returned by iterating through metadata 0-15 never change (and do change in getValidsStates()). All 16 states returned for the dirt block from getStateFromMeta for instance will be snowy=false, as that is not stored. This will not be true in 1.13, where blocks will not be limited to 16 (storable) states. Presumably every possible state will be stored. I'm not getting the pushback here. His mod deals with stored world data files, and the integers are still heavily used in the anvil files. This will change of course, but is totally applicable for a program that runs without even having Minecraft (with its nice int to blockstate mapping) running. If you're going to deal with savefiles, there's going to be some numbers involved. Of course things will get more complex in 1.13! Which will of course include the numbers to blockstate mappings in the savefiles, but those are not yet in 1.12 and below, so again I really don't get the pushback against using the numbers. You simply have to when dealing with (generating, editing) savefiles without Minecraft running.
    1 point
  3. @Captain_Chaos We totally understand the context of your question. But you're not understanding our reservations in giving an answer. Firstly, the problem is that the decision on what properties gets converted to meta (and thus saved) is hard-coded in the source for each block in the getStateFromMeta() and the getMetaFromState() methods. I suppose someone somewhere might have generated a complete table but I haven't seen it. If you really wanted this, I think you'd have to do the following: Iterate through the registry to get all registered blocks. Take a block state instance and loop through all the valid values of all the valid properties. I'm not sure the exact methods, but I've seen them before and you seem good enough with coding to track these down. Print out the block and property values along with the getMetaFromState(). Identity duplicate meta values and infer that the property that changes does not affect meta there is not saved. I hope you understand what I mean. Basically you need to do a brute force dump because there isn't a simple mapping. That can give you the full list for the actually saved possible combinations for the current version. But the next problem is that there isn't necessarily a one-to-one or even a "closed form" (like a simple table) mapping between any two Minecraft versions. As an example, fences which currently use transient states for connecting visually are apparently moving to saved block states (or maybe even separate blocks) with the 1.13 flattening. So personally, I would rely on the Minecraft world save converter code (once available) as the definitive approach to converting. Presumably they will think through all the conversions and special cases.
    1 point
  4. Alright, I give up. What a disappointing response. This is the most cliquish, unhelpful, dismissive forum I've encountered in a long time. Not one of you took the time to understand the context, or gave me the benefit of the doubt and answered a simple question about the Forge API. All I got was high and mighty second guessing based on a cursory skim of my question as if I'm some kind of noob writing My First Mod. You'll all be glad to know that in the mean time I figured out an alternate way to achieve my goal and I now have the complete ID to name mapping which according to you would either be impossible to get, or herald the End Times. Thanks for your time.
    1 point
  5. @diesieben07, thanks for the advice. Do you know the answer to my question?
    1 point
  6. @jabelar, thanks. WorldPainter (which is not a mod) has existed since 2011 and you can still load world files from back then, and it can still export worlds to Minecraft 1.1 (not a typo), so I know a little bit about versioning, converting block IDs, etc. I want to use registry names within a version, but I also want to correlate them to the block IDs and data values of previous versions, for various valid reasons which I've tried to explain, and are of no relevance here anyway. I'm only using Forge temporarily in order to get this information from Minecraft. None of this is relevant to my actual question, which has nothing to do with integers, converters, etc.. I just gave this information for background, which I can now see was a mistake. I'm also not looking for programming advice. Would it be possible for someone to address the question I'm actually asking? Many thanks in advance!
    1 point
×
×
  • Create New...

Important Information

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