Fixed player falling from camera
This commit is contained in:
parent
40f40978f8
commit
ce2eaa08b5
1 changed files with 26 additions and 1 deletions
|
@ -7,6 +7,7 @@ import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
import net.minecraft.util.AxisAlignedBB;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import org.lwjgl.input.Keyboard;
|
import org.lwjgl.input.Keyboard;
|
||||||
|
@ -49,6 +50,7 @@ public final class EntityCamera extends EntityLivingBase {
|
||||||
cameraY = y;
|
cameraY = y;
|
||||||
cameraZ = z;
|
cameraZ = z;
|
||||||
this.player = player;
|
this.player = player;
|
||||||
|
noClip = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void closeCamera() {
|
private void closeCamera() {
|
||||||
|
@ -143,7 +145,7 @@ public final class EntityCamera extends EntityLivingBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isCentered) {
|
if (isCentered) {
|
||||||
setPosition(cameraX + 0.5D, cameraY + 0.75D, cameraZ + 0.5D);
|
setPosition(cameraX + 0.5D, cameraY + 0.5D, cameraZ + 0.5D);
|
||||||
} else {
|
} else {
|
||||||
setPosition(cameraX + dx, cameraY + dy, cameraZ + dz);
|
setPosition(cameraX + dx, cameraY + dy, cameraZ + dz);
|
||||||
}
|
}
|
||||||
|
@ -161,6 +163,29 @@ public final class EntityCamera extends EntityLivingBase {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
// Item no clip
|
||||||
|
@Override
|
||||||
|
protected boolean func_145771_j(double par1, double par3, double par5) {
|
||||||
|
// Clipping is fine, don't move me
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
/**/
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AxisAlignedBB getBoundingBox() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canBePushed() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void moveEntity(double x, double y, double z) {
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void readEntityFromNBT(NBTTagCompound nbttagcompound) {
|
public void readEntityFromNBT(NBTTagCompound nbttagcompound) {
|
||||||
// nothing to save, skip ancestor call
|
// nothing to save, skip ancestor call
|
||||||
|
|
Loading…
Reference in a new issue