-
Posts
878 -
Joined
-
Last visited
Everything posted by Elix_x
-
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.
-
Although it is still possible to use custom IRecipe to depend on enchantements.
-
It should not. Unless you change entities values from renderer... But those only affect client.
-
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.
-
http://lmgtfy.com/?q=minecraft+forge+changing+entity+render+distance
-
[1.8] Getting Information About Any Player
Elix_x replied to CoinSlotGaming's topic in Modder Support
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. -
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.
-
[1.8] Help with adding a new variable to every Item and Block
Elix_x replied to HappyKiller1O1's topic in Modder Support
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. -
[1.8] Help with adding a new variable to every Item and Block
Elix_x replied to HappyKiller1O1's topic in Modder Support
No. File must be located in config directory with other configs. So config/MyFile.json . And better would be grabbing modConfigurationDir() from pre init. -
[1.8] Help with adding a new variable to every Item and Block
Elix_x replied to HappyKiller1O1's topic in Modder Support
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. -
[1.8] Help with adding a new variable to every Item and Block
Elix_x replied to HappyKiller1O1's topic in Modder Support
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. -
[1.8] Help with adding a new variable to every Item and Block
Elix_x replied to HappyKiller1O1's topic in Modder Support
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. -
I'm pretty sure you have to implement IUpdatePlayerListBox instead of ITickable . Or is ITickable your interface extending IUpdatePlayerListBox ?
-
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.
-
[1.7.10] SOLVED Get display name of a placed block?
Elix_x replied to Muramasa's topic in Modder Support
StatCollector.translateToLocal -
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.
-
[1.8] Giving an item to the player after a delay
Elix_x replied to JimiIT92's topic in Modder Support
Is that new with 1.8? Neat. Yes. And it was added ~5 moths ago. -
[1.8] Natural vs. Manufactured block detection
Elix_x replied to tool_user's topic in Modder Support
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?). -
Ok. Just checked, it works. Null in 1.8 and 0 stack size in 1.7.10. Thanks!
-
I'll try that. Is it only 1.7.10 bug and i can without problems return null in 1.8?
-
Nope . Crash. Exactly the one that is shown in crash part. Even if i leave only return null; it crashes.
-
[1.8] Giving an item to the player after a delay
Elix_x replied to JimiIT92's topic in Modder Support
Just for info: There's also a method that stops flickering that you could override ( shouldCauseReequipAnimation ) if using countdown way. -
[1.8] Giving an item to the player after a delay
Elix_x replied to JimiIT92's topic in Modder Support
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.