-
Posts
5160 -
Joined
-
Last visited
-
Days Won
76
Everything posted by Choonster
-
[1.8 and 1.9] Having a few issues on 1.9 and 1.8
Choonster replied to NovaViper's topic in Modder Support
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 . -
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.
-
Look for the getBlockReachDistance / setBlockReachDistance methods of ItemInWorldManager (1.8.9 and earlier) or PlayerInteractionManager (1.9+).
-
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" },
-
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.
-
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.
-
java.lang.IndexOutOfBoundsException
Choonster replied to edwardsjs21's topic in Support & Bug Reports
From the EAQ: -
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?
Choonster replied to Vega Alpha's topic in Modder Support
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
Choonster replied to Notunknown's topic in Modder Support
The event is fired once per hand per side. -
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.
-
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
Choonster replied to abrad1212's topic in Modder Support
There don't seem to be any errors in the log, I'm not too sure what's going wrong. -
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).
-
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.
Choonster replied to Tides's topic in Modder Support
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
Choonster replied to abrad1212's topic in Modder Support
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
Choonster replied to abrad1212's topic in Modder Support
What you've posted should work in 1.8. -
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
Choonster replied to abrad1212's topic in Modder Support
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. -
From the EAQ: