Jump to content

Elix_x

Members
  • Posts

    878
  • Joined

  • Last visited

Everything posted by Elix_x

  1. I don't have my ide right now, and that's just and idea, but try passing te's coordinates to ticket requester, instead of chunk coordinates.
  2. Although it is still possible to use custom IRecipe to depend on enchantements.
  3. It should not. Unless you change entities values from renderer... But those only affect client.
  4. There's definetly a way, because managed to do it. If you want to have more information on world gen (incluing rivers and lakes), here's my topic where i'm understanding world gen in details: http://www.minecraftforge.net/forum/index.php/topic,34621 I discovered some interesting stuff.
  5. http://lmgtfy.com/?q=minecraft+forge+changing+entity+render+distance
  6. That is possbile, but far from easy. You have to host a server, that holds "friends states". Then you have to write your own packet system for your mod that sends and receives packets to/from your server. Subscribe to different events in forge, and send friends state update to your server. Finally, when you want to know state of your friend, send packet to your server and server sends you their state back. Another option, without hosted server, can work only if you have fixed IPs. In that case, you can send packets directly between your computers, and wait for answer packet. If it hasn't come, firend is offline. But, that would require creating access ports in your modem, separate net handling and lots of other stuff.
  7. I don't know if i come up like an idiot if i say this, but i seriously have no idea Really, i don't even know where to start. Trigonometry is fine for me. Just a pen and paper is enough to find out the perfect numbers. I just have no idea how to start the rendering process of something, anything. The only thing that i know about OpenGL is that it uses some primitives ( Lines, Points, Quads, Polygons ... ) to draw complex (in case of minecraft, very simple) objects. I don't know, however, how OpenGL does this. So your black hole is entity, right? First, try to render simple model in place of black hole. For that, just google entity rendering and a lot of tutorials will show up. When you will know how to render simple model for your entity, you can start making complex renderers.
  8. Also, just to note, .json extension is not compulsory for gson to read. Internal structure is important. But using .json extension just makes users not that confused. As to code that i posted, it was pseudo code, to help you figure basics and how to encode maps (it's not always needed to use type tokens with gson). Also, as everybody said, now that you know what to use, learn how to use it.
  9. No. File must be located in config directory with other configs. So config/MyFile.json . And better would be grabbing modConfigurationDir() from pre init.
  10. It's java.io.File , one with .json extension and where users can configure weight values. And as Draco said, not everything is possible with json, in case of items "holding" other items, api is needed. As to me, best idea woul be to create Interface that can be implemented on Item with method returning float and ItemStack as arguments. Kinda like public float getWeight(ItemStack itemstack) , then in your main get weight method, check if item stack's item is instance of your interface and invoke the method.
  11. Kinda yes and kinda no. Json allows you to encode objects in onjects in lists in other objects. But meanwhile, you can encode objects to string via gson and instead saving it as json file, save it as value in config file... @HappyKiller1O1 A LOT of mods use metadata for DIFFERENT items. Good example: thermal expansion. All ingots are same item, but different metadata. All cells, are same block, but different metadata. Same thing goes to IC2, botania, immersive engineering, MFR... So, you kinda want metadata to be supported via iser config. With json decoding can be easier, as you can simply do this to get Map<String, Float> from json file: JsonReader reader = new JsonReader(jsonFile); Gson gson = new Gson(); Type stringStringMap = new TypeToken<Map<String, Float>>(){}.getType(); Map<String ,Float> map = gson.fromJson(reader, stringStringMap); Now, how to translate strings to item stacks? I have helper class that i'm using, you can use my code if you want. Here: https://github.com/elix-x/Excore/blob/master/1.7.10/src/main/java/code/elix_x/excore/utils/items/ItemStackStringTranslator.java PS: Adavanced methos support nulls and oredictionary. Metadata is supported by simple methods.
  12. Also, you can use json with gson. To serialise and deserialise Map , use TypeToken . Example: Gson gson = new Gson(); Type stringStringMap = new TypeToken<Map<String, String>>(){}.getType(); Map<String,String> map = gson.fromJson(json, stringStringMap); EDIT: And instead unlocalised names, use registry names. Those are better and simpler. Those can be obtained via methods in RegistryNamespaced , which for blocks is GameData.getBlocksRegistry() and GameData.getItemsRegistry() fo items.
  13. I'm pretty sure you have to implement IUpdatePlayerListBox instead of ITickable . Or is ITickable your interface extending IUpdatePlayerListBox ?
  14. Using WorldType is simpler than ASM: Create your class extending world type, as super constructor, use one with only string as argument. String is name of world type. There are a lot of usefull methods that you can override, one of them returning chunk provider. Now, in your main class, in init or pre init method, just do new YourWorldType() . It is also a good idea to store it somewhere, but if it is just for testing purposes, it may not be needed. Now, when creating new world, just seleсt your world type and you can test your generator.
  15. StatCollector.translateToLocal
  16. If you want to work simulataneously on both computers and they are on same network, just share mod folder on one computer and select it on another. If you want to work at different moments on different computers and have code synced, use github.
  17. Is that new with 1.8? Neat. Yes. And it was added ~5 moths ago.
  18. Another very hacky idea: Whenever manufactured block is placed, add to chunk saved data it's position. Now, when you want to check if block is manufactured or not, just check list of manufactured blocks in this chunk. Although there are 2 not sure things here: -I don't know if there's chunk saved data, but i know for sure that there are Chunk.Save and Chunk.Load events that you can use to save list of manufactired blocks. -Depending on what you call manufactured block, it can be easy or even nearly impossible. If it's player placed block, there are events you can use. For everything else, there's no proper way of detecting source of placement. (Well, you can ASM chunk class and read stack traces to find placement source, but is it worth it?).
  19. Ok. Just checked, it works. Null in 1.8 and 0 stack size in 1.7.10. Thanks!
  20. I'll try that. Is it only 1.7.10 bug and i can without problems return null in 1.8?
  21. Nope . Crash. Exactly the one that is shown in crash part. Even if i leave only return null; it crashes.
  22. Just for info: There's also a method that stops flickering that you could override ( shouldCauseReequipAnimation ) if using countdown way.
  23. You add filled gun without countdown tag. Then when it's righ clicked, you add countdown tag. In onUpdate , decrease countdown only if thre is one.
×
×
  • Create New...

Important Information

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