Add camera movement

This commit is contained in:
johni0702
2015-11-07 17:43:02 +01:00
parent 6c93b7f0c6
commit c2686f5d34
11 changed files with 445 additions and 284 deletions

View File

@@ -1,6 +1,8 @@
package com.replaymod.replay;
import com.replaymod.core.utils.WrappedTimer;
import com.replaymod.replay.camera.CameraController;
import com.replaymod.replay.camera.CameraEntity;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.settings.GameSettings;
@@ -64,7 +66,21 @@ public class InputReplayTimer extends WrappedTimer {
int wheel = Mouse.getEventDWheel();
if (wheel != 0) {
// TODO: Update camera movement speed
ReplayHandler replayHandler = mod.getReplayHandler();
if (replayHandler != null) {
CameraEntity cameraEntity = replayHandler.getCameraEntity();
if (cameraEntity != null) {
CameraController controller = cameraEntity.getCameraController();
while (wheel > 0) {
controller.increaseSpeed();
wheel--;
}
while (wheel < 0) {
controller.decreaseSpeed();
wheel++;
}
}
}
}
if (mc.currentScreen == null) {