Everything posted by Choonster
-
1.11 - Can't get Capabilities to work
You can't reference client-only classes like Minecraft from common code, otherwise you'll crash the dedicated server. Capabilities and most event handlers need to be registered on both physical sides, so this should be done from your @Mod class. The class you specify in the serverSide property of the @SidedProxy annotation will only be loaded by the dedicated server.
-
[Forge 1.11] How to color item using the same textures?
The ItemEternalCrystal constructor is calling ItemEternalCrystal#preInit, which is calling the ItemEternalCrystal constructor, which is calling ItemEternalCrystal#preInit. This is infinite recursion, which causes a StackOverflowError to be thrown. Post the latest version of ItemEternalCrystal.
-
Launch Configuration references non-existing projects
The forgeSrc library referenced by your IDE project already contains both the Minecraft and Forge source code (assuming you used setupDecompWorkspace when setting it up).
-
Item with Multiple Models managed via NBT and ModelLoader
You first need to register each possible model location using ModelBakery.registerItemVariants. This tells Minecraft to load the models. Your implementation of ItemMeshDefinition#getModelLocation receives the ItemStack being rendered and needs to return a ModelResourceLocation pointing to the desired model. You can use any aspect of the ItemStack (or none) to determine the model location, including NBT. I have an explanation of how ModelResourceLocations are mapped to model files here.
-
[Forge 1.11] How to color item using the same textures?
Don't implement IItemColor on your Item. It's a client-only interface that doesn't exist on the dedicated server, so you can only reference it in client-only classes. Once you've extracted the IItemColor implementation (I recommend using an anonymous class or lambda), post the code where you register it with the ItemColors instance.
-
Forums Migration/Upgrade
I can confirm that using a PNG avatar works, though using a JPEG one should either work or result in a better error message. It looks like there's a time limit on edits, since I can't edit my previous post in this thread. This is a bit annoying, I'd prefer not to have the time limit. Contrary to my previous post, there is a distinction between read and unread threads, I just didn't have any unread ones.
-
Forums Migration/Upgrade
Some issues I've noticed: Almost all avatars appear to be missing (TheDarkPreacher's is the only one I've seen so far) Attempting to upload an avatar fails, with the message "There is no profile photo available to crop Error code: 2C138/C". The URL is http://www.minecraftforge.net/forum/index.php?/profile/70776-choonster/&do=cropPhoto. The [tt] tag was previously used for inline code, now it's being displayed as a code block on a new line. I can't edit any of my posts made before the migration. I'm not sure if this is a bug or a time limit. There doesn't appear to be any distinction between read and unread threads. It's not really a migration issue, but is there any way to disable the popup and/or sound for new replies while viewing a thread?
-
[Forge 1.11] How to color item using the same textures?
IItemColor#getColorFromItemstack receives two arguments: the ItemStack being rendered and the tint index, which specifies the model part being rendered. You can use both of these to determine which colour should be returned. The tint index is similar to the render pass arguments of colour-related methods in previous versions. For models that extend builtin/generated , each layerN texture has a tint index of N . For other models, you can specify the tint index for each face in the model file (see the wiki for a full specification of the model format). For the singularity, you'd use the ItemStack 's metadata to determine which index of the colour arrays to use and the tint index to determine which of the two arrays to look up the colour in ( colors2 if it's 0, colors if it's 1). Look at the IItemColor of Items.SPAWN_EGG for an example of the colour being chosen based on the ItemStack and the tint index.
-
[Forge 1.11] How to color item using the same textures?
Could you give me an example of that? Look at the ItemColors class.
-
[Forge 1.11] How to color item using the same textures?
You need to register an IItemColor implementation for your Item by calling ItemColors#registerItemColorHandler in init from your client proxy. You can get the ItemColors instance by calling Minecraft#getItemColors .
-
[1.11] Make NBT data for item
If nbt is null , calling a method on it will throw a NullPointerException .
-
[1.11] Make NBT data for item
The item's NBT is accessed all over the place, look for usages of the ItemStack#stackTagCompound field or the ItemStack#getTagCompound method using your IDE. Your values won't be accessed or modified by the game. Edit: Fixed the formatting.
-
[1.11] Make NBT data for item
So do it for each recipe. I'm not entirely sure what you're asking here.
-
[1.11] Make NBT data for item
You can set NBT data almost anywhere you have an ItemStack . You can do this for the output of a single crafting recipe by setting the NBT data before you add the recipe or in IRecipe#getCraftingResult . You can do this for an item crafted, smelted or bought by a player by overriding Item#onCreated .
-
[1.11] Make NBT data for item
ItemStack#getTagCompund returns the stack's compound tag, which is null by default. If it's null , create a new NBTTagCompound and use ItemStack#setTagCompound to set it as the stack's compound tag. You can then use the NBTTagCompound#getX / setX to get/set values in the compound tag. You can also use capabilities to store data on an ItemStack (or any other ICapabilityProvider ).
-
Forge 1.11 won't launch please help!
You installed a coremod built for 1.7.10 or earlier, but you're running 1.11. Mods (especially coremods) usually only work for the version of Minecraft that they were built for. The download page and file name will usually tell you this version. Side note: The log you posted was completely unreadable, I had to quote it and copy it into an external editor to read it. In future, please upload the full FML log (the logs/fml-client-latest.log file in the game directory, not the console output from the launcher) to Gist and link it here.
-
Renamed: Figured out most of villagers, need help ironing out bugs
EntityRegistry.registerModEntity isn't really related to rendering, but it is required to register your entity class using it. If you don't explicitly register a Render for your entity class, Minecraft will use the one for the super class.
-
[1.11] How to make item description?
That's not at all what I told you to do. You need to override Item#addInformation and add tooltip lines to the List<String> argument, not create a List<String> field and add tooltip lines to it in a completely different method.
-
[1.11] How to 'bake' a new model from a json file?
Like I said in your previous thread, look at MultiLayerModel . It uses ModelLoaderRegistry.getModelOrLogError to get the IModel from a ResourceLocation and then bakes it into an IBakedModel using IModel#bake (in MultiLayerModel.buildModels ).
-
[1.11] IBakedModel: Merge models
I suggest you look at MultiLayerModel , which combines multiple models that render on different layers.
-
[1.11] getExtendedState crash
Properties.toUnlisted creates a new IUnlistedProperty object every time you call it, so the unlisted version of the STATE_0 property that you pass to the ExtendedBlockState constructor in BlockRipeningRack#createBlockState isn't the same as the one you pass to IExtendedBlockState#withProperty in BlockRipeningRack#getExtendedState . You need to store the IUnlistedProperty objects instead of re-creating them each time.
-
Renamed: Figured out most of villagers, need help ironing out bugs
You can't create an NBTTagString with a null value, so you can't call NBTTagCompound#setString with a null value. Only call NBTTagCompound#setString if the name value isn't null .
-
Renamed: Figured out most of villagers, need help ironing out bugs
That should work, yes.
-
Renamed: Figured out most of villagers, need help ironing out bugs
No, that wouldn't work. In writeNBT , you create an NBTTagCompound and store the data in it; but you then return a completely unrelated NBTTagString and do nothing with the NBTTagCompound . You need to return the NBTTagCompound . In readNBT , you assume that the NBTBase argument is an instance of NBTPrimitive (it won't be if writeNBT returns an NBTTagCompound ) that somehow contains both the name and the gender at the same time. You need to cast the argument to NBTTagCompound and retrieve the individual values from it using NBTTagCompound#getString and NBTTagCompound#getInteger .
-
[1.11] How to make item description?
Override Item#addInformation to add the desired tooltip lines to the List<String> argument.
IPS spam blocked by CleanTalk.