Jump to content

Choonster

Moderators
  • Posts

    5160
  • Joined

  • Last visited

  • Days Won

    76

Everything posted by Choonster

  1. Method references were introduced in Java 8, so setting the language level to 8 should allow them. There is no isAmmo method in ItemBow , though; only isArrow .
  2. I briefly skimmed through your code and couldn't see any obvious errors. I suggest you post the FML log from the server and client using Gist. I did notice a few things that could be improved: Instead of checking the event's side in your @EventHandler methods to do client-only things, use the @SidedProxy system. Instead of using the deprecated GameRegistry.registerItem method, use the new GameRegistry.register method. It's recommended that you use the single-argument overload of this method and set the registry name of the object you're registering (e.g. an Item ) with IForgeRegistryEntry#setRegistryName (or one of the overloads from IForgeRegistryEntry.Impl ) before registering it. Instead of registering models with ItemModelMesher#register in init, use ModelLoader.setCustomModelResourceLocation / setCustomMeshDefinition in preInit. The default model loaded for every Item is the one with its registry name ( IForgeRegistryEntry#getRegistryName ), so you should use this rather than creating your own name field and getName methods.
  3. Look for the getBlockReachDistance / setBlockReachDistance methods of ItemInWorldManager (1.8.9 and earlier) or PlayerInteractionManager (1.9+).
  4. To give a sound event a subtitle, set the "subtitle" key of the sound event in sounds.json to a string containing the translation key. An example from the vanilla sounds.json file: "item.shovel.flatten": { "sounds": [ "item/shovel/flatten1", "item/shovel/flatten2", "item/shovel/flatten3", "item/shovel/flatten4" ], "subtitle": "subtitles.item.shovel.flatten" },
  5. The OP is using 1.8.9, where the Forge and FML event buses have been merged. Anything that was fired on the FML bus is now fired on the Forge bus.
  6. Are there any errors in either of the logs? Upload them both to Gist and link them here. Try stepping through SoundManager#playSound like I suggested to the OP.
  7. The sounds.json format hasn't changed much in 1.9 except for the addition of the "voice" category for sounds and the need to include the resource domain for sound file paths and sound event names in the "sounds" array of sound events. This page explains the format. Each value in the top-level object is a sound event, you can register a SoundEvent for each one of these to play one of their sound files. The values in the "sounds" array of each sound event are either the path of a sound file as a string (e.g. "tetracraft:entity/terrakon/bark1" ) or an object with its "name" property set to the path of a sound file or the name of another sound event. This object can also contain various other properties, see the wiki page I linked for more details.
  8. The sound name passed to the SoundEvent constructor is the name of a sound event in your sounds.json file (i.e. the keys of the top-level object), not the name of a sound file. In your case, tetracraft:mob.terrakon.bark is the name to use for the first sound.
  9. 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.
  10. 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.
  11. The event is fired once per hand per side.
  12. 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?
  13. 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.
  14. 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)?
  15. 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.
  16. There don't seem to be any errors in the log, I'm not too sure what's going wrong.
  17. 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).
  18. 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.
  19. 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.
  20. Are there any errors in the log? Upload the full FML log (logs/fml-client-latest.log) to Gist and link it here.
  21. What you've posted should work in 1.8.
  22. 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.
  23. 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.
×
×
  • Create New...

Important Information

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