Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/26/17 in all areas

  1. Do you really need all of them to be baked at once? Why not have a custom IBakedModel render the block. If the wanted model is cached (stored already) then simply return the BakedQuad's for that. If not, create the wanted model, cache the BakedQuads, and return the BakedQuads for the model from the cache. This way, only the "needed" models are in memory (which should only be a shadow of what you got now), and if they are not, it creates them from scratch, AS they are needed. This should shave off a significant amount of RAM requirement.
    1 point
  2. A few notes: In EnumType: Field meta is obsolete, use the autogenerated enum method Enum#ordinal() instead. Returns the index of the enum in the declared order starting from 0. Static field META_LOOKUP is obsolete, just do Enum#values()[index] on demand. The compiler generates a VALUES array, which is then directly returned by Enum#values() The field name is obsolete, every enum stores its declaration name as a field, which can be accessed with Enum#name(). It returns the exact field name (often uppercase), so you have to toLowerCase() it before using it in this case. The getName() method can thus be overridden to return name().toLowerCase(); Also note the Enum#valueOf(String) method, which looks up an enum by its field name (often uppercase). It might be worth your time disassembling a simple enum with a few fields to see what the compiler does to it (you can also use the ASM plugin for idea/eclipse to see the bytecode): user@machine:~$ javac TestEnum.java; javap -l -p -c -s -constants TestEnum.class Instead of you private getResourceLocation(), use getRegistryName().toString(). Same result, but avoids the code duplication. Set the registry name in the constructor with setRegistryName(new ResourceLocation(MODID, name)). I'm surprised Forge didn't scream at you for not doing it. Unlocalized names are per convention in the form MODID:NAME. Although other things will work, they don't follow convention. Set your registry name first and then set your unlocalized name with setUnlocalizedName(getRegistryName().toString()). This follows the convention and makes sure your registry name is symmetric with the unlocalized name, which makes things more organised.
    1 point
  3. There is no existing UUID for a Knockback Resistance potion's AttributeModifier because there is no existing Knockback Resistance potion. Just generate a new UUID once and use that.
    1 point
  4. If it's vanilla ore, it's easy. You'll need to subscribe to OreGenEvent#GenerateMinable and block the events. I have an example of that you can look at here. When it comes to the other mods, hope that they have a config you can use to turn off their generation. Or, you'll have to load the mod as an external library and see if there's a getter/setter/public variable somewhere you can edit to turn off generation when your mod is installed. How they have their generation setup determines what you have to do. ...And that really only works if the mod author provides a source/dev version of the mod. Outside of editing the other mods' configs, you won't be able to just read a boolean out of your config and support blocking of any mod, you'll have to code support in for each mod manually.
    1 point
×
×
  • Create New...

Important Information

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