mirror of
https://github.com/Sollace/Unicopia.git
synced 2025-02-01 19:46:42 +01:00
Fixed some mechanics not taking spectator mode into account
This commit is contained in:
parent
b4443e0549
commit
fab5363028
2 changed files with 10 additions and 4 deletions
|
@ -25,6 +25,10 @@ public class UHud extends DrawableHelper {
|
|||
|
||||
public void render(InGameHud hud, float tickDelta) {
|
||||
|
||||
if (client.player == null || client.player.isSpectator()) {
|
||||
return;
|
||||
}
|
||||
|
||||
int scaledWidth = client.getWindow().getScaledWidth();
|
||||
int scaledHeight = client.getWindow().getScaledHeight();
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ public class PlayerPhysics extends EntityPhysics<Pony> implements Tickable, Moti
|
|||
}
|
||||
|
||||
private boolean checkCanFly() {
|
||||
if (pony.getOwner().abilities.creativeMode) {
|
||||
if (pony.getOwner().abilities.creativeMode || pony.getOwner().isSpectator()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -100,15 +100,17 @@ public class PlayerPhysics extends EntityPhysics<Pony> implements Tickable, Moti
|
|||
}
|
||||
}
|
||||
|
||||
boolean creative = entity.abilities.creativeMode || pony.getOwner().isSpectator();
|
||||
|
||||
entity.abilities.allowFlying = checkCanFly();
|
||||
|
||||
if (!entity.abilities.creativeMode) {
|
||||
if (!creative) {
|
||||
entity.abilities.flying |= entity.abilities.allowFlying && isFlying && !entity.onGround && !entity.isTouchingWater();
|
||||
}
|
||||
|
||||
isFlying = entity.abilities.flying && !entity.abilities.creativeMode;
|
||||
isFlying = entity.abilities.flying && !creative;
|
||||
|
||||
if (!entity.abilities.creativeMode && !entity.isFallFlying()) {
|
||||
if (!creative && !entity.isFallFlying()) {
|
||||
if (isFlying && !entity.hasVehicle()) {
|
||||
|
||||
if (!isRainbooming && getHorizontalMotion(entity) > 0.2 && flightExperience < MAXIMUM_FLIGHT_EXPERIENCE) {
|
||||
|
|
Loading…
Reference in a new issue