Jump to content

Belpois

Members
  • Posts

    128
  • Joined

  • Last visited

Everything posted by Belpois

  1. You cannot have both SDK's working together, you have to compile them separately, If you where working on one version that the same API was available on the previous version with zero changes than compiling shouldn't be a problem.
  2. No just the source files of the API, notice that most Java API's you find are either a compiled JAR file or just source files that you can copy and reference to. Java does not have project files.
  3. Try re-installing your Java JDK and JRE, it seems like your Current OpenAL driver is either incompatible or something else on your PC is causing a conflict. Don't know about you, but I'd consider upgrading to Windows 7 or 8.1, Windows XP support is long gone Googling a bit Further it seems like that the Driver is Proprietary of CreativeTechnologies, so if you have a Creative Sound card look for updated drivers or re-install your current drivers.
  4. To make this easier for you when coding, and re usable. Put the function in a Utils class this way you don't have to write down the calculation all the time. Functions: // The offset is an integer that is applied after the center calculation to offset in any direction. // The return will be the center position of the object relative to the screen size. // I also suggest making these static so they can be accessed without initialization. int verticalCenterPosition(int elementWidth, int offset); int horizontalCenterPosition(int elementHeight, int offset);
  5. Take a backup of you src folder (The code you are working on), and type in: gradlew clean gradlew setupDecompWorkspace gradlew idea This will clean development env and reset it, backup everything before. Files might be deleted.
  6. The online version doesn't work very well, or we are just dumb and cant use it Try locating all the downloaded binaries for techne and removing them, re install it afterwards.
  7. You mean Techne the app http://techne.zeux.me/? Any crash logs or something of that sort?
  8. Well, it kind of is... But at the end of the day there is no existing event that notifies you on a slot or inventory changes. Currently looking at the inventory code, I cannot see an easier way to do this. Unless you hack the inventory code and add you own event in there.
  9. Subscribe on a tick handler, scan the inventory, if it changes send an event that the players inventory changed.
  10. Implement a WorldGenerator http://www.wuppy29.com/minecraft/modding-tutorials/wuppys-minecraft-forge-modding-tutorials-for-1-7-updating-1-6-to-1-7-part-3-world-generation/#sthash.6w61qcBa.dpbs This will allow you to generate custom ores/structures/tree in the world.
  11. What do you mean by option button? Just a normal button?
  12. codechicken/multipart/TileMultipart That seems to be the fault, try to remove CodeChicken. Could it be damaged? Try redownloading it.
  13. Question #1: Generally if you follow Minecraft Standards, Client Code is run on client side and Server Code is run on Server side while using packets to transfer everything... They yes it should work, with minimal changes. Question #2: Client: Calculations and decisions that are needed for Rendering. Server: All Logic, from moving the player to calculating 1 + 1. Question #3: Yes it matters a lot actually. The client will call the methods in Client Proxy and will only execute code in the CommonProxy if you call super on that method or you don't override a method in the ClientProxy. Smart!
  14. The -username only starts the game with your Username, the UUID will never change when people use the mod as Mojang gives it to you. Setting your username will give a constant UUID, albeit still different then the one on the Mojang servers unless you supply the password in your Build Params.
  15. -username [username] -password [Password] in the build configs "Program Arguments" Some friendly advise, if your using some form of source control and publishing it online, make sure not to publish your project data... You know password and all Note: -password is optional, the UUID will not change but will not be the same one Mojang Servers give you.
  16. Problem #1) Which block you are looking at, try this: MovingObjectPosition mop = Minecraft.getMinecraft().objectMouseOver() or you could try rayTracing, but i'ts proven to be a bit inaccurate over long distances. http://jabelarminecraft.blogspot.com/p/minecraft-forge-172-finding-block.html Problem #2) Get the players looking vector, you could look at the code for the enchanting table, the book does something similar.
  17. Since it's my own data I will be look for, in a CompoundTag with a known key then it's not a problem in guessing what the DataType would be, It's like s standard I guess in my code. Yes I actually thought about that approach, I was going to create an NBTTagList with each Tag Containing an other List or Custom NBTTag of two items, Index[0]:Key and Index[1]:Value, All I do then iterate the known structure and the keys will become available while iterating. I might try that one when I have a chance, and maybe even load test them see how they behave. I hear you, I don't like reflection either. The only time I use it is for unit testing something that I don't have access to. This could work too, might be a bit more expensive (I think) to parse the strings into hash-maps, the data will become larger and larger... Will put a limit on it though. Thank you for the insight!
  18. I believe that a "Bone" item is simply an instance of Item which is given the parameters to make it look like a bone, so there isn't any logic for bone, rather logic that uses the bone item. itemRegistry.addObject(352, "bone", (new Item()).setUnlocalizedName("bone").setFull3D().setCreativeTab(CreativeTabs.tabMisc).setTextureName("bone"));
  19. Hey, I was working on the deconstruction of a structure into NBT format, which I had mentioned before. http://www.minecraftforge.net/forum/index.php/topic,27717.0.html But I ran into a snag... I couldn't find a way to read the NBT's keys beforehand to actually iterate through my data structure. So I started to scratch my head, and came up with and idea to actually read the underlying "tagMap" keys, the obstacle was the field was private so I used my Reflection Skilz! And made this: public final class NBTUtils { private static final String TAG_MAP_KEY = "tagMap"; /** * Using reflection we fetch the NBTTagCompound Keys * * @param nbtTagCompound The tag compound we need keys from. * @return The keys as a string array. */ public static String[] getTagCompoundKeys(NBTTagCompound nbtTagCompound) { // Get the class of the NBTTagCompound type. Class<NBTTagCompound> nbtTagCompoundClass = (Class<NBTTagCompound>) nbtTagCompound.getClass(); // A string array to hold the keys in. String[] keysArray = null; try { // Got the "tagMap" field. Field tagMapField = nbtTagCompoundClass.getDeclaredField(TAG_MAP_KEY); // Checking if the field is accessible. if (!tagMapField.isAccessible()) { // If not let's be naughty and make it accessable tagMapField.setAccessible(true); } // Getting the actual data from the tagMap field. Map tagMap = (Map) tagMapField.get(nbtTagCompound); // Getting the key set. Set keys = tagMap.keySet(); // Setting the keysArray array the same size as the keys. keysArray = new String[keys.size()]; // Converting it to an array. keys.toArray(keysArray); } catch (NoSuchFieldException e) { LogHelper.error("Could not find field '" + TAG_MAP_KEY + "'"); } catch (IllegalAccessException e) { LogHelper.error("Could not access '" + TAG_MAP_KEY + "'"); } return keysArray; } } So question, did I waste like 10 minutes of my life writing this or does it deserve as spot in the tutorials section? Be honest people! I can take a hit!
  20. Thanks, was actually leaning towards that approach but wasn't sure.
  21. And just so you know what exactly is a WeakReference, here is the Java Documentation for it: http://docs.oracle.com/javase/7/docs/api/java/lang/ref/WeakReference.html and an article about it https://weblogs.java.net/blog/2006/05/04/understanding-weak-references TL;DR: Garbage Collector Friendly Object
  22. Hey, hope everyone is well! Anyway, I have the following data structure /** * This structure represents a category of TileEntity locations which are used to store metadata about certain TileEntities in * the world. * </p> * A key can contain an array of TileEntity locations and a Location Set (X, Y, Z) can contain an array of metadata * * @param key The key that defines a category * @param x The TileEntity X Coordinate * @param y The TileEntity Y Coordinate * @param z The TileEntity Z Coordinate * @param metas The generic metadata that belongs to the coordinates (x, y, z). */ (String) key => [{ (int) x => 0, (int) y => 0, (int) z => 0, (bool[]) metas => { 0: "Hello World!", 1: 42.0F, 2: false, 3: int[] {1, 2, 3, 4, 5, 6} } }] This data will be written to a TileEntity NBT on one Block and is synced with the client to allow changes in users rendering (I called it "BlockController"). Now I am at the point of saving this data but I am unsure in which direction to go, here are some options: Serialize the data to a byteArray and save the bytes to NBT, deserialize on the client side for reading Read all the entries and save them in NBT Compound tags by traversing all the arrays of data and constructing the NBT equivalent using NBTCompountTags, the client side will get an update with the NBT packet and deconstructs it into the original structure. The client will never alter this data directly, and the transfer of this data will only happen Once when a player logs on. What do ya'll think?
  23. You could just set the armor in the Constructor, instead of the random method. (Might work might not, might be a better way. Correct me if I;m wrong.)
×
×
  • Create New...

Important Information

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