Everything posted by Choonster
-
java.lang.IndexOutOfBoundsException
From the EAQ:
-
[1.9] How to create & register a sound using the new registry system? [Solved]
I would highly recommend using an actual IDE with a graphical debugger like IDEA or Eclipse, it will make debugging your code a lot easier. The log4j configuration is stored in the log4j2.xml file in the forgeSrc JAR. You can copy this file into src/main/resources and add this tag in the <Loggers> tag, between <Logger level="info" name="net.minecraft" additivity="false">...</Logger> and <Root level="all">...</Root> : <Logger level="all" name="net.minecraft" additivity="false"> <AppenderRef ref="FmlSysOut" level="INFO"/> <AppenderRef ref="ServerGuiConsole" level="INFO"/> <AppenderRef ref="FmlFile"/> </Logger> You can read more about configuring Log4j 2 here. This will override Forge's configuration completely. Ideally you'd exclude this file from your built mod, but I haven't worked out how to have Gradle do that yet. Now that I look at your latest.log, I can see there's a JsonSyntaxException being thrown from SoundHandler because your sounds.json was malformed.
-
Is addRandomArmor() or dropRareDrop() present in Forge 1.8.9?
MCPBot tells me that EntityLivingBase#addRandomArmor ( func_82164_bB ) was renamed to EntityLivingBase#addRandomDrop on 2015-02-02 (in 1.. It still has this name in 1.8.9, but the method was removed in 1.9.
-
[1.9] [Fixed] RightClickBlock occurs 4 times
The event is fired once per hand per side.
-
[1.9] How to create & register a sound using the new registry system? [Solved]
It looks like SoundManager isn't writing to the FML log due to the log4j configuration, so the DEBUG level messages that are logged when sounds are played are discarded. Set a breakpoint in SoundManager#playSound and step through it when you play the sound. Does it play the sound or skip it?
-
[1.7.10] Make Itemstack Indestructable
You actually need to copy the motion and pickup delay from the old Entity when you spawn the invulnerable one. You can see my implementation here.
-
[1.9] How to create & register a sound using the new registry system? [Solved]
The default resource directory is src/main/resources. Have you configured this to be src/resources? Aside from that, your code looks correct. Was there anything in the FML log that wasn't in the console (i.e. anything logged below the INFO level)?
-
[1.9] BakedQuad help
RenderItem#renderQuads uses the quad's tint index to get the colour from ItemColors (i.e. the IItemColor registered for the Item ). If anaglyph mode is enabled, TextureUtil.anaglyphColor is used to translate the colour into an anaglyph colour. I don't know enough about the rendering system to say what happens when a colour is applied to a quad without a texture.
-
Minecraft Forge 1.8 Throwable Entity Not Rendering
There don't seem to be any errors in the log, I'm not too sure what's going wrong.
-
[1.9] BakedQuad help
The tint index is passed to IBlockColor / IItemColor so they know which part of the model is being coloured and can return the appropriate colour based on that. I believe the TextureAtlasSprite is a location on the block texture sheet to render on the quad (i.e. the quad's texture).
-
[1.7.10] Make Itemstack Indestructable
Create a class that extends EntityItem and overrides isEntityInvulnerable to return true . This makes the item entity immune to all damage. In your Item class, override the following methods: Item#hasCustomEntity to return true Item#createEntity to create an instance of your EntityItem class with the specified location and ItemStack Item#getEntityLifespan to return Integer.MAX_VALUE This will spawn an invulnerable EntityItem with a lifespan of 2^31-1 ticks or approximately 3.4 years. If you want an item that actually never expires, you'll need to override EntityItem#onUpdate to do exactly the same thing as the existing method and its super method but not check the age/lifespan.
-
Having a problem when trying to register my command.
Have you definitely got the built JAR in the server's mods folder? If you open the built JAR in an archive viewer (e.g. 7-Zip) or Java decompiler (e.g. Bytecode Viewer), are all of your compiled classes present? Does the FML log (logs/fml-server-latest.log) mention your mod? If you're not sure, upload it to Gist and link it here. In future, please use Gist or Pastebin to post logs/crash reports (if applicable) and code with syntax highlighting rather than posting screenshots. To get syntax highlighting on Gist, give each file the appropriate extension (.java for Java code). To get syntax highlighting on Pastebin, select the language from the dropdown at the bottom of the page.
-
Minecraft Forge 1.8 Throwable Entity Not Rendering
Are there any errors in the log? Upload the full FML log (logs/fml-client-latest.log) to Gist and link it here.
-
Minecraft Forge 1.8 Throwable Entity Not Rendering
What you've posted should work in 1.8.
-
[1.8.9]Item with OBJ model
The ItemCameraTransforms.TransformType enum describes the valid transform types for items. HEAD is used to render the item on entity heads, GROUND is used to render the item as an EntityItem and FIXED is used to render the item in item frames.
-
Minecraft Forge 1.8 Throwable Entity Not Rendering
Like I said, what diesieben07 is talking about doesn't exist in 1.8. It was added in 1.8.9. This is how I register the Render for my arrow entity in 1.8.9. This uses Java 8's method references, you'd use an anonymous class instead if you were targeting Java 6/7. This is how I register it in 1.8.
-
Forge keeps crashing... please help
From the EAQ:
-
Minecraft Forge 1.8 Throwable Entity Not Rendering
The OP is still using 1.8 rather than 1.8.9, so IRenderFactory and the corresponding registration don't exist for them. I would suggest updating to 1.8.9 or 1.9 and using the method diesieben07 mentioned.
-
[1.9] [Solved] Not able to load assets.
The new stacktrace confirmed that it's caused by not being able to find the model file rather than being caused by something like a syntax error within it. However, I'm not too sure why it's not loading any of your assets. You could try exiting IDEA, deleting your project by running gradlew cleanIdea from the command line and then re-importing build.gradle into IDEA; though I can't guarantee that this will fix anything. You may not always be able to find tutorials for the latest version of Minecraft since they're just written by random members of the community. 1.9 is still quite new, so it may take a while for new tutorials to be made and old ones to be updated. A lot of core concepts have remained the same across many versions of Minecraft, so even older tutorials may still partially work. 1.8 introduced the model system for blocks and items, it's still mostly similar in 1.9. The registry system has been overhauled in recent 1.9 versions of Forge, but it looks like you're already using the new system. You can find Forge's official documentation here. This isn't a comprehensive guide to every part of Minecraft/Forge, but it does cover a few of the major concepts. Sometimes you just have to read through the Minecraft/Forge code to figure out how various parts of it work.
-
[1.9] [Solved] Not able to load assets.
What diesieben07 said is correct, but I suspect it may not be the cause of this particular error. Forge improved the error reporting for item model loading in 1.9-12.16.0.1837-1.9 (this commit), update to the latest version of Forge and post the new error.
-
[Solved] [1.8.9] TileEntities have same NBT
It sounds like you're using a static field instead of an instance field. We can't do much more than guess without seeing your code. If you want more help, upload the TileEntity class to Gist/Pastebin with syntax highlighting and link it here.
-
[1.9] ItemAxe Util - Not working properly? [solved]
ItemAxe can no longer be used with custom ToolMaterial s due to hardcoding the attack damage/speed for each ToolMaterial and using the ToolMaterial 's ordinal as an array index. See this issue for more details and an explanation of what the current plans to fix this are. In the meantime, extend ItemTool and use Item#setHarvestLevel to set the tool class to "axe" and the harvest level to the ToolMaterial 's harvest level. Some issues with your code that aren't directly related to axes: Use the new GameRegistry.register method instead of GameRegistry.registerItem / registerBlock . If you can't see it, update Forge. Don't use unlocalised names as registry names, the registry name methods were introduced in 1.8.9 to stop people doing that. If an Item should have the same registry and unlocalised names, set the registry name ( IForgeRegistryEntry#setRegistryName or one of the overloads from IForgeRegistryEntry.Impl ) and then set the unlocalised name to the full registry name ( IForgeRegistryEntry#getRegistryName ). This also applies to Block s. As an example, setRegistryName("foo"); setUnlocalizedName(getRegistryName().toString()) results in the registry name being modid:foo and the full unlocalised name being item.modid:foo.name . Most of my mod's Item s use this method to set their registry and unlocalised names, but some have completely separate registry and unlocalised names that they set manually (e.g. records). Don't use ItemModelMesher#register to register models, use ModelLoader.setCustomModelResourceLocation / setCustomMeshDefinition in preInit. Don't use unlocalised names for model registration. The default model for every Item is the one with its registry name.
-
[1.8.9+] [SOLVED] Entity and TileEntity models
There's also a reference for the grammar of the Animation State Machine files used by the system here.
-
[1.9] How to create & register a sound using the new registry system? [Solved]
Every sound name in your sounds.json file is automatically prefixed with your mod ID. The registry name and sound name of your SoundEvent should be the same ResourceLocation , which should include your mod ID. You can see my mod's SoundEvent registration here and the sounds.json file here.
-
Using the Forge Animation System
I can't help you much further, but I did find this Gist a while back that explains the grammar of the Animation State Machine files.
IPS spam blocked by CleanTalk.