diff --git a/gradle.properties b/gradle.properties
index c135d3d1..2aad3317 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -16,5 +16,5 @@ mod_email=scribble@minecrafttas.com
# TASmod properties
group=com.minecrafttas
artifact=TASmod-1.12.2
-version=Beta1.0
+version=Beta1.1
release=false
diff --git a/src/main/java/com/minecrafttas/mctcommon/events/EventClient.java b/src/main/java/com/minecrafttas/mctcommon/events/EventClient.java
index 3a265f92..1f7a4497 100644
--- a/src/main/java/com/minecrafttas/mctcommon/events/EventClient.java
+++ b/src/main/java/com/minecrafttas/mctcommon/events/EventClient.java
@@ -62,22 +62,20 @@ public static interface EventDoneLoadingWorld extends EventBase {
}
/**
- * Fired when the player is done loading, after the position has been loaded from the server side.
- * This also fires every time the player switches dimensions.
+ * Fired when the server sends a packet to the client telling him to set the position
*
* @author Scribble
* @see NetHandlerPlayClient#handlePlayerPosLook(net.minecraft.network.play.server.SPacketPlayerPosLook)
*/
@FunctionalInterface
- public static interface EventDoneLoadingPlayer extends EventBase {
+ public static interface EventSetCameraAngle extends EventBase {
/**
- * Fired when the player is done loading, after the position has been loaded from the server side.
- * This also fires every time the player switches dimensions.
+ * Fired when the server sends a packet to the client telling him to set the position
*
* @see NetHandlerPlayClient#handlePlayerPosLook(net.minecraft.network.play.server.SPacketPlayerPosLook)
*/
- public void onDoneLoadingPlayer();
+ public void onSetCameraAngle();
}
/**
diff --git a/src/main/java/com/minecrafttas/tasmod/handlers/LoadingScreenHandler.java b/src/main/java/com/minecrafttas/tasmod/handlers/LoadingScreenHandler.java
index 0e174bd1..add325d1 100644
--- a/src/main/java/com/minecrafttas/tasmod/handlers/LoadingScreenHandler.java
+++ b/src/main/java/com/minecrafttas/tasmod/handlers/LoadingScreenHandler.java
@@ -3,11 +3,11 @@
import static com.minecrafttas.tasmod.TASmod.LOGGER;
import com.minecrafttas.mctcommon.events.EventClient.EventClientGameLoop;
-import com.minecrafttas.mctcommon.events.EventClient.EventDoneLoadingPlayer;
import com.minecrafttas.mctcommon.events.EventClient.EventDoneLoadingWorld;
import com.minecrafttas.mctcommon.events.EventClient.EventLaunchIntegratedServer;
import com.minecrafttas.mctcommon.events.EventClient.EventPlayerJoinedClientSide;
import com.minecrafttas.mctcommon.events.EventClient.EventPlayerLeaveClientSide;
+import com.minecrafttas.mctcommon.events.EventClient.EventSetCameraAngle;
import com.minecrafttas.tasmod.TASmod;
import com.minecrafttas.tasmod.TASmodClient;
import com.minecrafttas.tasmod.playback.PlaybackControllerClient;
@@ -22,7 +22,7 @@
*
* @author Scribble
*/
-public class LoadingScreenHandler implements EventLaunchIntegratedServer, EventClientGameLoop, EventDoneLoadingWorld, EventDoneLoadingPlayer, EventPlayerJoinedClientSide, EventPlayerLeaveClientSide {
+public class LoadingScreenHandler implements EventLaunchIntegratedServer, EventClientGameLoop, EventDoneLoadingWorld, EventSetCameraAngle, EventPlayerJoinedClientSide, EventPlayerLeaveClientSide {
private boolean waszero;
private boolean isLoading;
@@ -80,15 +80,12 @@ public boolean isLoading() {
*
Initializes the virtual camera to be in line with the vanilla camera. */ @Override - public void onDoneLoadingPlayer() { - LOGGER.debug(LoggerMarkers.Event, "Finished loading the player position on the client"); + public void onSetCameraAngle() { + LOGGER.debug(LoggerMarkers.Event, "Setting the camera angle"); VirtualCameraAngleInput cameraAngle = TASmodClient.virtual.CAMERA_ANGLE; - if (cameraAngle.getCurrentPitch() == null || cameraAngle.getCurrentYaw() == null) { - LOGGER.debug("Setting the initial pitch and yaw"); - Minecraft mc = Minecraft.getMinecraft(); - EntityPlayerSP player = mc.player; - cameraAngle.setCamera(player.rotationPitch, player.rotationYaw); - } + Minecraft mc = Minecraft.getMinecraft(); + EntityPlayerSP player = mc.player; + cameraAngle.setCamera(player.rotationPitch, player.rotationYaw); } /** @@ -105,7 +102,7 @@ public void onPlayerJoinedClientSide(EntityPlayerSP player) { * {@inheritDoc} * *
Resets the camera angle when leaving the world. - *
If you later rejoin the world {@link #onDoneLoadingPlayer()} will re-initialise the camera angle + *
If you later rejoin the world {@link #onSetCameraAngle()} will re-initialise the camera angle */ @Override public void onPlayerLeaveClientSide(EntityPlayerSP player) { diff --git a/src/main/java/com/minecrafttas/tasmod/mixin/events/MixinNetHandlerPlayClient.java b/src/main/java/com/minecrafttas/tasmod/mixin/events/MixinNetHandlerPlayClient.java index c11ed085..1fd1cbd7 100644 --- a/src/main/java/com/minecrafttas/tasmod/mixin/events/MixinNetHandlerPlayClient.java +++ b/src/main/java/com/minecrafttas/tasmod/mixin/events/MixinNetHandlerPlayClient.java @@ -5,7 +5,7 @@ import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -import com.minecrafttas.mctcommon.events.EventClient.EventDoneLoadingPlayer; +import com.minecrafttas.mctcommon.events.EventClient.EventSetCameraAngle; import com.minecrafttas.mctcommon.events.EventListenerRegistry; import net.minecraft.client.network.NetHandlerPlayClient; @@ -13,8 +13,8 @@ @Mixin(NetHandlerPlayClient.class) public class MixinNetHandlerPlayClient { - @Inject(method = "handlePlayerPosLook", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/Minecraft;displayGuiScreen(Lnet/minecraft/client/gui/GuiScreen;)V")) + @Inject(method = "handlePlayerPosLook", at = @At(value = "RETURN")) public void event_handlePlayerPosLook(CallbackInfo ci) { - EventListenerRegistry.fireEvent(EventDoneLoadingPlayer.class); + EventListenerRegistry.fireEvent(EventSetCameraAngle.class); } }