Jump to content

JeanMiecraft

Members
  • Posts

    16
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

JeanMiecraft's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. package net.mymod.entities.render; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.VertexBuffer; import net.minecraft.client.renderer.entity.Render; import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.client.renderer.vertex.DefaultVertexFormats; import net.minecraft.entity.projectile.EntityFishHook; import net.minecraft.util.EnumHandSide; import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.Vec3d; import net.mymod.Minecraft_mod; import net.mymod.entities.EntityHook; public class RendeHook extends Render<EntityHook> { private static final ResourceLocation HOOK_PARTICLES = new ResourceLocation(Minecraft_mod.MOD_ID + ":textures/particles/particles.png"); public RenderHook(RenderManager renderManagerIn) { super(renderManagerIn); } public void doRender(EntityHook entity, double x, double y, double z, float entityYaw, float partialTicks) { GlStateManager.pushMatrix(); GlStateManager.translate((float)x, (float)y, (float)z); GlStateManager.enableRescaleNormal(); GlStateManager.scale(0.5F, 0.5F, 0.5F); this.bindEntityTexture(entity); Tessellator tessellator = Tessellator.getInstance(); VertexBuffer vertexbuffer = tessellator.getBuffer(); int i = 1; int j = 2; float f = 0.0625F; float f1 = 0.125F; float f2 = 0.125F; float f3 = 0.1875F; float f4 = 1.0F; float f5 = 0.5F; float f6 = 0.5F; GlStateManager.rotate(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); GlStateManager.rotate((float)(this.renderManager.options.thirdPersonView == 2 ? -1 : 1) * -this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F); if (this.renderOutlines) { GlStateManager.enableColorMaterial(); GlStateManager.enableOutlineMode(this.getTeamColor(entity)); } vertexbuffer.begin(7, DefaultVertexFormats.POSITION_TEX_NORMAL); vertexbuffer.pos(-0.5D, -0.5D, 0.0D).tex(0.0625D, 0.1875D).normal(0.0F, 1.0F, 0.0F).endVertex(); vertexbuffer.pos(0.5D, -0.5D, 0.0D).tex(0.125D, 0.1875D).normal(0.0F, 1.0F, 0.0F).endVertex(); vertexbuffer.pos(0.5D, 0.5D, 0.0D).tex(0.125D, 0.125D).normal(0.0F, 1.0F, 0.0F).endVertex(); vertexbuffer.pos(-0.5D, 0.5D, 0.0D).tex(0.0625D, 0.125D).normal(0.0F, 1.0F, 0.0F).endVertex(); tessellator.draw(); if (this.renderOutlines) { GlStateManager.disableOutlineMode(); GlStateManager.disableColorMaterial(); } GlStateManager.disableRescaleNormal(); GlStateManager.popMatrix(); if (entity.angler != null && !this.renderOutlines) { int k = entity.angler.getPrimaryHand() == EnumHandSide.RIGHT ? 1 : -1; float f7 = entity.angler.getSwingProgress(partialTicks); float f8 = MathHelper.sin(MathHelper.sqrt_float(f7) * (float)Math.PI); float f9 = (entity.angler.prevRenderYawOffset + (entity.angler.renderYawOffset - entity.angler.prevRenderYawOffset) * partialTicks) * 0.017453292F; double d0 = (double)MathHelper.sin(f9); double d1 = (double)MathHelper.cos(f9); double d2 = (double)k * 0.35D; double d3 = 0.8D; double d4; double d5; double d6; double d7; if ((this.renderManager.options == null || this.renderManager.options.thirdPersonView <= 0) && entity.angler == Minecraft.getMinecraft().thePlayer) { Vec3d vec3d = new Vec3d((double)k * -0.36D, -0.05D, 0.4D); vec3d = vec3d.rotatePitch(-(entity.angler.prevRotationPitch + (entity.angler.rotationPitch - entity.angler.prevRotationPitch) * partialTicks) * 0.017453292F); vec3d = vec3d.rotateYaw(-(entity.angler.prevRotationYaw + (entity.angler.rotationYaw - entity.angler.prevRotationYaw) * partialTicks) * 0.017453292F); vec3d = vec3d.rotateYaw(f8 * 0.5F); vec3d = vec3d.rotatePitch(-f8 * 0.7F); d4 = entity.angler.prevPosX + (entity.angler.posX - entity.angler.prevPosX) * (double)partialTicks + vec3d.xCoord; d5 = entity.angler.prevPosY + (entity.angler.posY - entity.angler.prevPosY) * (double)partialTicks + vec3d.yCoord; d6 = entity.angler.prevPosZ + (entity.angler.posZ - entity.angler.prevPosZ) * (double)partialTicks + vec3d.zCoord; d7 = (double)entity.angler.getEyeHeight(); } else { d4 = entity.angler.prevPosX + (entity.angler.posX - entity.angler.prevPosX) * (double)partialTicks - d1 * d2 - d0 * 0.8D; d5 = entity.angler.prevPosY + (double)entity.angler.getEyeHeight() + (entity.angler.posY - entity.angler.prevPosY) * (double)partialTicks - 0.45D; d6 = entity.angler.prevPosZ + (entity.angler.posZ - entity.angler.prevPosZ) * (double)partialTicks - d0 * d2 + d1 * 0.8D; d7 = entity.angler.isSneaking() ? -0.1875D : 0.0D; } double d13 = entity.prevPosX + (entity.posX - entity.prevPosX) * (double)partialTicks; double d8 = entity.prevPosY + (entity.posY - entity.prevPosY) * (double)partialTicks + 0.25D; double d9 = entity.prevPosZ + (entity.posZ - entity.prevPosZ) * (double)partialTicks; double d10 = (double)((float)(d4 - d13)); double d11 = (double)((float)(d5 - d8)) + d7; double d12 = (double)((float)(d6 - d9)); GlStateManager.disableTexture2D(); GlStateManager.disableLighting(); vertexbuffer.begin(3, DefaultVertexFormats.POSITION_COLOR); int l = 16; for (int i1 = 0; i1 <= 16; ++i1) { float f10 = (float)i1 / 16.0F; vertexbuffer.pos(x + d10 * (double)f10, y + d11 * (double)(f10 * f10 + f10) * 0.5D + 0.25D, z + d12 * (double)f10).color(0, 0, 0, 255).endVertex(); } tessellator.draw(); GlStateManager.enableLighting(); GlStateManager.enableTexture2D(); super.doRender(entity, x, y, z, entityYaw, partialTicks); } } protected ResourceLocation getEntityTexture(EntityHook entity) { return HOOK_PARTICLES; } } Hello, this is my code for the render! - JM.
  2. Hello, sorry for take a lot of time for this answer but with my school, I can see this topic the week-end only... I had copy the RenderFish, the hook is apparea but the wire don't exist... It's possible to create a wire with an another method? Tank you.
  3. Hi, I created the tool, if the player right click, it cast and uncast according to the mod. But the problem is the render of the wire. I searched in the vanilla code but I didn't found them. How I can create this wire render? - JM
  4. Hello, I would like create a tool look like ItemFishHook but my problem is the wire. How I can create this render? Thank you for your help. - JM
  5. In your ClientProxy, you can replace by that: @Override public void registerFluid(Block block, String name) { final ModelResourceLocation location = new ModelResourceLocation(MOD_ID + ":" + name, "fluid"); ModelLoader.setCustomStateMapper(block, new StateMapperBase() { @Override protected ModelResourceLocation getModelResourceLocation(IBlockState state) { return location; } }); }
  6. No, it is the swimming... The problem maintaining, it is to apply this method when the entity jumps or if the player presses the space key...
  7. We can "swim" in lava too. Okay, I understand... but it's possible to recreate with a event the swimming effect and the entity can move? I want my custom material because with the Material.WATER or Material.LAVA, there are secondary effects... Thank you for your help!
  8. Okay, hum... in my fluid I use: public static void registry() { ClassMod.FLUID = Fluid.instance; FluidRegistry.registerFluid(ClassMod.FLUID); ClassMod.FLUID_BLOCK = registerFluidBlock(fluid, new BlockFluid(ClassMod.FLUID), "fluid"); ClassMod.FLUID_BUCKET = registerBucket((new ItemBucket(ClassMod.FLUID_BLOCK)).setContainerItem(Items.BUCKET), "bucket_fluid").setCreativeTab(CREATIVETAB); } private static Item registerBucket(Item setContainerItem, String name) { setContainerItem.setUnlocalizedName(name); setContainerItem.setRegistryName(name); GameRegistry.register(setContainerItem); return setContainerItem; } public static Block registerFluidBlock(Fluid fluid, Block fluidBlock, String name) { Block block = GameRegistry.register(fluidBlock, new ResourceLocation(Minecraft_mod.MOD_ID, name)); ClassMod.proxy.registerFluidBlockRendering(block, name); fluid.setBlock(fluidBlock); return block; } I do not really understand why this does not work in your code but it maybe due to incompatibility... You can use that, but I no sure if it will work... - JM
  9. Hello... Thank you for this answer! I see, this method is in the PathNavigate, in the PathNavigateGround and in the PathNavigateSwimmer... In the EntityAISwimming, I found that: ((PathNavigateGround)entitylivingIn.getNavigator()).setCanSwim(true); The "getNavigator" is register in the EntityLiving. It's possible to change the boolean value if an entity is in my fluid? If yes, where I can place this method?
  10. Hello, your fluid has the water's texture?
  11. Hello, no this isn't resolved but with the help, I modified the respiration in the liquid. With that, I add to my fluid the finishes as the drown and the bubbles. Now the problem is the entity's motionY when she jump and the water or lava movement for the player. In the EntityLivingBase for the entity I compare the levitation potion but it's doesn't work... Can you tell me where is the class with the swimming for the entities and the player please. It's very important for me! - JM
  12. Hello, in your clientproxy, you must to add this: ClientRegistry.bindTileEntitySpecialRenderer(TileEntity.class, new TileEntityRenderer()); - JM
  13. Ah yes there are a little forgetfulness for my part... I corrige that. For the version, I use forge 1.9.4 because for mi the newest version: 1.10, 1.11 and 1.12 don't work...
  14. For the player, I use this: Minecraft mc = Minecraft.getMinecraft(); boolean jump = mc.gameSettings.keyBindJump.isKeyDown(); if (jump == true) { entity.motionY = 0.10000001192092896D; } The problem for the player is the speed, it's possible to slow down look like the slowness potion? And for the other EntityLiving, I don't know because if I use: entity.motionY = 0.10000001192092896D; It work, but they can't move. For example, if I have in my hand a carrot and the entity in my custom fluid is a pig. The motionX and motionZ equal 0; Thank you for your answer! - JM
×
×
  • Create New...

Important Information

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