Electrobob99
Members-
Posts
173 -
Joined
-
Last visited
-
Days Won
1
Everything posted by Electrobob99
-
Like The subject states, I have hit a bit of a snag with obfuscating reversal. You see I am getting this message when hovering over this code From what the compiler suggests I should add a cast to boolean, but I am not quite sure if that's correct or not. I also have this problem that within a setBlockBounds method that is later in code, which says this part undefined, don't know if it's a problem or not: Help would be appreciated, thank you
-
Ok, so I have made good progress in getting the bugs worked out with this. In that it now crafts all it can, and give back proper results, and remainders... Still have one problem, it seems to be something to do with the findMatching method. In the sense that it has problems with recipes with multiple ingredients, doesn't seem to correctly check if the other ingredients are present to craft. May just be a simple solution Here is the findMatching method, followed by the fully updated code: I also wouldn't mind making some of the recipes only work with certain items aswell.
-
Ok, a bit of a bug report on this. For one it will only craft one instance of recipe, and then after that it will just delete the ingredients with each attempt, until the current save is reloaded. Another issue is that if a recipe contains similar ingredients to another it seems to spawn the other result.. I.e 1 stack of diamonds become diamond axes. So basically it doesn't craft as many as it can, so that if you drop 90 diamonds, you expect 10 diamond blocks, but instead you get either diamond axes or absolutely nothing. It just doesn't seem to check if other ingredients also match, and such... I have an idea what could be causing it, but not sure.
-
From what I can see the craftInWorld method needs to send the list of itemstacks it receives from the item used to the craft method, etc. Currently it works for a short time, but crashes when no items are around the item's right click. The following is what I currently have in the manager, where I used print statements for debugging: Can someone tell me what I may be missing?
-
Ok, found out a possible reason why it's not working... It seems that the method: craftInWorld is empty inside of the manager class. Guess I will just have to think and put the proper info inside that method to get the full file to do it's job
-
Ok this makes sense now... But one question remains. Do I have to have the crafting manager initialized somewhere? I ask this because no matter what I adjust it doesn't seem to do anything with rightclick, doesn't even get to System.out.println("no items found"); when no items are in the list.
-
I really don't understand what you are saying to be honest. From what I understand, I should write it in pseudo-code on good old paper and then code it. I've done that. But I don't know how to code it... I know my handler needs to be able to take in the entity items that are around the item's rightclicked area, take those items and compare them with needed items within stock recipes, then if they match check if all needed items for one creation are there, and if they are create said items.... And that's basically what I had written down for weeks.... But question is how do I code it? I don't understand Pseudo-code at all
-
Ok, so I honestly haven't been making any leeway on even starting a custom manager for this concept Can someone point me in the proper direction, aside from just copying and pasting the CraftingManager class and editing it?
-
Ok, I have tested and it doesn't seem to crash with any other entity, unless I'm missing one. And hasn't crashed yet.... Currently trying to build and implement the recipe manager for this type of function, hopefully with the possibilities for extra "ingredients" to search for.
-
Ok, so it does work Now few questions now. 1)How do I code a recipemanager for this? 2)How would I code it for multiple "ingredients"?
-
From what I can see, you got what I meant with my question. If this does want I need, I may try to get a recipe class made for this, which to be honest, I haven't done that before
-
Thanks to you both, I have made good progress, except when I put a stack of the item it searches for down it only drops the number of set item when there is only one.... Also I would like to make it do different things when it detect different numbers. For instance when atleast 5 redstone, 2 glowstone, and 1 stick are detected it will only remove those set numbers of items from the area, and spawn the correct itemstack. Here is my current onItemUse method:
-
To be specific, I can't seem to get my item to check above of the block it is used on for 4 redstone item, 2 glowstone dusts, and 1 stick. Aswell as remove only those "amount" items from the world and spawn a certain item in their place.
-
Ok, so I have tried to use the getEntitiesWithinAABB within the onItemUse method, and I can't seem to get it to work
-
So, how would I utilize getEntitesWithinAABB within the onItemUse method for what I want it to do?
-
Ok, now that I have got this settled for now. I have a new question, is it possible to make an item that can look for item/s that are on top of a block it right clicks on, make those item/s instantly despawn, and replace the detected item/s with another item/s? For example, if I drop 3 redstone, and 1 stick on any block and right click it with my item it will "consume" the items on that block and create the item I set it to. I'd assume this is possible, but not completely sure.
-
Ok first question I have today is this. Basically I have a Block with subblocks, you know, with metadata. And everything seems fine, except for some reason the unlocalized name of them don't seem to be registering, the textures seem to work fine aswell. I also find that the localized name is always tile.[Nameofblockgroup].name. I am using an enum file containing block names and certain variables to simplify for future plans btw. Now, my second question may be a bit of a long shot of a question.... Is it at all possible to create subblocks of crops, each with their own texture, drops, max growth, etc. Based on what I have done, it seems possible to do, but I am unsure.
-
java coding problem, changable variable doesn't save?
Electrobob99 replied to Electrobob99's topic in Modder Support
Ok.... That simplifies it greatly, why'd I have to forget that. Well, better than the long code I had before, though I did have to make it check if it was equal, instead of greater. Think it was because I had some code I didn't need. -
java coding problem, changable variable doesn't save?
Electrobob99 replied to Electrobob99's topic in Modder Support
Ok, now I have changed it to check if mode > MAX, and now it doesn't seem to set mode = 0. -
java coding problem, changable variable doesn't save?
Electrobob99 replied to Electrobob99's topic in Modder Support
Ok, thank you, now it works, but now I have a small issue, when it reaches the MAX variable it's supposed to reset mode to zero, which it does, but it seems to make it skip the mode I have set for the MAX. Full code needed: -
java coding problem, changable variable doesn't save?
Electrobob99 replied to Electrobob99's topic in Modder Support
Ok, I'm confused... How is it done, Like how do I initialize it with a new compound, like do I do this Either way it makes little sense -
java coding problem, changable variable doesn't save?
Electrobob99 replied to Electrobob99's topic in Modder Support
Umm.... Ok, but how do I use that? Currently I have "NBTTagCompound mode = itemstack.stackTagCompound;" is that the right idea, or am I wrong? -
java coding problem, changable variable doesn't save?
Electrobob99 replied to Electrobob99's topic in Modder Support
Ok, so how would I go about doing that exactly? This is for an item that can change modes to be specific. -
Ok, so this may be a dumb question, but I can't seem to get a variable I need to change and save it. Basically I want a variable to go up by one with each shiftclick until it reaches a max value, after which it goes back to the base value of zero. I've initialized the variable as "int mode = 0;" and within an if statement I am probably missing something simple...
-
[1.7.10] SubBlock question with ENUM file
Electrobob99 replied to Electrobob99's topic in Modder Support
Ok, so figured out my dumb mistake, seems I Imported the wrong item class from minecraft *facepalm But now I have another problem, aswell as a question. The problem I am having, is that while the correct number of them are created i.e 9 of them, they all have the same basic name of: tile.PlanterBlocks.9.name. Any idea on this, will look into get unlocalized name methods, probably the issue to be honest, since from the looks of it, I had it set to "return getUnlocalizedName() + "." + EnumCropType.values(). Which would explain why it was giving the total in the name. Also how would I be able to decide what icon/texture it needs easily? Just the getUnlocalizedName is needed to be resolved Strike that, so simple to fix, all I had to do was make the getUnlocalizedName method return "getUnlocalizedName() + "." + ENUMFILENAME.values()..name" "i" being "itemstack.getItemDamage()" and "name" being set in the ENUM file Yay I am learning