Jump to content

BigDaveNz

Members
  • Posts

    39
  • Joined

  • Last visited

Converted

  • Gender
    Male
  • URL
    http://bigdavenz.co.nz
  • Location
    New Zealand
  • Personal Text
    Software Engineering student.

BigDaveNz's Achievements

Tree Puncher

Tree Puncher (2/8)

5

Reputation

  1. I was originally self taught Java, now a Software Engineering student nearing degree completion. I originally learnt with The New Boston and Derek Banas, to be honest I learnt how to code, but I wasn't good at it after watching all the tutorials, I struggled through the minecraft source trying to figure things out, as well as trying to learn Java, it was a hard process. I found that trying to understand other peoples code to be the limiting factor. I didn't know anything about the minecraft source, and didn't know where to look for things. Stack overflow is your friend, if you have a problem, google/stack overflow will usually have the answer. TBH the best thing to do is just get experience, start small, and work your way up to what you really want. Trust me, you will write code you think is amazing one day, then 6 months later you will see how horrid it was and change it. The cycle may continue indefinitely. Dont be afraid to try things and experiment. Minecraft Forge IS your Api, the dev environment gradle sets up with setupDecompWorkspace gives you read only access to the minecraft source, fml source, and minecraft forge source. And I do recommend the irc channel #MinecraftForge. Don't go there asking for Java help, but definitely if you want help using MinecraftForge then that's the place to get it. The way to figure out the minecraft code is to look at similar cases to that which you want to do. If you want to create a GUI, look at how the Inventory is opened and use a similar strategy. If you want to create a new block, look at how the vanilla ones are created. Also there are a bunch of open source mods on GitHub, like biomes a plenty etc. go and have a look at what they have done, you might be surprised what you can find out. helpful classes -Timer? = Im sure there is a way to check the current minecraft day. I personally haven't done anything with timers(I think you use IScheduledTickHandler but could be wrong) -Log off? = subscribe to PlayerEvent(in FML) -GUI? = extends GUIScreen -Sky colour? = take a look at the World class(I think) -Touching? = take a look at how Zombies attack Players -Heat Waves? = This is a little bit more complex, although definitely possible, I suggest do everything else first, and coming back to it. TL;DR: -Practice -Use google/StackOverflow -Use #MinecraftForge -Look for opensource minecraft mods
  2. So I stumbled across this post in some random corner of the internet. I want to give whoever coded this a gold star. This is the final form of Minecraft modding. http://codecrap.com/content/400/ Thought I would give you all a laugh for once
  3. The most simple way is: (Note: This is scala code) MinecraftServer.getServer.getConfigurationManager.sendChatMsg(chatComponent)
  4. I doubt theres a complete one yet, I know Wuppy has made alot of headway http://www.wuppy29.com/minecraft/modding-tutorials/forge-modding-1-7/ Keep an eye on that for updates, At this stage I suggest you just do most of it yourself, Or else browse github for opensource 1.7 mod's to see how they have done certain things. If you need a hand with something specific theres always these forums or the #MinecraftForge irc channel
  5. Can you please try to explain that again, In plain english? I can't understand what you are getting at. Forge now uses Gradle to setup dev workspaces etc. There are plenty of tutorials on setting it up in both eclipse and intellij 1.7.2 Forge is out (although It's not finished yet). You are welcome to code for 1.7.2, you just have to work around some obfuscated names.
  6. Seriously? You dont have to do anything with scala... Just open a cmd window and direct it to where you extracted forge Type: gradlew.bat setupDecompWorkspace idea Once complete open the project it creates. Java code goes in src/java Resources go in src/resources And that's about it. I haven't heard of any problems with 1.7.2... If there is I'm sure they can be solved. But If your happy to wait. That's your decision.
  7. One of the easiest way's is to check when a block is broken... or container opened... or player moved... and if it is a certain chunk/coordinate region (depending on which way you want to do it)... If that chunk is in a list of owned chunks and the playuer attempting something in that area is not the owner, you cancel the event and send a message to the player stating that the area is claimed or similar. That's how I do it anyway
  8. You can't store 2 damage values on a weapon. The damage value is 123:1234/ItemID:DamageValue The only way I know of is NBT data. So look up some tutorials on that. Unfortunately it increases the complication by a large amount. But thats what you have to do. As for the rendering, you would have to look into the openGL, create your own custom renderer for the bars , which shouldn't be too hard. Unless you mean add two numbers to the item in the inventory slot. Which is a little bit different. I'm not sure on any of the IC2 specific stuff though.
  9. Sit down with your favourite bottle of whisky... And have a few glasses. while updating, continue this. If you havnt finished the bottle before you finished updating, Your obviously doing something wrong... Start using lang files for everything where possible(if you haven't already). The new chat component system is really simple when you can call everything through the Translate component, and also helps heaps with localizations. I updated to 1.7 a couple of days ago(using the test forge builds) And my small unreleased mod had approx 4000 errors to fix... and about 8 hours work and just over 1000 lines of code changed (Although I changed some things/added new content as well). Almost everything has been modified/tweaked in some way. from chat messages to packets to items/blocks. Most things are small or easy to figure out. For instance Icon is now IIcon... A quick find/replace and you solve 100 or so errors. Some things require a bit more effort. Like chat messages. And some things, such as rendering, I have disabled until the deobfuscation of names is finished, because it is soo hard to guess which boolean out of the 20 is "renderVignette". It's not impossible (and MCP bot does help), but the amount of effort required for each thing seems ridiculous , compared to working on another part of my mod, and waiting for deobfuscation. I feel for the naming team. All in all the update seems to fix a lot of issues... But I'm guessing it will make hundreds more haha.
  10. All chat strings have been moved to IChatComponents. there is still an addChatMessage()... Although it requires a component as the input, rather then a string. I'm currently on holiday at the moment, but I will be back on friday evening. So if you still haven't figured it out by then, I'll test in a 1.7 environment. And see if I can fix it for you.
  11. Pattern Matching, Lambda's and many other features far exceed that of java. Pattern Matching is effectively a Switch/Case statement on steroids... In Java 8 the Switch statement has been improved to allow things like switch with Objects such as strings, rather then just primitives. But it's not as good as scala. Lambda's also are in Java 8, but the problem is, you cant expect everyone to update to a "beta" version of java to use your mod. That leads me to my next point. Everything is done using JVM, there is no language levels etc. Which means you can use all the fancy stuff like pattern matching/lambda's, while still using Java 7, which most users have installed on their PC. Test have show That scala is only 3x slower then C.... Now this is probably not a perfect statistic. But to me that is fairly decent for the type of language it is. It's basically on par with Java, Runtime wise, with writing less code. to look at this more in depth go here http://benchmarksgame.alioth.debian.org/ Its a diverse language, while Java is Object orientated, scala is both Object and Function based. However this is only a good thing if you use it appropriately, Attempt to think in the Scala train of thought, rather then Java, there are heaps of youtube videos on this. Objects/Class separations fixes alot of the confusions people have with the static modifier in java, in my mind it is easier to understand. Although languages such as groovy follow closer too Java syntax, Scala isn't that hard to grasp, It's not like learning an entirely new language. It's clear and simple to understand. Personally for me (as I am currently moving from java to scala). It's like when i moved from Eclipse Kepler to IntelliJ IDEA. I doubt I will ever look back. I do think it will take a month or two for me to fully start to understand scala, but when I do I feel that it's a direction I would like to head. It seems that Scala is improving at a faster rate then java, and you aren't restricted by versions. For instance: We wont be able to use Java 8 functionally for a long time, because the userbase has to update their Java install, whereas as soon as scala updates, you can instantly use the new features in your code, the compiler sorts out the rest. I just recently updated my mod to 1.7 (Thats coded in Java), however I decided to start the conversion to scala (although I'm think an interior mod rework is on the cards at the same time as I convert haha, especially while I wait for deobfuscation/an "Official" 1.7.4 forge version to be released) If you want more information watch this speech (this is the source of most of my information)
  12. ChatMessageComponent is 1.6.4, It no longer Exists, theres now 3 components. Translation, Style, and Text. They all are used together to output a result. Since most functions are Obfuscated, styling is the hard bit at the moment.
  13. First you need to create a class to put all your @SubscribeEvent (1.7) annotations in. Then you subscribe to the appropriate event. Then you initialise your event handler https://github.com/BigDaveNz/EnchantInsanity/blob/master/common/nz/co/bigdavenz/ei/core/handler/EIEventHandler.java That's my event handler. the Key line that you need to know is line 13 My class that processes the events is here: https://github.com/BigDaveNz/EnchantInsanity/blob/master/common/nz/co/bigdavenz/ei/event/EIEvent.java (note this is 1.6.4) As you can see that is the class that is referenced in line 13 of EIEventHandler.java for 1.7 FML now has annotated events. @SubscribeEvent public static void onPlayerLogin(PlayerEvent.PlayerLoggedInEvent event) { //Do stuff }
  14. I'm just updating now. I haven't got a working version yet, simply because of the amount of changes I have to make before I can even run MC. 1.7.2 broke a lot haha. But anyway, You need to Hook into PlayerLoggedInEvent which is in PlayerEvent. Also with chat messages now this is the code for basic, non styled/non translated text. https://gist.github.com/BigDaveNz/8230352 Chatting to a player, command sender and Broadcasting a message to all players is here. (be aware this is untested but "should" work). The EIChatComponent is merely "[EI] " which gets added to all of my chat messages, and is usually styled although I haven't figured out colours/bold etc. for 1.7.2 yet.
×
×
  • Create New...

Important Information

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