June 25, 201213 yr I think you can by using Java Reflections http://calclavia.com/uploads/banner.png[/img]
June 25, 201213 yr Java reflecting is a way to bypass class and security restrictions in java. It depends on 'what' you want to change as to whether reflections will work or not.
June 26, 201213 yr Author What I am wanting to change is part of the MovingObjectPosition package net.minecraft.src; public class MovingObjectPosition { /** What type of ray trace hit was this? 0 = block, 1 = entity */ public EnumMovingObjectType typeOfHit; /** x coordinate of the block ray traced against */ public int blockX; /** y coordinate of the block ray traced against */ public int blockY; /** z coordinate of the block ray traced against */ public int blockZ; /** * Which side was hit. If its -1 then it went the full length of the ray trace. Bottom = 0, Top = 1, East = 2, West * = 3, North = 4, South = 5. */ public int sideHit; /** The vector position of the hit */ public Vec3D hitVec; /** The hit entity */ public Entity entityHit; /** Used to determine what sub-segment is hit */ public int subHit = -1; public MovingObjectPosition(int par1, int par2, int par3, int par4, Vec3D par5Vec3D) { this.typeOfHit = EnumMovingObjectType.TILE; this.blockX = par1; this.blockY = par2; this.blockZ = par3; this.sideHit = par4; this.hitVec = Vec3D.createVector(par5Vec3D.xCoord, par5Vec3D.yCoord, par5Vec3D.zCoord); } public MovingObjectPosition(Entity par1Entity) { this.typeOfHit = EnumMovingObjectType.ENTITY; this.entityHit = par1Entity; this.hitVec = Vec3D.createVector(par1Entity.posX, par1Entity.posY, par1Entity.posZ); } } I want the line public Entity entityHit; to be public static Entity entityHit; Would that be possible?
June 26, 201213 yr What I am wanting to change is part of the MovingObjectPosition package net.minecraft.src; public class MovingObjectPosition { /** What type of ray trace hit was this? 0 = block, 1 = entity */ public EnumMovingObjectType typeOfHit; /** x coordinate of the block ray traced against */ public int blockX; /** y coordinate of the block ray traced against */ public int blockY; /** z coordinate of the block ray traced against */ public int blockZ; /** * Which side was hit. If its -1 then it went the full length of the ray trace. Bottom = 0, Top = 1, East = 2, West * = 3, North = 4, South = 5. */ public int sideHit; /** The vector position of the hit */ public Vec3D hitVec; /** The hit entity */ public Entity entityHit; /** Used to determine what sub-segment is hit */ public int subHit = -1; public MovingObjectPosition(int par1, int par2, int par3, int par4, Vec3D par5Vec3D) { this.typeOfHit = EnumMovingObjectType.TILE; this.blockX = par1; this.blockY = par2; this.blockZ = par3; this.sideHit = par4; this.hitVec = Vec3D.createVector(par5Vec3D.xCoord, par5Vec3D.yCoord, par5Vec3D.zCoord); } public MovingObjectPosition(Entity par1Entity) { this.typeOfHit = EnumMovingObjectType.ENTITY; this.entityHit = par1Entity; this.hitVec = Vec3D.createVector(par1Entity.posX, par1Entity.posY, par1Entity.posZ); } } I want the line public Entity entityHit; to be public static Entity entityHit; Would that be possible? Do you know exactly what static does... ?
June 26, 201213 yr Author No... and the code i was using gave me some unexpected results... so no longer need it
June 26, 201213 yr No... and the code i was using gave me some unexpected results... so no longer need it A bit of a tip here: You should put your code down. Go learn Java, make a few test programs, follow some tutorials, and then pick your code back up again.
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.