Jump to content

Torojima

Forge Modder
  • Posts

    157
  • Joined

  • Last visited

Everything posted by Torojima

  1. thanks that does the trick. Now I'm registering the models with this in the preInit phase: private void registerModel(Item item) { ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(item.getRegistryName(), "inventory")); } But I still haven't managed to get the model variations running. I'm using ModelBakery.registerItemVariants(...) to register the Model variants (now with the getRegistryName method, instead of the unlocalized stuff) and ModelLoader.setCustomMeshDefinition(...) for registering a custom mesh definition class as described in my earlier post (also changed the unlocalized stuff in the mesh definition to the getRegistryName method). But it is not working yet. If I use it additionally to the setCustomModelResourceLocation method, I'll see the standard model in the game without change. When I only use the registerItemVariants method, I'll only see the pink/black placeholder. (btw, stack damage is set according to my status field in the items onItemUse method) So my current questions are - when do I have to use the above mentioned methods, in preInit or Init? - do I have to use the registerItemVariants instead or additional to the standard registry? and of course ... what am I doing wrong???
  2. Removed the getClass and testing for the item instance itself before the cast. Also removed the getUnlocalizedName and using the getRegistryName instead. This change is working fine. But what I couldn't manage to get working correctly is the ModelLoader#setCustomModelResourceLocation() this is working: Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register( item, 0, new ModelResourceLocation(item.getRegistryName(), "inventory")); but this is not: ModelLoader.setCustomModelResourceLocation( item, 0, new ModelResourceLocation(item.getRegistryName(), "inventory")); can you tell me why not?
  3. thanks Draco for the the variant suggestion, will try this definitely as soon as I've understand the mesh version As for the mesh version, I have added a mesh class like this also I've added models for all variations. Further I've registered the variations in @EventHandler public void init(FMLInitializationEvent event) this way: ModelBakery.registerItemVariants(BuildHelperMod.exchangeWand, new ModelResourceLocation(BuildHelperMod.MODID + ":" + BuildHelperMod.exchangeWand.getUnlocalizedName().substring(5), "inventory"), new ModelResourceLocation(BuildHelperMod.MODID + ":" + BuildHelperMod.exchangeWand.getUnlocalizedName().substring(5) + "_c1", "inventory"), new ModelResourceLocation(BuildHelperMod.MODID + ":" + BuildHelperMod.exchangeWand.getUnlocalizedName().substring(5) + "_c2", "inventory"), new ModelResourceLocation(BuildHelperMod.MODID + ":" + BuildHelperMod.exchangeWand.getUnlocalizedName().substring(5) + "_c3", "inventory") ); ModelLoader.setCustomMeshDefinition(BuildHelperMod.exchangeWand, new ItemExchangeWandMeshDefinition()); I've tried once without any additional model registering and once (a rather desperate attempt ) with the additional: this.registerModel(BuildHelperMod.exchangeWand); ... private void registerModel(Item item) { Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register( item, 0, new ModelResourceLocation(BuildHelperMod.MODID + ":" + item.getUnlocalizedName().substring(5), "inventory")); } The try without gave me the pink/black block showing the models are not installed or rather not connected to my item, the version with the additional registerModel call gave me the single original model without change. A debug break point in the getModelLocation Method of the ItemExchangeWandMeshDefinition class was not reached, so I presume the method is never called. Thus I further presume I have not done the registering the right way The 'status' field of the item is definitely changed, since I'm using this status for my functionality and that is working as expected ...
  4. ok, models So, my item stack will have a status (example: click once for source block type, click second time for target block type, click third time for start block and fourth time for end block. After fourth click in the area marked by the last two clicks, the second clicked block types will be exchanged for the first clicked block type ... after each click the status will change) Anyway, this calls for either the meta data solution (then I have to get the status into the meta data) or the item variants solution, because the status is already an aspect of the ItemStack. For the later solution. I'll be calling ModelBakery and register all models. Also I have to set custom mesh definitions for the different itemStack status... Now I have to confess I don't know what a MeshDefinition is and how to get the stack status represented in the MeshDefinition.
  5. I've found a few snippets and questions regarding the programmatic change of item icons on runtime, but they always only showed a very tiny bit of the action. I know there has to be an override in the json file, but not if the new icon also has to have a json file or not. I've seen a bit of the apply method in the source, but don't know exactly how it works either. So from all the stuff I've stitched together, I can't make it work properly ... Is there a tutorial explaining the whole shebang somewhere? That would be highly appreciated
  6. after about two years on hiatus, I'm trying to get back into minecraft modding Making good progress so far, with the help of this forum and some other resources I've been able to get my mod to do the basic steps ... Now I've run into one problem... How to check for BedRock??? at other occations I've done world.getBlockState(pos).getMaterial() and checked if it is Material.<materialIWant> But it seems that won't work for Bedrock ... any pointers? -------- ok, feeling a bit stupid now setting the stuff aside and doing something else it came to me world.getBlockState(pos).getBlock() == Blocks.BEDROCK; I was just to transfixed on the Material stuff
  7. done exactly that (except run "gradlew setupDevWorkspace" in shell instead of from a bash file I'm on a Mac OS, so Darwin Unix, thus running the gradlew file instead of the gradlew.bat). and after running "gradlew setupDevWorkspace" I received the above error message ...
  8. regardless of which command I'm running I'll receive this error message: can anybody tell me what I'm doing wrong? (tried multiple tutorials found here ...)
  9. I got this error whenever I my mob gets hurt, I have absolutely no idea what's going on can anybody help? As can be seen in the crash report, all involved classes are vanilla classes... Can anybody tell me where to start searching for this bug?
  10. reflection is out of the question, that's against every object oriented convention one can imagine ... coremod is also out of the question, that would render the hole forge philosophy useless ... So, what is needed is either a forge compliant solution to access the field, or a hole workaround also in forge to get player movement key inputs to the mods ... I would like the later better ... has nobody suggested something like this before me?
  11. same here, I'm on Mac OS X when I try to start it in a console I get this: java -jar minecraftforge-installer-1.6.1-8.9.0.755.jar Exception in thread "main" java.lang.NullPointerException at cpw.mods.fml.installer.InstallerPanel.updateFilePath(InstallerPanel.java:198) at cpw.mods.fml.installer.InstallerPanel.<init>(InstallerPanel.java:162) at cpw.mods.fml.installer.SimpleInstaller.main(SimpleInstaller.java:52) ------- btw, is it more wise to start a new thread if I'll find one with a similar question but less information? Will you forge guys read this a second time when there is a new post?
  12. before 1.6.1 I've done the following to use a custom sound: public class ChocoCraftEventClient extends ChocoCraftEventCommon { @ForgeSubscribe public void onSound(SoundLoadEvent event) { try { event.manager.soundPoolSounds.addSound("choco_kweh.ogg", ModChocoCraft.class.getResource(Constants.CHOCOBO_SOUND_FOLDER + "/choco_kweh.ogg")); } catch (Exception e) { System.err.println("Failed to register one or more sounds."); } } } this is not working anymore, I now can only add the sound name with addSound. How do I connect the sound file with the name?
  13. where have you read about the @EventHandler annotation? I can't find anything. I would have guessed, without reading anything specific, to use @ForgeSubscribe?!
  14. So, I've been producing a mount mob and using for its steering the EntityLiving.isJumping field of the player. Now since mc1.6.1 this field is made private and I can not find a respective getter. There is a setter I can use, but I have the slight impression this is also not the correct way to access and use this field (since there is no respective getter) The handleEntityAction method of the NetServerHandler, setting the action states of and Entity, which could be the player riding a mounted mob, will set a respective field in the mount entity ... in case it is a horse ... (thank you mojang for kicking all other mounted mod producers in the balls) So, what would be the correct way to get the jump information from the player on the client to the mounted mob on the server??? (this is actually the last Compile error Eclipse is showing, I hope I can try to run my mod after that ... no doubt, there will be a lot of issues only visible at runtime tho ) Edit: just noticed, that's not true, I've got another issue regarding the usage of a sound resource ... but that's another story
  15. how should we be adventurous if we can't even reach the jungle
  16. same here. Mac OS X, downloaded MCP unziped to folder, copied unziped forge folder into mcp folder like before (then only read the forge readme where it is explained MCP will be downloaded automatically). Haven't run any mcp scripts yet tho. Then chmoded all files to 744 and run install.sh in the forge folder with the following result: ./install.sh Traceback (most recent call last): File "install.py", line 12, in <module> from fml import setup_fml, finish_setup_fml, apply_fml_patches, setup_mcp, reset_logger ImportError: cannot import name setup_fml
  17. I would start by reading tutorials (lots of them) and try out different things explained there. That's why some marvellous guys (and girls ... I just started wondering out of idle curiosity, are there any girls active in the minecraft modding scene? or is it completely in male hands?) have produced some great Tutorials which will explain all your questions... If you try to ignore them by asking for a beginners tutorial here, you're very near of deliberately insulting these good people having put up time, effort and resources for your sake <- wink for the insulting, not the tutorial producers, they are great, even helped me a lot and I have about 25 years of coding in my past ... So what you have to do for a mod that is not just adding blocks with fancy skins to minecraft is (in this sequence!!!) 1) understand coding/software principles 2) understand Java 3) understand minecraft class architecture (ok, here I'm lost every now and then too ) 4) understand forge class architecture if you do it the other way round and hope you'll pick up coding principles and Java knowledge by dabbling about trying to create some fancy stuff in a minecraft mod, you'll bound to get hurt, frustrated and finally probably think software development sucks ... Probably you're still not convinced and think that's all a lot of crap and you'll pick it up on the go. But let me us an analogy. If you're old enough you probably can drive a car, if not, you probably know in theory how to drive a car anyway. Now, would you try to enter the Baja500 or an WRC event and imagine to get to the finish line? Probably not, you would have to invest a hell lot of training first... Same here, tho the training might be a bit more easy to acquire than for mastering a rally car
  18. Does anybody know of a nice explanation/tutorial about written books with mod defined content? I would like to add a book to my mod with the explanation of the usage as content. Right now the only way I'm could imagine is to extend the book GUI and the respective book item to avoid having to put the content into NBT for every instance of the book (not that much of a problem in single player, but if there is a multiplayer world with lots of players and every one would have some of these books, the save would needlessly blown up by exact copies of the same text ...) ... does anybody have a better idea than extending book GUI and book item?
  19. one of my players has some problems with my mods entities. They are not shown in SMP mode. But as he states only in his client. Other clients connected to the server can see the entities. The only irregularity I've found in his client log are the following two lines for multiple entity id's 2013-06-08 12:43:50 [WARNING] [ForgeModLoader] Missing mod entity information for chococraft : 5 2013-06-08 12:43:50 [FINE] [ForgeModLoader] Attempted to adjust the position of entity 55321 which is not present on the client can somebody enlighten me and tell me what the two lines (especially the first one) can tell me?
  20. This is something I'm pondering some time now. Is there an ingame way to delete a chunk completely, so it will be recreated when visited by a player? Or is this something only possible outside of minecraft itself, for example like MCEdit does it?
  21. Thats the exact usecase for @Override... we do agree completely
  22. you are of course correct if you presume you are dealing with somebody actually creating code. But here it is only a copy/paste of method profiles from the parent classes of from tutorials, thus I presume (I know, every presumption is the probability of errors ) the issues are not due to wrong method profiles (thus having wrong arguments), but original methods changing names and the overridden methods being orphaned...
  23. they are stored as null in the Block.blocklist? I haven't checked, but frankly can not believe that ...
  24. and after reflecting a bit more about your statement, actually, it is not quite correct. @Override every method that *is* overridden. If you want it or not is not the question. If you do not want to override a method choose another name ...
  25. @Override only the methods you want to override. If it creates an error not just remove it. Think first. honestly, if they would think first, this issues would solve themselves ... In general, if you choose to use a method name already exists in the current scope, the method will be overridden. The @Override is nothing more but a safety precaution if the original name changes (like now). ... ok, my advice has been ambiguous, here's the corrected version: @Override every method, if the @Override creates an error remove the @Override, not the method itself! This way every method that should be @Override-n will be and non is forgotten... If used like this the user don't need to know what he's doing and still doing it right ... actually, reading my original post again, the advice has not been ambiguous at all I specifically mentioned to remove the @Override if it will create an error ... And as you can see from my post, this is not an advice for the ppl out there able to create nice and well developed code ...
×
×
  • Create New...

Important Information

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