Jump to content

Atijaf

Members
  • Posts

    198
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I complicate easy probs and come begging for help.

Atijaf's Achievements

Creeper Killer

Creeper Killer (4/8)

4

Reputation

  1. When an item is shift clicked from from a chest, it is organized into your inventory. I.e. Shift clicking on 64 oak within a separate inventory will fill oak stacks in your inventory first, before adding new ones. Is there a way to call that method, that transfers the stacks, from the event "PlayerOpenContainerEvent"? Or will I have to write my own code? Thanks!
  2. onItemCraftedByPlayer, within PlayerEvents class. http://pastebin.com/cEp3tBTF The code is fired from my event handler, registered like so, "MinecraftForge.EVENT_BUS.register(new PlayerEvents());" from my CommonProxy The stack size is multiplied by the experience reward per item made. Sorry for the confusion. Thanks for the help.
  3. Are you referring to the event being fired on the client or server? Both sides for me still say 0. I need to multiply the amount made by a specified number.
  4. Hi, the problem I am having is obtaining the ItemStack's stackSize when the player shift clicks the result. The stackSize is always 0. But, when the player clicks and drags the item, it obtains the correct stack size. Any ideas? Thanks!
  5. I'm trying to make it to where you can only craft slabs with the base block (Meta of 0) Or in other words, a sandstone block can be used to make a sandstone slab, but a chiseled, or smooth, sandstone block can't be used to make a sandstone slab. This is how I'm going through my recipes removedCraftingRecipes_OUTPUT removedCraftingRecipes_INPUT The meta data of sandstone that is used to craft the slabs is always 32767. Why is that the case? Thanks!
  6. The only loop hole that I can think of now is if the block is pushed somewhere. i.e. a piston. Are there any piston related events? I can fix if sand is placed and then it falls (I'll just put the lowest location)
  7. I understand that this post is old, but I have completed implementing a block storage that stores the location, and the block's id/meta. I have a List of dimensions, -1 through 14. (-1 is actually 15), and any other dimensions can go up to 14. Inside the list of dimensions, holds a sorted ArrayList of my "ChunkPos" objects. (These objects contain dimension Id, X and Z position. 48 bits... 4 bits dimension, 22 bits X, 22 bits Z) This chunk also holds a HashMap of my "ChunkBlockPos" objects. (These objects contain x -4 bits, y -8 bits, and z-4 bits coords. Along with the block Id -12 bits and meta -4 bits) Each chunk is 48 bits, and each block within is 32 bits. That is also calculated without java's overhead for my classes and whatnot... Unfortunately, I had to include the block's id and meta, in case if the player places a sapling and it grows, the location of the sapling is now wood and that wood was not placed by a player. And now for getting the information. When a player places a block, it goes into the dimension list, it then does a binary search for the chunk, and if not found, creates a new chunk, instantiates the hashmap within, and instantiates a "ChunkBlockPos", inserts that into the hashmap, and adds the hashmap to the dimension list. In other words, if there are 100,000 chunks stored within the dimension list, it can find the correct chunk within 17 searches doing a binary search. Woot! AND NO, I haven't been working on this for a year. I was just looking through my questions and found this one. I figured I'd update it and say thanks to all of y'all! Thanks!
  8. I am adding my own crafting requirements to some tools, including this one. I've made a way to automate a process so that I would not have to re-enter all of the crafting recipes for each and every item. This automation grabs the recipe from the IRecipe like so. //My recipe String. It is later separated every 3 places into 3 separate Strings. //Used to define where and what an item is in the recipe char letters[] = {'a','b','c','d','e','f','g','h','i'}; String recipeData = ""; //Gets list of Items within Object[] locationNumbers = ((ShapedOreRecipe)recipe).getInput(); for(int i = 0; i < locationNumbers.length; i++) { //Null Checks and instanceChecks //Add to the crafting recipe (It would look similar to this , //"abc", "def", "ghi" ... But not in this case. Read notes below...) recipeData += letters[i]; } in the end, the recipeData looks like... "abc" , "d f", "". When it should look like... "ab " , "cd " , " f " And after Everything is finished, it would look like this... "aa " , "ad" , " d " , 'a', new ItemStack(Blocks.Blocks.planks), 'd', new ItemStack(Items.stick); ... Which happens to be the recipe for the axe, more or less. More information: locationNumbers is an array of data (0 through 8, with some being null for blank spots) for the axe, locationNumbers holds datas (0,1,2,3,5) numbers 4,6,7,8 are null. or in other words, my recipe would look like this if I stored numbers from directly above. "012", "3 5", "" AND that's not the axe shape. Another thing to note is that this works on about a hundred other recipes. And for the question if you haven't guessed it. Anyone have any clue as to why locationNumbers have datas (0,1,2,3,5) and not (0,1,3,4,7)? or ("01 " , "34 " , " 7 ") Fore reference I tried to simplify what was being asked, so information in paste bin is slightly different. http://pastebin.com/isxPNT8z
  9. I am adding my own crafting requirements to some tools, including this one. I've made a way to automate a process so that I would not have to re-enter all of the crafting recipes for each and every item. This automation grabs the recipe from the IRecipe like so. //My recipe String. It is later separated every 3 places into 3 separate Strings. //Used to define where and what an item is in the recipe char letters[] = {'a','b','c','d','e','f','g','h','i'}; String recipeData = ""; //Gets list of Items within Object[] locationNumbers = ((ShapedOreRecipe)recipe).getInput(); for(int i = 0; i < locationNumbers.length; i++) { //Null Checks and instanceChecks //Add to the crafting recipe (It would look similar to this , //"abc", "def", "ghi" ... But not in this case. Read notes below...) recipeData += letters[i]; } in the end, the recipeData looks like... "abc" , "d f", "". When it should look like... "ab " , "cd " , " f " And after Everything is finished, it would look like this... "aa " , "ad" , " d " , 'a', new ItemStack(Blocks.Blocks.planks), 'd', new ItemStack(Items.stick); ... Which happens to be the recipe for the axe, more or less. More information: locationNumbers is an array of data (0 through 8, with some being null for blank spots) for the axe, locationNumbers holds datas (0,1,2,3,5) numbers 4,6,7,8 are null. or in other words, my recipe would look like this if I stored numbers from directly above. "012", "3 5", "" AND that's not the axe shape. Another thing to note is that this works on about a hundred other recipes. And for the question if you haven't guessed it. Anyone have any clue as to why locationNumbers have datas (0,1,2,3,5) and not (0,1,3,4,7)? or ("01 " , "34 " , " 7 ") Fore reference I tried to simplify what was being asked, so information in paste bin is slightly different. http://pastebin.com/isxPNT8z
  10. As for my understanding of java. The method #setStrings(String... data) allows for passing multiple string parameters. How would one do that with objects? #setObjects(Object... data) is there a way to return an object holding data? For example String[] StringArray = new String[3]; char[] charArray = new char[2]; ItemStack[] stackArray = new ItemStack[2]; //How can I do this. Is it possible? Object obj = (stackArray, charArray, stackArray); I know this is more of a "java related question", but what I am trying to do is add crafting recipes and I need to pass an object. (It's a little bit more complicated than that, but the main point is here) Thanks!
  11. As for my understanding of java. The method #setStrings(String... data) allows for passing multiple string parameters. How would one do that with objects? #setObjects(Object... data) is there a way to return an object holding data? For example String[] StringArray = new String[3]; char[] charArray = new char[2]; ItemStack[] stackArray = new ItemStack[2]; //How can I do this. Is it possible? Object obj = (stackArray, charArray, stackArray); I know this is more of a "java related question", but what I am trying to do is add crafting recipes and I need to pass an object. (It's a little bit more complicated than that, but the main point is here) Thanks!
  12. Thanks! I'll take a look into that! Another thing is that I don't necessarily need to change the recipe's input and output. The additional requirement is based on the player's level in one of my skills. I also want to clear up what I asked earlier just to be sure I was understood. Can I get the input and output from the recipe? Or am I able to obtain the input and output in any ways?
  13. Thanks! I'll take a look into that! Another thing is that I don't necessarily need to change the recipe's input and output. The additional requirement is based on the player's level in one of my skills. I also want to clear up what I asked earlier just to be sure I was understood. Can I get the input and output from the recipe? Or am I able to obtain the input and output in any ways?
  14. I have followed a tutorial on how to create custom requirements for crafting recipes. What I want to do now, is replace all of the vanilla recipes with my custom ones, but before I do that, is it possible to use the "IRecipe" to obtain the crafting result and what's required in order to re add the recipe back to minecraft. For example: //The idea. Is there any way to replicate this? GameRegistry.addRecipe(vanillaRecipe.outPut, vanillaRecipe.contents); Here is what I've gotten so far. http://pastebin.com/7yBqKVxW Thanks!
  15. I have followed a tutorial on how to create custom requirements for crafting recipes. What I want to do now, is replace all of the vanilla recipes with my custom ones, but before I do that, is it possible to use the "IRecipe" to obtain the crafting result and what's required in order to re add the recipe back to minecraft. For example: //The idea. Is there any way to replicate this? GameRegistry.addRecipe(vanillaRecipe.outPut, vanillaRecipe.contents); Here is what I've gotten so far. http://pastebin.com/7yBqKVxW Thanks!
×
×
  • Create New...

Important Information

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