-
Posts
5160 -
Joined
-
Last visited
-
Days Won
76
Everything posted by Choonster
-
You can read more about capabilities here.
-
[1.9.4] Registering SoundEvent ignoring my modid?
Choonster replied to coolAlias's topic in Modder Support
It's possible that you'd want to create a sound event that consists of a combination of vanilla files not present in any existing sound event. For example, a sound event consisting of minecraft:block/chorus_flower/grow1, minecraft:dig/cloth1 and youmod:foo/bar. There's no existing sound event with this combination of sound files. -
[1.11.2] Use #inventory variant for a .obj model
Choonster replied to Gugu42's topic in Modder Support
By default, the same model is used for an item regardless of where it's being rendered (e.g. in the hand or in the inventory). You'll need to create an IPerspectiveAwareModel wrapper that uses either the full OBJ model or the simple JSON model based on where it's being rendered (the TransformType). diesieben07 helped someone else with something similar here. -
[1.9.4] Registering SoundEvent ignoring my modid?
Choonster replied to coolAlias's topic in Modder Support
The sound events in your sounds.json file have their resource domain set automatically from the file's resource domain, but the individual sound files used by the sound events don't, they need to be specified manually. Replace special/levelup with dynamicswordskills:special/levelup in your sounds.json file. -
Noticed registEntityRenderHandler is deprecated, what to use instead
Choonster replied to clowcadia's topic in Modder Support
IRenderFactory is an interface with a single method, you shouldn't need an example. All your implementation needs to do is create and return the Render instance using the provided RenderManager instance. You can implement it with a lambda/constructor method reference (requires Java 8), an anonymous class or a regular class. -
Noticed registEntityRenderHandler is deprecated, what to use instead
Choonster replied to clowcadia's topic in Modder Support
Use the non-deprecated overload with an IRenderFactory argument. -
[1.11.2] Can you use an obj for an entity model?
Choonster replied to Kriptikz's topic in Modder Support
AnimationModelBase is a ModelBase that renders an animated baked model. If the model isn't animated, you can create your own Render/ModelBase and cache the IBakedModel instead of re-baking it each frame. -
Server crash after modpack update, please help...
Choonster replied to Wizardon777's topic in Support & Bug Reports
It looks like an issue with Extra Utilities 2, but you have a lot of coremods installed that could be screwing things up. Test it with the latest version of Extra Utilities 2 and without all of the coremods. If the issue persists, report it to the author. -
On Sponge's GitHub.
-
minecraft 1.8.9 how to resolve the logs/fml-client-latest.log
Choonster replied to Adust's topic in Support & Bug Reports
Make sure you read the installation instructions for the mods you're using. -
minecraft 1.8.9 how to resolve the logs/fml-client-latest.log
Choonster replied to Adust's topic in Support & Bug Reports
We can't help you without seeing the FML log (logs/fml-client-latest.log), upload it to Gist and link it here. -
EnergyStorage doesn't implement INBTSerializable, so it doesn't have methods to read it from/write it to NBT. Either get the capability's IStorage (Capability#getStorage) and use that to read from/write to NBT or do it yourself (storing the energy in a single integer tag).
-
Save ItemStack with NBT data to file (client-side)
Choonster replied to Saucier's topic in Modder Support
That looks mostly correct, but there are some minor changes I'd recommend: Only catch the most specific exception you have to, i.e. IOException rather than Exception. This lets other exceptions propagate upwards so they can be handled by Minecraft itself. Log the exception with a log4j Logger rather than just printing its stack trace. This will ensure it's formatted properly in the console and FML log. Consider using ItemStack#serializeNBT (from the INBTSerializable interface) rather than ItemStack#writeToNBT. This creates the NBTTagCompound for you and returns it. That should be all you need, yes. -
Save ItemStack with NBT data to file (client-side)
Choonster replied to Saucier's topic in Modder Support
WorldSavedData only saves data to the disk on the logical server, so it's not really suitable for your purposes. You can look at how MapStorage reads and writes WorldSavedData instances to .dat files using CompressedStreamTools, though you won't be able to use ISaveHandler#getMapFileFromName from the logical client (since the client-side implementation always returns null). -
[1.11+] [SOLVED] How to refer to mod enchantments in loot tables?
Choonster replied to The_Wabbit's topic in Modder Support
The OP is asking about loot tables, not fields. -
[1.11+] [SOLVED] How to refer to mod enchantments in loot tables?
Choonster replied to The_Wabbit's topic in Modder Support
You can use the enchant_randomly loot function to apply a random level of an Enchantment randomly selected from the provided list of Enchantment registry names (which can be a list of a single name). If you want an exact level, you'll need to create your own LootFunction and LootFunction.Serializer implementations and use LootFunctionManager#registerFunction to register them. Potion items already store their PotionType using its registry name, but custom PotionEffects are still stored using Potion IDs. There's no vanilla loot function to create potion items, you'd have to write your own if you wanted to use Potion registry names when specifying custom PotionEffects. -
[1.11] An item model with attachments?/addons
Choonster replied to Allskill's topic in Modder Support
You'll likely need to store which attachments the gun has using NBT or capabilities. There are several possible ways to handle the model: Create a model for each possible state of the gun (e.g. no attachments, scope, bi-pod, scope and bi-pod, etc.) and register an ItemMeshDefinition to choose the appropriate one based on the current attachments. Create the base gun model and a model for each attachment and combine them as submodels using Forge's blockstates format. You'll still need to register an ItemMeshDefinition to choose the appropriate variant of the blockstates file based on the current attachments. Generate the models at runtime with an ICustomModelLoader, IModel and IBakedModel. Forge has several examples of this. -
[Fixed] [1.8] Setting the Item model for an ItemBlock
Choonster replied to Glorfindel22's topic in Modder Support
You need to set the item's model using ModelLoader.setCustomModelResourceLocation or ModelLoader.setCustomMeshDefinition. Call these in preInit (or ModelRegistryEvent in 1.10.2+) from a client-only class. 1.8 isn't really supported by Forge any more, you should update directly to 1.11.2 or at least to 1.8.9. -
Regular properties are represented by an IProperty and have a fixed set of values of a type that implements Comparable (e.g. the two booleans, a range of ints or a set of enum values). These can be stored in metadata or set in Block#getActualState and can be used to determine which model is used for the IBlockState. Unlisted properties are represented by an IUnlistedProperty and can have any number of values (e.g. any float or any object of the specified type), with IUnlistedProperty#isValid being used to determine whether or not a value is valid. These must be set from Block#getExtendedState and can be used by the IBakedModel to change how it's rendered. To use unlisted properties, you need to return an ExtendedBlockState from Block#createBlockState instead of a BlockStateContainer. If you use BlockStateContainer.Builder to create the state container, you don't need to worry about using the right class for your properties, it will create an ExtendedBlockState if you've added unlisted properties or a BlockStateContainer if you haven't.
-
High my mod crashing again need healp very badly. :(
Choonster replied to TheRPGAdventurer's topic in Modder Support
BlockDragonBreedEgg#getStateFromMeta is trying to set the breed property to null, but this isn't a value allowed by the property. You need to figure out where this null is coming from and what the actual value is supposed to be. -
Game Crash when Dispenter One Block over Rail
Choonster replied to Nitrama's topic in Support & Bug Reports
This was fixed in Forge 1.11.2-13.20.0.2240. Always make sure you're running the latest version before reporting bugs, otherwise they may have already been fixed. -
They can, using AnimationModelBase. This also allows the model to be animated with Forge's baked model animation system.
-
[1.11] Can only summon one out of two of my human variations
Choonster replied to That_Martin_Guy's topic in Modder Support
You need to add a LayerBipedArmor to the Render with RenderLivingBase#addLayer to render the entity's armour. I'm not too sure why the AI isn't working, you may need to step through it in a debugger to see where it goes wrong. -
[1.11] Can only summon one out of two of my human variations
Choonster replied to That_Martin_Guy's topic in Modder Support
EntityHumanFighter#initEntityAI calls super.applyEntityAttributes, which registers the entity's attributes. This method has already been called by the EntityLivingBase constructor, so the attribute registration fails with an exception because the attributes it's trying to register have already been registered. EntityHumanCivilian doesn't do this, so it can be summoned without issue.