-
Posts
2638 -
Joined
-
Last visited
-
Days Won
4
Everything posted by Ernio
-
"I am using code..." *Proceeds to not show the code.* *Yes, we are wizards!*
-
[SOLVED] [1.10.2] Player has stopped breaking block
Ernio replied to Vizuall's topic in Modder Support
http://www.atomicstryker.net/multimine.php SPOILER ALERT - it's updated (as always, atomic almighty coder). P.S: This would either require core-mod (which multimine still is, I think (it was)) or some network/system/client hax (highly hacky to my imagination). -
Note: I couldn't really place this thread in any sub-forum since it is not really off-topic, nor mc-general, and most certainly not support - "Suggestions" comes as close as it gets. I know I am not the only one "addicted" to at least Modding Support forum so maybe someone else would also find this handy (because if not, it would be kinda too far to make this feature for one person). I am just gonna describe it from experience: When I come back home (or rather forums) after long day or even few days there is just so much ongoing threads with "NEW" content that opening them all simply takes loads of time (I usually skim whole 1st page or more and open all threads in new tabs and only then proceed to reading/responding/helping). This pretty much allows one to be up-to-date (learn) with anything new and then possibly help others (so there is the reason of "addiction"). Anyway - after considering (since I can't remember when) if it's not too lazy of me to request this, here it goes: *dank memes* P.S: To not over-kill - it can open all "new" on currently viewed page in sub-forum and can be located next to mark read. Note: It is quite easy to make Thank you for consideration.
-
harvestBlock(...) - ALLOWS null player because harvesting can occur without player (e.g explosion). canHarvestBlock(...) - DOESN'T allow, because it is player-specific check. Why the hell would you even use this check if player is NOT harvesting given block? Just don't use it. If you really need some safety check - do it yourself, write helper method similar to canHarvestBlock. What is so difficult? And no - you don't fire the event, I just mentioned it as a docs reference.
-
[1.10.2] The Elytra - More Information On It?
Ernio replied to HalestormXV's topic in Modder Support
Elytra physics are hardcoded into entity. Look there. If "instanceof" is used - you could extend ElytraItem with custom ones, but if item singleton check is used - nothing much you can do. Other solution is subscribing to LivingUpdateEvent of PlayerTickEvent and simulating Elytra physics on your own, totally surpassing vanilla hardcode. -
[1.10.2] What is the max updateFrequency that can be handled?
Ernio replied to gurujive's topic in Modder Support
Umm, if you are referring to updateFrequency that decides when to send positioning packets about given entity type then there is not any higher you can go than 1. Also - where did you pulled "game will crash" from? It won't... Lookup vanilla values for reference. -
[1.10.2] Detecting whether a block was generated during world gen.
Ernio replied to Osuology's topic in Modder Support
What I can give you is a outline: 1. @Subscribe to ChunkDataEvent.Load 2. Check if event.getData()#hasKey("generated") - if not - this means that such tag was never assigned thus - chunk has been generated just now. In that case - assign such tag. The tag under key "generated" will be 3D ByteArray that will be saving mentioned x/y/z booleans. A little bit about compression: * Casuals would go ahead and make ByteArray with 16x16x256 = 65536 lenght, meaning it will be that many bytes. * Wannabe-cool people would apply 8 times better compression and make each byte (8 bits) hold data for 8 blocks, making it only 8192 in lenghs. Similar approach can be done with 256x64(longs) array. Anyway - this is better, but requires bitwise operations knowledge. So what next: If tag was not found assign it - you can do it however you want (as described above) and use some of NBT's methos such as setByteArray or setTagList (list of longs). 3. Now every chunk in world has array of booleans - I am not sure if chunk data can be read outside above event (probably not), so: After all that above, no matter if the tag was there or chunk was just generated - you need to deserialize tag to some boolean[][][] x/y/z array. The array can be placed in some static x/y chunk map, so kinda like Chunk[][] of boolean[][][]. (#javaArraysComprehension). 4. This data you can access and change from several events such as said BlockBreak. 5. @Subscribe to ChunkDataEvent.Save and dump data from mentioned "Chunk[][] of boolean[][][]" into event.getData(). Big note: As holding all loaded-from-startup chunks would be retarded you need to design some cleaning system that will remove no longer used chunk's booleans. While that is easy (nullify data on ChunkDataEvent.Save), you also need to take care of your arrays design - this can't be just "Chunk[][] of boolean[][][]" because it would kill RAM (5D array?), think of Objectifying it to some data structures and Lists/Maps. -
Well, he never directly asked for code, but "tips". So here you go: I'd recommend doing whole mod client-sided. Use ClientTickEvent to check Minecraft#thePlayer position and somehow decide that he is on edge of block. How to check edge? Block go from e.g 0.0-1.0, so logically - check if you are very close to full numbers and if the edge of block you are standing on is next to air block in given direction. Additionally check if you are not in air (jump) and stuff such as knock backs or running or being suffocating. Basically - all kinds of stuff to make it work "nice". Then when you finally pass all those checks you can simulate sneaking by sending packets to server saying you are sneaking (so basically simulate clicking sneak key) - on how to do that look at how vanilla inputs such stuff. Detailed help will not be provided because you are too outdated. Update.
-
[1.10.2] Detecting whether a block was generated during world gen.
Ernio replied to Osuology's topic in Modder Support
There are few ways to do it, you basically need to save a boolean for every x/y/z position in world. To do that you will need combination of ChunkLoadEvent and BlockBreak event and other stuff. Data can be saved directly to chunk (preferred) or inside World (WorldSavedData). -
1. Did you register event? 2. I don't think MouseEvent is cancelable (read docs). 3. MouseEvent (like any other input events) are client-sided. First of all they shouldn't be placed in common classes like Item. Second - you will need packets to do anything there (send packet to server from client when you want to do stuff).
-
So I am making that JavaFX rewrite to MC which basically does whole gui and layout for you. Aside from basically everything - there is one big difference between JFX and MC: JFX recalculates layout when needed - and that is (aside from forced property changes) also when window is resized (so it changes while you are resizing) MC apparently freezes whole damn client whenever window is grabbed (which includes holding, moving, resizing). Now - as far as auto-layouting goes - it becomes kinda pointless to re-layout elements when they will be just freezed (not rendered) until you stop holding MC window. So now my choices are: 1. Layout only on initGui() (so basically after you stop holding window) - which is VERY reasonable. 2. Try to not-freeze whole client (server still works in background, so I don't see why we would need to freeze whole damn client). I will try to do 2nd (and if too hard, back to 1st), so question: * Where is the code responsible for it, because hell, can't find shit. * Is it whole client thread being freezed or just rendering (GL halt)? P.S: When you think about it, it would probably have to become coremod...
-
Unable to find a javac compiler; com.sun.tools.javac.Main is not on the classpath. Perhaps JAVA_HOME does not point to the JDK. It is currently set to "C:\Program Files\Java\jre1.8.0_101" Learn the difference between JRE and JDK. EDIT: Dammit Draco!
-
1. Version? 2. Sided mod (present on server) or client-only? 3. Should friend list be ever saved (quit/join world/server)? 4. The logic you described: if(Player is hit) Friends.clear(); Friends.add(Player's Display Name); ...will end up with List being of size == 0 or 1. Is this desired outcome? If yes - don't use List. Make direct reference to EntityPlayer (or null).
-
Custom Entity with IExtendedEntityProperties and an Inventory Question
Ernio replied to KnightDemon's topic in Modder Support
1. 1.8.9 is the last version featuring IEEP. Update to new Capabilities: http://mcforge.readthedocs.io/en/latest/datastorage/capabilities/ Some examples: https://github.com/MinecraftForge/MinecraftForge/tree/1.9/src/test/java/net/minecraftforge/test And google open source mods 2. As of introduction of Capabilities (read 1st link)- it is HIGHLY recommended to dump all usage of vanilla interfaces and use IItemHandler (or other forge tools). Said that - if you want to do it professionally (like good modder would) - you want to expose implementation of your inventory via said capability system. So yeah - separate class exposed by capability assigned to Entity. This way you use full power of Forge inter-mod compatibility/design. -
No, but seriously - this has triggered deep research as to what "Never fail to disappoint." actually means... While I know the phrase, I probably just never used it and to this point never really knew for sure. Apparently many people think it means "He always delivers." while logically approaching it means "He always disappoints." Said that - you gave me thank you so my guess you thought it was the 1st. http://i1.ytimg.com/vi/GD6qtc2_AQA/hqdefault.jpg[/img] #topicGoneOfftopic
-
http://www.reactiongifs.com/wp-content/gallery/popcorn-gifs/tumblr_ljh0puClWT1qfkt17.gif[/img] Ey, this is Ernio's job http://www.reactiongifs.com/wp-content/gallery/popcorn-gifs/tumblr_ljh0puClWT1qfkt17.gif[/img]
-
Custom Entity with IExtendedEntityProperties and an Inventory Question
Ernio replied to KnightDemon's topic in Modder Support
A bit of design walk through: We have few things to cover: Entity IEEP or Capability IInventory or IItemHandler Before you can even start: 1. What version are you on? * 1.7.10 will not get any further support. * 1.8.x should be immidiately updated to 1.9+, preferably 1.10+. 2. Will the inventory in question be ONLY EVER assigned to one type of entity, or maybe it can also be assigned to other entities (like zombies or whatever)? -
[SOLVED][1.10] Tileentity calling writetonbt() only on server side
Ernio replied to Xerus's topic in Modder Support
Modify thread (main/1st) post and change title with "[sOLVED]" (changing non-main post will not rename whole thread). While I personally appreciate doing above - most ppl don't really care, thus it kinda kills the idea of doing it (I wish WM would add some features like that). -
Nope... Didn't work. Because it was correct. Read Guava docs. I already gave you solution in my 1st post. DO YOUR STATEMENTS LIKE I SHOWED AND DON'T USE "return"... (Joiner is never reached)
-
Go learn java. I highly recommend skimming through WHOLE official java tutorials. https://docs.oracle.com/javase/tutorial/java/nutsandbolts/for.html What are you asking is enhanced for loop.
-
if (status == true) do stuff; if (status == false) do otherStuff; *triggered* if (status) do stuff; else do otherStuff; ^ Hint: 2nd is better? As to "args problem" - build your string with StringBuilder or just with: String res = ""; for (String s : strings) res += s + " ";
-
I'd just like to add: * For players use PlayerTickEvent (tick events have phases meaning pick START or END). * Redesign your stuff: - You don't need prev/next (or last/current whatever you call it) variables. - Make setter method that will (if called on server) send packet whenever "valueToSet != current". - I'd also split "mana" and "maxMana" into separate packets (and apply tip above). - You seem to not store EntityPlayer inside Capability (assuming that since you are passing EntityPlayer to #updateClient method) - you could redesign it without passing such args.