Merge branch '1.8' into 1.9.4

5b3284f Update jGui and ReplayStudio (fixes #33)
61d6fd4 Close replay file zip after recording (fixes #32)
00bcc9e Fix paths of files that are supposed to be in the mc data dir (fixes #40)
e6a789d Fix camera rotation when jumping in time (fixes #39)
50b53fc Add a way to register key bindings triggered every render tick (fixes #31)
a817c73 Prevent GUIs of other mods from opening during replay
d64ef8b Hide NPCs in the Player Overview GUI (fixes #29)
1f2c05e Fix spectating player entities past death and respawn (fixes #36)
ad2893b Fix vanilla bug caused by unremovable entities in the entityList of ClientWorld (fixes #29)
c934cb9 Fix spawn player packet being sent twice
6efbf91 Handle F1 properly while mouse is visible in the replay overlay (fixes #30)
9add2af Deselect keyframe when pressing "V" aka. sync timelines (fixes #27)
This commit is contained in:
johni0702
2016-11-29 22:32:03 +01:00
17 changed files with 168 additions and 27 deletions

View File

@@ -69,7 +69,11 @@ public class CameraEntity extends EntityPlayerSP {
public CameraEntity(Minecraft mcIn, World worldIn, NetHandlerPlayClient netHandlerPlayClient, StatisticsManager statisticsManager) {
super(mcIn, worldIn, netHandlerPlayClient, statisticsManager);
MinecraftForge.EVENT_BUS.register(eventHandler);
cameraController = ReplayModReplay.instance.createCameraController(this);
if (ReplayModReplay.instance.getReplayHandler().getSpectatedUUID() == null) {
cameraController = ReplayModReplay.instance.createCameraController(this);
} else {
cameraController = new SpectatorCameraController(this);
}
}
/**
@@ -151,7 +155,9 @@ public class CameraEntity extends EntityPlayerSP {
// This is important if the spectated player respawns as their
// entity is recreated and we have to spectate a new entity
UUID spectating = ReplayModReplay.instance.getReplayHandler().getSpectatedUUID();
if (spectating != null && (view.getUniqueID() != spectating || view.worldObj != worldObj)) {
if (spectating != null && (view.getUniqueID() != spectating
|| view.worldObj != worldObj)
|| worldObj.getEntityByID(view.getEntityId()) != view) {
view = worldObj.getPlayerEntityByUUID(spectating);
if (view != null) {
mc.setRenderViewEntity(view);
@@ -322,6 +328,12 @@ public class CameraEntity extends EntityPlayerSP {
return pos;
}
@Override
public void openGui(Object mod, int modGuiId, World world, int x, int y, int z) {
// Do not open any block GUIs for the camera entities
// Note: Vanilla GUIs are filtered out on a packet level, this only applies to mod GUIs
}
@Override
public void setDead() {
super.setDead();
@@ -394,7 +406,11 @@ public class CameraEntity extends EntityPlayerSP {
@SubscribeEvent
public void onSettingsChanged(SettingsChangedEvent event) {
if (event.getKey() == Setting.CAMERA) {
cameraController = ReplayModReplay.instance.createCameraController(CameraEntity.this);
if (ReplayModReplay.instance.getReplayHandler().getSpectatedUUID() == null) {
cameraController = ReplayModReplay.instance.createCameraController(CameraEntity.this);
} else {
cameraController = new SpectatorCameraController(CameraEntity.this);
}
}
}