-
Posts
211 -
Joined
-
Last visited
-
Days Won
1
Everything posted by Leviathan143
-
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
-
How to declare class as a member in a new class?
Leviathan143 replied to Gilberrrto's topic in Modder Support
public FireZombie(ModelBiped model, float scale) public class ModelFireZombie extends ModelBiped -
[1.9] Can't assign class or instance variable in custom Item
Leviathan143 replied to nates1984's topic in Modder Support
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. -
[1.9] Can't assign class or instance variable in custom Item
Leviathan143 replied to nates1984's topic in Modder Support
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, -
Williewillus has a good primer on Capabilities here: https://gist.github.com/williewillus/c8dc2a1e7963b57ef436c699f25a710d
-
[1.7.10] how to generate ore after chunk modifying
Leviathan143 replied to winnetrie's topic in Modder Support
The world generators with larger weights run before the generators with lower weights. -
How does Minecraft determine if the player is in a block or not?
Leviathan143 replied to Thornack's topic in Modder Support
Overlays are rendered in ItemRenderer#renderOverlays(). -
Where is FONT_TEXTURE_ASCII defined? Also, please provide the log.
-
1.7.10 Making my custom dimension a void world
Leviathan143 replied to Elrol_Arrowsend's topic in Modder Support
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. -
[SOLVED] [1.7.10] Creating entity throws InstantiationException
Leviathan143 replied to IamMaxim's topic in Modder Support
Your class is abstract, abstract classes can't be instantiated. Learn what code does before using it. -
Is there a way to get Potion recipes?
Leviathan143 replied to UntouchedWagons's topic in Modder Support
In 1.9, you can use ForgeRegistries.POTIONS. In 1.8.9 you want Potion.potionRegistry. -
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.
-
[1.9] registering blocks/items in 1.9[SOLVED]
Leviathan143 replied to winnetrie's topic in Modder Support
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. -
[1.9] Set the size of the slime to spawn
Leviathan143 replied to American2050's topic in Modder Support
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. -
The elytra recipe needs to be a ShapedOreRecipe, because it uses oredict entries.
-
[1.8.8] Method not found: Loader.getModClassLoader
Leviathan143 replied to jeffryfisher's topic in Modder Support
AFAIK 1.8 mods are not compatible with 1.8.8 -
[Solved] [1.9] Too many model combinations.
Leviathan143 replied to wehttam664's topic in Modder Support
Take a look at the submodels section here: https://mcforge.readthedocs.org/en/latest/blockstates/forgeBlockstates/ -
[Solved]Removing an item/block's creative tab
Leviathan143 replied to Toost's topic in Modder Support
Don't use setCreativeTab() on it. If it's not your block/item set it's creative tab to null. -
The one that contains src/main
-
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.
-
Armour with custom model rendering incorrectly [1.8.9]
Leviathan143 replied to Leviathan143's topic in Modder Support
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. -
Armour with custom model rendering incorrectly [1.8.9]
Leviathan143 posted a topic in Modder Support
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); }