Created
May 22, 2015 21:45
-
-
Save StillManic/ca17145540a4bb15b677 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class EntityPassenger extends EntityLivingBase { | |
public EntityLivingBase player = this; | |
public static RCKeyBinding[] rcKeys; | |
public EntityPassenger(World world, RCKeyBinding[] rcKeys) { | |
super(world); | |
width = 0; | |
height = 0; | |
} | |
@Override | |
public void entityInit() {} | |
@Override | |
public void onUpdate() { | |
super.onUpdate(); | |
// Vec3 look = this.getLook(1.0F).normalize(); | |
// | |
// Vec3 worldUp = Vec3.createVectorHelper(0, 1, 0); | |
// Vec3 side = worldUp.crossProduct(look).normalize(); | |
// Vec3 forward = side.crossProduct(worldUp).normalize(); | |
// | |
// motionX = 0; | |
// motionY = 0; | |
// motionZ = 0; | |
// | |
//// if (Keyboard.isKeyDown(Minecraft.getMinecraft().gameSettings.keyBindSneak.getKeyCode())) { | |
//// | |
//// } | |
// | |
// int dx = Mouse.getDX(); | |
// int dy = Mouse.getDY(); | |
// | |
// boolean leftButtonDown = Mouse.isButtonDown(0); | |
// boolean rightButtonDown = Mouse.isButtonDown(1); | |
// boolean middleButtonDown = Mouse.isButtonDown(2); | |
// | |
// int speed = 10; | |
// | |
// if (!isMouseOverAButton()) { | |
// if (leftButtonDown || middleButtonDown) { | |
// setAngles(dx * speed, dy * speed); | |
// } | |
// } | |
// | |
// super.onUpdate(); | |
} | |
private boolean isMouseOverAButton() { | |
return false; | |
} | |
public MovingObjectPosition rayTraceMouse() { | |
double distance = 1000; | |
Vec3 localPos = this.getPosition(1.0F); | |
Vec3 look = this.getLook(1.0F).normalize(); | |
localPos.xCoord += RenderWorldLast.diffX; | |
localPos.yCoord += RenderWorldLast.diffY; | |
localPos.zCoord += RenderWorldLast.diffZ; | |
Vec3 vec32 = localPos.addVector(look.xCoord * distance, look.yCoord * distance, look.zCoord * distance); | |
MovingObjectPosition result = this.worldObj.rayTraceBlocks(localPos, vec32); | |
return result; | |
} | |
@Override | |
public ItemStack getHeldItem() { | |
return null; | |
} | |
@Override | |
public ItemStack getEquipmentInSlot(int slot) { | |
return null; | |
} | |
@Override | |
public void setCurrentItemOrArmor(int slot, ItemStack itemStack) {} | |
@Override | |
public ItemStack[] getLastActiveItems() { | |
return new ItemStack[0]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment