Jump to content

Recommended Posts

Posted

So I decompiled a mod to get the entity bullet and I can't figure out what one of the fields is. Field: field_70170_p

Here is the code:

 

package com.gunmod.masterminer.entity;

 

import java.util.Random;

import net.minecraft.block.Block;

import net.minecraft.block.material.Material;

import net.minecraft.entity.Entity;

import net.minecraft.entity.player.EntityPlayer;

import net.minecraft.entity.projectile.EntityThrowable;

import net.minecraft.init.Blocks;

import net.minecraft.util.DamageSource;

import net.minecraft.util.MathHelper;

import net.minecraft.util.MovingObjectPosition;

import net.minecraft.world.World;

 

public class EntityBullet

  extends EntityThrowable

{

  private int bulletdamage;

  public Entity shootingEntity;

 

  public EntityBullet(World par1World)

  {

    super(par1World);

    setSize(0.1F, 0.1F);

  }

 

  public EntityBullet(World par1World, EntityPlayer par2EntityLiving, int damage)

  {

    super(par1World, par2EntityLiving);

    this.bulletdamage = damage;

   

    this.shootingEntity = par2EntityLiving;

    setSize(0.5F, 0.5F);

    setLocationAndAngles(par2EntityLiving.posX, par2EntityLiving.posY + par2EntityLiving.getEyeHeight(), par2EntityLiving.posZ, par2EntityLiving.rotationYaw, par2EntityLiving.rotationPitch);

    this.posX -= MathHelper.cos(this.rotationYaw / 180.0F * 3.141593F) * 0.16F;

    this.posY -= 0.1000000014901161D;

    this.posZ -= MathHelper.sin(this.rotationYaw / 180.0F * 3.141593F) * 0.16F;

    setPosition(this.posX, this.posY, this.posZ);

    this.yOffset = 0.0F;

    this.motionX = (-MathHelper.sin(this.rotationYaw / 180.0F * 3.141593F) * MathHelper.cos(this.rotationPitch / 180.0F * 3.141593F));

    this.motionZ = (MathHelper.cos(this.rotationYaw / 180.0F * 3.141593F) * MathHelper.cos(this.rotationPitch / 180.0F * 3.141593F));

    this.motionY = (-MathHelper.sin(this.rotationPitch / 180.0F * 3.141593F));

    setThrowableHeading(this.motionX, this.motionY, this.motionZ, 1.5F, 1.0F);

  }

 

  public EntityBullet(World par1World, double par2, double par4, double par6)

  {

    super(par1World, par2, par4, par6);

  }

 

  protected float func_70185_h()

  {

    return 0.001F;

  }

 

  public void func_70016_h(double par1, double par3, double par5)

  {

    this.motionX = par1;

    this.motionY = par3;

    this.motionZ = par5;

    if ((this.prevRotationPitch == 0.0F) && (this.prevRotationYaw == 0.0F))

    {

      float f = MathHelper.sqrt_double(par1 * par1 + par5 * par5);

      this.prevRotationYaw = (this.rotationYaw = (float)(Math.atan2(par1, par5) * 180.0D / 3.141592653589793D));

      this.prevRotationPitch = (this.rotationPitch = (float)(Math.atan2(par3, f) * 180.0D / 3.141592653589793D));

      this.prevRotationPitch = this.rotationPitch;

      this.prevRotationYaw = this.rotationYaw;

      setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch);

    }

  }

 

  public void setArrowHeading(double par1, double par3, double par5, float par7, float par8)

  {

    float f = MathHelper.sqrt_double(par1 * par1 + par3 * par3 + par5 * par5);

    par1 /= f;

    par3 /= f;

    par5 /= f;

    par1 += this.rand.nextGaussian() * 0.007499999832361937D * par8;

    par3 += this.rand.nextGaussian() * 0.007499999832361937D * par8;

    par5 += this.rand.nextGaussian() * 0.007499999832361937D * par8;

    par1 *= par7;

    par3 *= par7;

    par5 *= par7;

    this.motionX = par1;

    this.motionY = par3;

    this.motionZ = par5;

    float f1 = MathHelper.sqrt_double(par1 * par1 + par5 * par5);

    this.prevRotationYaw = (this.rotationYaw = (float)(Math.atan2(par1, par5) * 180.0D / 3.141592653589793D));

    this.prevRotationPitch = (this.rotationPitch = (float)(Math.atan2(par3, f1) * 180.0D / 3.141592653589793D));

  }

 

  protected void func_70184_a(MovingObjectPosition par1MovingObjectPosition)

  {

    if (par1MovingObjectPosition.entityHit != null)

    {

      int var2 = this.bulletdamage;

      if (!par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, getThrower()), var2)) {}

    }

    if ((this.field_70170_p.getBlock(par1MovingObjectPosition.field_72311_b, par1MovingObjectPosition.field_72312_c, par1MovingObjectPosition.field_72309_d) == Blocks.field_150359_w) || (this.field_70170_p.func_147439_a(par1MovingObjectPosition.field_72311_b, par1MovingObjectPosition.field_72312_c, par1MovingObjectPosition.field_72309_d) == Blocks.field_150410_aZ) || (this.field_70170_p.func_147439_a(par1MovingObjectPosition.field_72311_b, par1MovingObjectPosition.field_72312_c, par1MovingObjectPosition.field_72309_d) == Blocks.field_150426_aN) || (this.field_70170_p.func_147439_a(par1MovingObjectPosition.field_72311_b, par1MovingObjectPosition.field_72312_c, par1MovingObjectPosition.field_72309_d) == Blocks.field_150399_cn) || (this.field_70170_p.func_147439_a(par1MovingObjectPosition.field_72311_b, par1MovingObjectPosition.field_72312_c, par1MovingObjectPosition.field_72309_d) == Blocks.field_150397_co))

    {

      this.field_70170_p.setBlock(par1MovingObjectPosition.field_72311_b, par1MovingObjectPosition.field_72312_c, par1MovingObjectPosition.field_72309_d, Blocks.field_150350_a);

      this.field_70170_p.getBlock(this, "random.glass", 1.0F, 1.0F);

    }

    if ((this.field_70170_p.func_147439_a(par1MovingObjectPosition.field_72311_b, par1MovingObjectPosition.field_72312_c, par1MovingObjectPosition.field_72309_d).func_149688_o() != Material.field_151576_e) || (

   

 

 

 

      (!this.field_70170_p.field_72995_K) && (this.field_70170_p.getBlock(par1MovingObjectPosition.field_72311_b, par1MovingObjectPosition.field_72312_c, par1MovingObjectPosition.field_72309_d) != Blocks.field_150329_H) && (this.field_70170_p.getBlock(par1MovingObjectPosition.field_72311_b, par1MovingObjectPosition.field_72312_c, par1MovingObjectPosition.field_72309_d) != Blocks.field_150398_cm))) {

      setDead();

    }

  }

}

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I tried do download the essential mod to my mod pack but i didnt work. I paly on 1.21 and it should work. I use neoforge for my modding. The weird things is my friend somehow added the mod to his modpack and many others that I somehow can´t. Is there anything i can do? 
    • Thanks, I've now installed a slightly newer version and the server is at least starting up now.
    • i have the same issue. Found 1 Create mod class dependency(ies) in createdeco-1.3.3-1.19.2.jar, which are missing from the current create-1.19.2-0.5.1.i.jar Found 11 Create mod class dependency(ies) in createaddition-fabric+1.19.2-20230723a.jar, which are missing from the current create-1.19.2-0.5.1.i.jar Detailed walkthrough of mods which rely on missing Create mod classes: Mod: createaddition-fabric+1.19.2-20230723a.jar Missing classes of create: com/simibubi/create/compat/jei/category/sequencedAssembly/JeiSequencedAssemblySubCategory com/simibubi/create/compat/recipeViewerCommon/SequencedAssemblySubCategoryType com/simibubi/create/compat/rei/CreateREI com/simibubi/create/compat/rei/EmptyBackground com/simibubi/create/compat/rei/ItemIcon com/simibubi/create/compat/rei/category/CreateRecipeCategory com/simibubi/create/compat/rei/category/WidgetUtil com/simibubi/create/compat/rei/category/animations/AnimatedBlazeBurner com/simibubi/create/compat/rei/category/animations/AnimatedKinetics com/simibubi/create/compat/rei/category/sequencedAssembly/ReiSequencedAssemblySubCategory com/simibubi/create/compat/rei/display/CreateDisplay Mod: createdeco-1.3.3-1.19.2.jar Missing classes of create: com/simibubi/create/content/kinetics/fan/SplashingRecipe
    • The crash points to moonlight lib - try other builds or make a test without this mod and the mods requiring it
    • Do you have shaders enabled? There is an issue with the mod simpleclouds - remove this mod or disable shaders, if enabled  
  • Topics

×
×
  • Create New...

Important Information

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