Jump to content

Choonster

Moderators
  • Posts

    5160
  • Joined

  • Last visited

  • Days Won

    76

Everything posted by Choonster

  1. I don't think this is true. Looking at ModelLoader#loadItemModels, Forge tries to load the item model first and only tries to load the model from the blockstates file if that throws an exception.
  2. You can read more about capabilities here.
  3. 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.
  4. 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.
  5. 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.
  6. 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.
  7. Use the non-deprecated overload with an IRenderFactory argument.
  8. 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.
  9. 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.
  10. On Sponge's GitHub.
  11. Make sure you read the installation instructions for the mods you're using.
  12. We can't help you without seeing the FML log (logs/fml-client-latest.log), upload it to Gist and link it here.
  13. 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).
  14. 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.
  15. 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).
  16. The OP is asking about loot tables, not fields.
  17. 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.
  18. 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.
  19. 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.
  20. 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.
  21. 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.
  22. 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.
  23. They can, using AnimationModelBase. This also allows the model to be animated with Forge's baked model animation system.
  24. 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.
  25. 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.
×
×
  • Create New...

Important Information

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