Jump to content

Leviathan143

Forge Modder
  • Posts

    211
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Leviathan143

  1. 1. Press Ctrl + Shift + T(Eclipse), or Ctrl + Shift + N(IntelliJ) and search for EnumHelper in the dialog that appears 2. Open the class 3. Find the addArmorMaterial method, now you know what the new signature(return type, name, parameters, etc) is
  2. public FireZombie(ModelBiped model, float scale) public class ModelFireZombie extends ModelBiped
  3. 1. Why not? There is a way to add brewing recipes in 1.7.10, but 1.9's brewing API is far better. 2. Create an IFuelHandler and register it with GameRegistry.registerFuelHandler().
  4. I am aware of that, I advised him to remove them because it was bad practice. I was not aware that you couldn't use non-static fields, update them from NBT before you use them and write their values to NBT after you changed them. I never got that approach to work, but I thought I was just doing it wrong. @nates1984 I revise my advice, remove the fields entirely, instead create helper functions to retrieve the values from NBT when you need them.
  5. Remove the static modifiers and make your fields private, create a getter if you need to access a field outside it's class, inside the class you can reference them directly or with this.<field name> . I also suggest you look up what the static modifier actually does,
  6. Williewillus has a good primer on Capabilities here: https://gist.github.com/williewillus/c8dc2a1e7963b57ef436c699f25a710d
  7. The world generators with larger weights run before the generators with lower weights.
  8. Overlays are rendered in ItemRenderer#renderOverlays().
  9. Where is FONT_TEXTURE_ASCII defined? Also, please provide the log.
  10. net.minecraft.world.Teleporter creates the nether portal, you need to extend it and override makePortal to make your portal instead. Then use that instead of Teleporter when teleporting the player to your dimension.
  11. Your class is abstract, abstract classes can't be instantiated. Learn what code does before using it.
  12. In 1.9, you can use ForgeRegistries.POTIONS. In 1.8.9 you want Potion.potionRegistry.
  13. All mods have a built-in resource pack (src/main/resources/assets) for their textures, models, etc. Just put the textures in there as if it you were making a resource pack.
  14. Define a variant called "inventory" in the blockstate .json file.
  15. The problem is that you have not associated an ItemBlock with your Block, so Item#getItemFromBlock() returns null. Create the ItemBlock by calling the constructor of ItemBlock that takes a Block as a parameter, then register that instead.
  16. That's not how DataParameters work at all. Creating a field with the same type and name as the field that stores the DataParameter won't work, DataParameters are stored as Objects, not types. To get the parameter's value, you need the Object that was registered to the EntityDataManager. You could get it using reflection, but that's messy and has more overhead than a simpler option. Slimes store their size in NBT as well, because DataParameters do not persist after the world is unloaded; this means that you can create an NBTTagCompound, set a tag with the identifier(The String that identifies the tag) "Size" to whatever size you want and then use Entity#readEntityFromNBT to apply it to a slime.
  17. The elytra recipe needs to be a ShapedOreRecipe, because it uses oredict entries.
  18. I assume this is for Light Drafter? What exactly are you sending, who is sending it and who receives it?
  19. AFAIK 1.8 mods are not compatible with 1.8.8
  20. Take a look at the submodels section here: https://mcforge.readthedocs.org/en/latest/blockstates/forgeBlockstates/
  21. Don't use setCreativeTab() on it. If it's not your block/item set it's creative tab to null.
  22. The one that contains src/main
  23. Put the library in the libs folder found in your mod's folder, create one if it doesn't exist. So if your mod's root folder is called StuffAndThings, you need to put the library in StuffAndThings/libs. The end user will still need to download the library though.
  24. I hate to bump this, but I really need some help with this. EDIT: Figured it out, I needed to make some changes to the model file, here's the fixed model: package com.leviathan143.ellipsis.client.model.armour; import net.minecraft.client.model.ModelBiped; import net.minecraft.client.model.ModelRenderer; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.entity.Entity; /** * ModelEarmuffs - Leviathan143 * Created using Tabula 5.1.0 */ public class ModelEarmuffs extends ModelBiped { public ModelRenderer headband; public ModelRenderer rightMuff; public ModelRenderer leftMuff; public ModelEarmuffs() { this.textureWidth = 32; this.textureHeight = 16; this.rightMuff = new ModelRenderer(this, 0, 6); this.rightMuff.mirror = true; this.rightMuff.setRotationPoint(0.0F, 0.0F, 0.0F); this.rightMuff.addBox(3.5F, -5.0F, -2.0F, 2, 4, 3, 0.0F); this.setRotateAngle(rightMuff, 0.0F, 3.141592653589793F, 0.0F); this.leftMuff = new ModelRenderer(this, 0, 6); this.leftMuff.mirror = true; this.leftMuff.setRotationPoint(0.0F, 0.0F, 0.0F); this.leftMuff.addBox(3.5F, -5.0F, -1.0F, 2, 4, 3, 0.0F); this.headband = new ModelRenderer(this, 0, 0); this.headband.setRotationPoint(0.0F, 0.0F, 0.0F); this.headband.addBox(-5.0F, -9.0F, 0.0F, 10, 4, 1, 0.0F); this.headband.addChild(this.rightMuff); this.headband.addChild(this.leftMuff); } //I can't figure out what most of these floats are, so they have terrible names. @Override public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float scale) { GlStateManager.pushMatrix(); super.setRotationAngles(f, f1, f2, f3, f4, scale, entity); this.bipedHead = headband; if(entity.isSneaking()) GlStateManager.translate(0.0F, 0.275F, 0.0F); headband.render(scale); GlStateManager.popMatrix(); } /** * This is a helper function from Tabula to set the rotation of model parts */ public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) { modelRenderer.rotateAngleX = x; modelRenderer.rotateAngleY = y; modelRenderer.rotateAngleZ = z; } } The main problem was that all the parts of your model need to have the same rotation point as the part of the model it goes on, my model did not do this.
  25. I've made a helmet with a custom model, however it isn't rendering properly. It renders and rotates with the movement of the player's head, but it's rendering at the bottom of the chest and it's scaled down. I've tried looking at how another mod did it, that got me where I am now(Before it was rendering in the right place at the right scale, but it wasn't moving with the players head). I also tried using OpenGL, but I couldn't figure out how to calculate the values to translate/scale the model. ItemEarmuffs.java package com.leviathan143.ellipsis.common.items; import net.minecraft.client.audio.ISound; import net.minecraft.client.audio.SoundCategory; import net.minecraft.client.model.ModelBiped; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.Item; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; import net.minecraft.util.BlockPos; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import com.leviathan143.ellipsis.Ellipsis.Constants; import com.leviathan143.ellipsis.client.model.armour.ModelEarmuffs; import com.leviathan143.ellipsis.common.blocks.IMuffler; public class ItemEarmuffs extends ItemArmor implements IMuffler { public ItemEarmuffs() { super(ArmorMaterial.LEATHER, 0, 0); } private ModelEarmuffs modelEarmuffs = new ModelEarmuffs(); private static final String EARMUFFS_TEXTURE = Constants.MODID + ":textures/armour/earmuffs.png"; @Override public boolean shouldMuffleSound(World world, BlockPos mufflerPos, ISound sound, SoundCategory category) { return true; } @Override public boolean isValidArmor(ItemStack stack, int armorType, Entity entity) { if(armorType == 0) return true; return false; } @Override public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot, ModelBiped _default) { if(armorSlot == 4) { return modelEarmuffs; } return super.getArmorModel(entityLiving, itemStack, armorSlot, _default); } @Override public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) { return EARMUFFS_TEXTURE; } } ModelEarmuffs.java package com.leviathan143.ellipsis.client.model.armour; import net.minecraft.client.model.ModelBiped; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; /** * ModelEarmuffs - Leviathan143 * Created using Tabula 5.1.0 */ public class ModelEarmuffs extends ModelBiped { public ModelRenderer headband; public ModelRenderer rightMuff; public ModelRenderer leftMuff; public ModelEarmuffs() { this.textureWidth = 32; this.textureHeight = 16; this.leftMuff = new ModelRenderer(this, 11, 6); this.leftMuff.setRotationPoint(3.5F, 3.0F, 0.0F); this.leftMuff.addBox(0.0F, 0.0F, -1.5F, 2, 4, 3, 0.0F); this.rightMuff = new ModelRenderer(this, 0, 6); this.rightMuff.setRotationPoint(-3.5F, 3.0F, 0.0F); this.rightMuff.addBox(-2.0F, 0.0F, -1.5F, 2, 4, 3, 0.0F); this.rightMuff.mirror = true; this.headband = new ModelRenderer(this, 0, 0); this.headband.setRotationPoint(0.0F, -8.5F, 0.0F); this.headband.addBox(-5.0F, -0.5F, -0.5F, 10, 4, 1, 0.0F); this.headband.addChild(this.leftMuff); this.headband.addChild(this.rightMuff); } //I can't figure out what most of these floats are, so they have terrible names. @Override public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float scale) { this.bipedHead = headband; this.bipedHeadwear.showModel = false; super.render(entity, f, f1, f2, f3, f4, scale); } /** * This is a helper function from Tabula to set the rotation of model parts */ public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) { modelRenderer.rotateAngleX = x; modelRenderer.rotateAngleY = y; modelRenderer.rotateAngleZ = z; } } The first model was the same as the current one except for the render method, which was this: @Override public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float scale) { this.headband.render(scale); }
×
×
  • Create New...

Important Information

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