-
Posts
151 -
Joined
-
Last visited
Everything posted by Eastonium
-
Basically, a different texture when something like a wooden sword has 1 damage vs no damage. I haven't been able to find how to do this anywhere. I know that with 1.9 you can define this in the item model files, but I need a 1.8 solution. It was so easy to do with the old 1.7 way of textures. *cries on the inside*
-
Are all your faces in your model file facing outward?
-
Bump? anyone?
-
I need to have a custom village in my mod. I've looked at both the MapGenVillage and StructureVillagePieces classes, and I can create my own, but how do I get it to generate? preferably using a WorldGenerator class and I just call a method to generate it. how can this be done?
-
Have you figured this out?
-
Bump... Still unsolved
-
[1.7.2] Block with metadata - Blocks textures the same
Eastonium replied to Eastonium's topic in Modder Support
Yeah, I'm not using an Itemblock thing, I realized I needed that earlier today. I think i can take it from here -
[1.7.2] Block with metadata - Blocks textures the same
Eastonium replied to Eastonium's topic in Modder Support
the par2 in getIcon is the metadata, so I am accounting for it. the blocks don't have different textures on the sides. -
I have a problem with the block metadata textures. All the textures appear correct while in your inventory, but when you place them they all have the same texture, being the first block's texture. I don't know what I'm doing wrong. Here's my block file: package com.eastonium.bionicle.blocks; import java.util.List; import com.eastonium.bionicle.Bionicle; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; public class BlockKoro extends Block { public static final String[] stoneBlockNames = new String[] {"Onu_1", "Onu_2", "Po_1", "Po_2", "Ta_1", "Ta_2", "Ta_3", "Trdx_1", "Trdx_2"}; public static final String[] litBlockNames = new String[] {"Onu_1", "Ta_0"}; public static final String[] iceBlockNames = new String[] {"Ko_1", "Ko_2"}; public static final String[] leafyBlockNames = new String[] {"Ga_1", "Ga_2", "Ga_3"}; @SideOnly(Side.CLIENT) private IIcon[] icons; public BlockKoro(Material blockMaterial) { super(blockMaterial); this.setCreativeTab(Bionicle.bioBlockTab); } @Override @SideOnly(Side.CLIENT) public IIcon getIcon(int par1, int par2) { if (par2 < 0 || par2 >= this.icons.length) { par2 = 0; } return this.icons[par2]; } @Override public int damageDropped(int damage) { return damage; } @SuppressWarnings({ "unchecked", "rawtypes" }) @Override @SideOnly(Side.CLIENT) public void getSubBlocks(Item block, CreativeTabs creativeTabs, List list) { int type = (this.getMaterial() == Material.rock ? 9 : (this.getMaterial() == Material.leaves ? 3 : 2)); for(int i = 0; i < type; i++) { list.add(new ItemStack(block, 1, i)); } } @Override @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister iconRegisterer) { int type = (this.getMaterial() == Material.rock ? 9 : (this.getMaterial() == Material.leaves ? 3 : 2)); this.icons = new IIcon[type]; for (int i = 0; i < this.icons.length; ++i) { if(this.getMaterial() == Material.rock){ this.icons[i] = iconRegisterer.registerIcon(Bionicle.MODID + ":" + stoneBlockNames[i]); }else if(this.getMaterial() == Material.redstoneLight){ this.icons[i] = iconRegisterer.registerIcon(Bionicle.MODID + ":" + litBlockNames[i]); }else if(this.getMaterial() == Material.packedIce){ this.icons[i] = iconRegisterer.registerIcon(Bionicle.MODID + ":" + iceBlockNames[i]); }else if(this.getMaterial() == Material.leaves){ this.icons[i] = iconRegisterer.registerIcon(Bionicle.MODID + ":" + leafyBlockNames[i]); } } } }
-
so after some more testing, the player isn't moving when I print it out. So I deceided to just input numbers into the add Velocity, but strangely enough turned up not doing anything still. I wish i knew what was wrong
-
Bump again
-
Yes, I did test it after that if statement. I got the negative number from the EntityMinecart file, but I'll have to try it without the negative. EDIT: still no luck with anything. oh, another thing, I can break the block from under it and it doesn't fall. :?
-
So I did what you said and the only thing it fails to do is addVelocity(). I don't know what would be the problem.
-
I can spawn it fine, and I can collide with it, but I can't push it.
-
I really need to be able to make a simple pushable Entity. Entity: package com.eastonium.bionicle.kolhii; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.DamageSource; import net.minecraft.util.MathHelper; import net.minecraft.world.World; import com.eastonium.bionicle.Bionicle; public class EntityKolhiiBall extends Entity { public EntityKolhiiBall(World par1World) { super(par1World); this.isImmuneToFire = true; this.setSize(0.4F, 0.4F); } @Override public AxisAlignedBB getCollisionBox(Entity par1Entity) { return par1Entity.boundingBox; } @Override public AxisAlignedBB getBoundingBox() { return this.boundingBox; } @Override public boolean canBePushed() { return true; } @Override public void applyEntityCollision(Entity par1Entity) { if (par1Entity.riddenByEntity != this && par1Entity.ridingEntity != this) { double d0 = par1Entity.posX - this.posX; double d1 = par1Entity.posZ - this.posZ; double d2 = MathHelper.abs_max(d0, d1); if (d2 >= 0.009999999776482582D) { d2 = (double)MathHelper.sqrt_double(d2); d0 /= d2; d1 /= d2; double d3 = 1.0D / d2; if (d3 > 1.0D) { d3 = 1.0D; } d0 *= d3; d1 *= d3; d0 *= 0.05000000074505806D; d1 *= 0.05000000074505806D; d0 *= (double)(1.0F - this.entityCollisionReduction); d1 *= (double)(1.0F - this.entityCollisionReduction); this.addVelocity(-1.4*par1Entity.motionX, 0.5D, -1.4*par1Entity.motionZ); //par1Entity.addVelocity(d0, 0.0D, d1); } } } @Override public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { if (this.isEntityInvulnerable()) { return false; } else if (!this.worldObj.isRemote && !this.isDead) { this.setBeenAttacked(); if (par1DamageSource.getEntity() instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer)par1DamageSource.getEntity(); if(!player.capabilities.isCreativeMode) this.func_145778_a(Bionicle.kolhiiBall, 1, 0.0F); this.setDead(); } return true; } else { return true; } } @Override protected boolean canTriggerWalking() { return false; } @Override public boolean canBeCollidedWith() { return !this.isDead; } @Override protected void entityInit() {} @Override protected void readEntityFromNBT(NBTTagCompound var1) {} @Override protected void writeEntityToNBT(NBTTagCompound var1) {} }
-
How to trigger a Renderer (in a render file) from an event
Eastonium replied to Eastonium's topic in Modder Support
And where do I run the rendered from? -
Register your item that you have the entity throwable set to in your client proxy
-
I need to be able to render the Player Shadow. I have a RenderPlayerEvent handler set up like this: @SubscribeEvent public void renderShadow(RenderPlayerEvent.Post event) { if(event.entity.isInvisible()) { System.out.println("Event"); Entity entity = event.entity; entity.setInvisible(false); event.renderer.doRenderShadowAndFire(entity, event.entityPlayer.posX, event.entityPlayer.posY, event.entityPlayer.posZ, event.entityPlayer.rotationYaw, event.partialRenderTick); entity.setInvisible(true); } } I do get "Event" printed to the console, but I can't see my shadow. Help?
-
I already have. It's wayyyyy to complex of a system than what I need. I don't even know what to do when I look at his code...
-
So for my mod I am using my own Player Renderer, so that's not a problem. Currently I have been able to add a second weapon in the player's hand, but It only works in 3rd person. It doesn't show up in 1st person. Also, I can't get the player's left hand to rotate like it does when you're holding something. (Interesting thing there, there's already code for it in the model file.) But it won't work. public void doRenderCustom(AbstractClientPlayer par1AbstractClientPlayer, double par2, double par4, double par6, float par8, float par9) { if (MinecraftForge.EVENT_BUS.post(new RenderPlayerEvent.Pre(par1AbstractClientPlayer, this, par9))) return; GL11.glColor3f(1.0F, 1.0F, 1.0F); ItemStack itemstack = par1AbstractClientPlayer.inventory.getCurrentItem(); this.modelArmorChestplate.heldItemRight = this.modelArmor.heldItemRight = this.modelBipedMain.heldItemRight = itemstack != null ? 1 : 0; this.modelArmorChestplate.heldItemLeft = this.modelArmor.heldItemLeft = this.modelBipedMain.heldItemLeft = itemstack != null ? 1 : 0; if (itemstack != null && par1AbstractClientPlayer.getItemInUseCount() > 0) { EnumAction enumaction = itemstack.getItemUseAction(); if (enumaction == EnumAction.block) { this.modelArmorChestplate.heldItemRight = this.modelArmor.heldItemRight = this.modelBipedMain.heldItemRight = 3; } else if (enumaction == EnumAction.bow) { this.modelArmorChestplate.aimedBow = this.modelArmor.aimedBow = this.modelBipedMain.aimedBow = true; } } this.modelArmorChestplate.isSneak = this.modelArmor.isSneak = this.modelBipedMain.isSneak = par1AbstractClientPlayer.isSneaking(); double d3 = par4 - (double)par1AbstractClientPlayer.yOffset; if (par1AbstractClientPlayer.isSneaking() && !(par1AbstractClientPlayer instanceof EntityPlayerSP)) { d3 -= 0.125D; } super.doRender((EntityLivingBase)par1AbstractClientPlayer, par2, d3, par6, par8, par9); this.modelArmorChestplate.aimedBow = this.modelArmor.aimedBow = this.modelBipedMain.aimedBow = false; this.modelArmorChestplate.isSneak = this.modelArmor.isSneak = this.modelBipedMain.isSneak = false; this.modelArmorChestplate.heldItemRight = this.modelArmor.heldItemRight = this.modelBipedMain.heldItemRight = 0; this.modelArmorChestplate.heldItemLeft = this.modelArmor.heldItemLeft = this.modelBipedMain.heldItemLeft = 0; MinecraftForge.EVENT_BUS.post(new RenderPlayerEvent.Post(par1AbstractClientPlayer, this, par9)); } This is what I have in my Custom PlayerRender. The left hand never rotates upward. And for the 1st person part... I have no clue. this is what I have: public void renderFirstPersonArm(EntityPlayer par1EntityPlayer) { float f = 1.0F; GL11.glColor3f(f, f, f); this.modelBipedMain.onGround = 0.0F; this.modelBipedMain.setRotationAngles(0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, par1EntityPlayer); this.modelBipedMain.bipedRightArm.render(0.0625F); this.modelBipedMain.bipedLeftArm.render(0.0625F); } And the left hand is really low, and is hidden by the hotbar. ? I don' know why... Could someone help?
-
Bump
-
PlayerRenderEvent Rendering creeper powered effect (NOT 3D ARMOR)
Eastonium replied to Eastonium's topic in Modder Support
Bump