fix freecam
This commit is contained in:
parent
46858621ee
commit
8a72694a74
1 changed files with 7 additions and 5 deletions
|
@ -433,6 +433,7 @@ public class Client implements IThreadListener {
|
|||
public boolean fullscreen;
|
||||
public boolean interrupted;
|
||||
public boolean freecam;
|
||||
public boolean servercam;
|
||||
|
||||
private int leftClickCounter;
|
||||
private int rightClickTimer;
|
||||
|
@ -739,7 +740,7 @@ public class Client implements IThreadListener {
|
|||
this.debugWorld = false;
|
||||
this.charEditor = false;
|
||||
this.viewEntity = null;
|
||||
this.freecam = false;
|
||||
this.freecam = this.servercam = false;
|
||||
this.connection = null;
|
||||
this.world = null;
|
||||
this.resetWorld();
|
||||
|
@ -1647,7 +1648,7 @@ public class Client implements IThreadListener {
|
|||
{
|
||||
this.resetWorld();
|
||||
this.viewEntity = null;
|
||||
this.freecam = false;
|
||||
this.freecam = this.servercam = false;
|
||||
this.connection = null;
|
||||
this.soundManager.stopSounds();
|
||||
this.world = new WorldClient(dim);
|
||||
|
@ -1695,7 +1696,7 @@ public class Client implements IThreadListener {
|
|||
this.player = this.controller.createPlayerEntity(this.world, type);
|
||||
this.player.getDataWatcher().updateWatchedObjectsFromList(entityplayersp.getDataWatcher().getAllWatched());
|
||||
this.viewEntity = this.player;
|
||||
this.freecam = false;
|
||||
this.freecam = this.servercam = false;
|
||||
this.player.preparePlayerToSpawn();
|
||||
this.spawnEntity(this.player);
|
||||
this.player.rotYaw = -180.0F;
|
||||
|
@ -1756,6 +1757,7 @@ public class Client implements IThreadListener {
|
|||
{
|
||||
this.viewEntity = viewingEntity;
|
||||
this.freecam = false;
|
||||
this.servercam = viewingEntity != this.player;
|
||||
}
|
||||
|
||||
public void schedule(Runnable task) {
|
||||
|
@ -1844,7 +1846,7 @@ public class Client implements IThreadListener {
|
|||
if(this.viewEntity instanceof EntityCamera camera) {
|
||||
camera.onUpdate();
|
||||
camera.setMovement(this.moveStrafe, this.moveForward, this.jump, this.sneak);
|
||||
if(!this.freecam) {
|
||||
if(!this.freecam && this.servercam) {
|
||||
this.getNetHandler().addToSendQueue(new CPacketInput(this.moveStrafe, this.moveForward, this.jump, this.sneak, true));
|
||||
this.getNetHandler().addToSendQueue(new CPacketPlayerPosLook(camera.posX, camera.posY, camera.posZ, camera.rotYaw, camera.rotPitch, this.sprint).setCamera());
|
||||
if(this.player != null)
|
||||
|
@ -2736,7 +2738,7 @@ public class Client implements IThreadListener {
|
|||
if(Util.DEVMODE)
|
||||
this.registerDebug(Keysym.SPACE, "Kamera umschalten", new DebugRunner() {
|
||||
public void execute(Keysym key) {
|
||||
if(Client.this.world != null && Client.this.player != null) {
|
||||
if(Client.this.world != null && Client.this.player != null && !Client.this.servercam) {
|
||||
Client.this.viewEntity = Client.this.viewEntity == Client.this.player ? new EntityCamera(Client.this.world,
|
||||
Client.this.player.posX, Client.this.player.posY, Client.this.player.posZ, Client.this.player.rotYaw, Client.this.player.rotPitch, 256, 2.5f, CameraType.FREE, false) : Client.this.player;
|
||||
Client.this.freecam = Client.this.viewEntity != Client.this.player;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue