├── .gitattributes ├── .gitignore ├── .gitmodules ├── Jenkinsfile ├── LICENSE.md ├── README.md ├── build.gradle ├── docs ├── .gitignore ├── README.md ├── build.js ├── content.md ├── img │ ├── ambient-lighting-comparison.jpg │ ├── ambient-lighting-comparison.png │ ├── asset-manager.jpg │ ├── asset-manager.png │ ├── auth-login.jpg │ ├── auth-login.png │ ├── auth-register.jpg │ ├── auth-register.png │ ├── camera-tilted.jpg │ ├── camera-tilted.png │ ├── chromasky.jpg │ ├── chromasky.png │ ├── cubic-path.gif │ ├── cubic-path.webm │ ├── custom-object-animated.gif │ ├── custom-object-animated.webm │ ├── default-thumb.jpg │ ├── depthmapsuzanne.jpg │ ├── depthmapsuzanne.png │ ├── eyecon.jpg │ ├── eyecon.png │ ├── ffmpeg-missing.jpg │ ├── ffmpeg-missing.png │ ├── keyframe-editor.jpg │ ├── keyframe-editor.png │ ├── keyframe-repository.jpg │ ├── keyframe-repository.png │ ├── keyframe-timeline.jpg │ ├── keyframe-timeline.png │ ├── linear-path.gif │ ├── linear-path.webm │ ├── marker-timeline.jpg │ ├── marker-timeline.png │ ├── multimc-addempty.jpg │ ├── multimc-addempty.png │ ├── mutlimc-liteloader.jpg │ ├── mutlimc-liteloader.png │ ├── object-manager.jpg │ ├── object-manager.png │ ├── path-preview-icon.jpg │ ├── path-preview-icon.png │ ├── path-preview-spectator.jpg │ ├── path-preview-spectator.png │ ├── path-preview.jpg │ ├── path-preview.png │ ├── player-overview.jpg │ ├── player-overview.png │ ├── position-keyframe-button.png │ ├── quality-comparison.jpg │ ├── quality-comparison.png │ ├── quickmode-icon.jpg │ ├── quickmode-icon.png │ ├── real-timeline.jpg │ ├── real-timeline.png │ ├── recording-indicator.jpg │ ├── recording-indicator.png │ ├── render-cubic.jpg │ ├── render-cubic.png │ ├── render-default.jpg │ ├── render-default.png │ ├── render-equirectangular.jpg │ ├── render-equirectangular.png │ ├── render-stereoscopic.jpg │ ├── render-stereoscopic.png │ ├── rendering-screen.jpg │ ├── rendering-screen.png │ ├── rendersettings-advanced.jpg │ ├── rendersettings-advanced.png │ ├── rendersettings-commandline.jpg │ ├── rendersettings-commandline.png │ ├── rendersettings-video.jpg │ ├── rendersettings-video.png │ ├── replay-center.jpg │ ├── replay-center.png │ ├── replay-upload.jpg │ ├── replay-upload.png │ ├── replay-viewer.jpg │ ├── replay-viewer.png │ ├── spectator-keyframe-button.png │ └── time-keyframe-button.png ├── package-lock.json ├── package.json └── template.html ├── ffmpeg-install-scripts ├── ffmpeg-path-installer.bat └── ffmpeg-path-installer.sh ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── src └── main │ ├── java │ └── com │ │ └── replaymod │ │ ├── compat │ │ ├── ReplayModCompat.java │ │ ├── bettersprinting │ │ │ └── DisableBetterSprinting.java │ │ ├── mapwriter │ │ │ └── mixin │ │ │ │ └── MixinMinecraft.java │ │ ├── optifine │ │ │ ├── DisableFastRender.java │ │ │ └── OptifineReflection.java │ │ ├── oranges17animations │ │ │ └── HideInvisibleEntities.java │ │ └── shaders │ │ │ ├── ShaderBeginRender.java │ │ │ └── ShaderReflection.java │ │ ├── core │ │ ├── DummyChainLoadEntryPoint.java │ │ ├── KeyBindingRegistry.java │ │ ├── LoadingPlugin.java │ │ ├── MinecraftMethodAccessor.java │ │ ├── Module.java │ │ ├── ReplayMod.java │ │ ├── ReplayModBackend.java │ │ ├── ReplayModMMLauncher.java │ │ ├── ReplayModMixinConfigPlugin.java │ │ ├── ReplayModNonMMLauncher.java │ │ ├── Setting.java │ │ ├── SettingsRegistry.java │ │ ├── SettingsRegistryBackend.java │ │ ├── asm │ │ │ ├── GLErrorTransformer.java │ │ │ └── GLStateTrackerTransformer.java │ │ ├── events │ │ │ ├── KeyBindingEventCallback.java │ │ │ ├── KeyEventCallback.java │ │ │ ├── PostRenderCallback.java │ │ │ ├── PostRenderWorldCallback.java │ │ │ ├── PreRenderCallback.java │ │ │ ├── PreRenderHandCallback.java │ │ │ └── SettingsChangedCallback.java │ │ ├── gui │ │ │ ├── GuiBackgroundProcesses.java │ │ │ ├── GuiFactory.java │ │ │ ├── GuiReplayButton.java │ │ │ ├── GuiReplaySettings.java │ │ │ ├── ModMenuApiImpl.java │ │ │ └── RestoreReplayGui.java │ │ ├── tweaker │ │ │ └── ReplayModTweaker.java │ │ ├── utils │ │ │ ├── ModCompat.java │ │ │ ├── ModInfoGetter.java │ │ │ ├── Patterns.java │ │ │ ├── Restrictions.java │ │ │ ├── Utils.java │ │ │ └── WrappedTimer.java │ │ └── versions │ │ │ ├── BufferBuilder.java │ │ │ ├── GLFW.java │ │ │ ├── LangResourcePack.java │ │ │ ├── MCVer.java │ │ │ ├── Patterns.java │ │ │ ├── Window.java │ │ │ ├── forge │ │ │ ├── EventsAdapter.java │ │ │ └── Patterns.java │ │ │ └── scheduler │ │ │ ├── Scheduler.java │ │ │ └── SchedulerImpl.java │ │ ├── editor │ │ ├── ReplayModEditor.java │ │ ├── gui │ │ │ ├── GuiEditReplay.java │ │ │ └── MarkerProcessor.java │ │ └── handler │ │ │ └── GuiHandler.java │ │ ├── extras │ │ ├── Extra.java │ │ ├── FullBrightness.java │ │ ├── HotkeyButtons.java │ │ ├── QuickMode.java │ │ ├── ReplayModExtras.java │ │ ├── Setting.java │ │ ├── advancedscreenshots │ │ │ ├── AdvancedScreenshots.java │ │ │ ├── GuiCreateScreenshot.java │ │ │ ├── GuiUploadScreenshot.java │ │ │ ├── ScreenshotRenderer.java │ │ │ └── ScreenshotWriter.java │ │ ├── modcore │ │ │ └── ModCoreInstaller.java │ │ ├── playeroverview │ │ │ ├── PlayerOverview.java │ │ │ └── PlayerOverviewGui.java │ │ └── youtube │ │ │ ├── GuiYoutubeUpload.java │ │ │ ├── VideoVisibility.java │ │ │ ├── YoutubeUpload.java │ │ │ └── YoutubeUploader.java │ │ ├── gradle │ │ └── remap │ │ │ └── Pattern.java │ │ ├── gui │ │ ├── GuiRenderer.java │ │ ├── MinecraftGuiRenderer.java │ │ ├── OffsetGuiRenderer.java │ │ ├── RenderInfo.java │ │ ├── container │ │ │ ├── AbstractGuiClickableContainer.java │ │ │ ├── AbstractGuiContainer.java │ │ │ ├── AbstractGuiOverlay.java │ │ │ ├── AbstractGuiScreen.java │ │ │ ├── AbstractGuiScrollable.java │ │ │ ├── AbstractGuiVerticalList.java │ │ │ ├── GuiClickable.java │ │ │ ├── GuiContainer.java │ │ │ ├── GuiOverlay.java │ │ │ ├── GuiPanel.java │ │ │ ├── GuiScreen.java │ │ │ ├── GuiScrollable.java │ │ │ ├── GuiVerticalList.java │ │ │ └── VanillaGuiScreen.java │ │ ├── element │ │ │ ├── AbstractComposedGuiElement.java │ │ │ ├── AbstractGuiButton.java │ │ │ ├── AbstractGuiCheckbox.java │ │ │ ├── AbstractGuiClickable.java │ │ │ ├── AbstractGuiElement.java │ │ │ ├── AbstractGuiHorizontalScrollbar.java │ │ │ ├── AbstractGuiImage.java │ │ │ ├── AbstractGuiLabel.java │ │ │ ├── AbstractGuiNumberField.java │ │ │ ├── AbstractGuiPasswordField.java │ │ │ ├── AbstractGuiSlider.java │ │ │ ├── AbstractGuiTextField.java │ │ │ ├── AbstractGuiTexturedButton.java │ │ │ ├── AbstractGuiToggleButton.java │ │ │ ├── AbstractGuiTooltip.java │ │ │ ├── ComposedGuiElement.java │ │ │ ├── GuiButton.java │ │ │ ├── GuiCheckbox.java │ │ │ ├── GuiElement.java │ │ │ ├── GuiHorizontalScrollbar.java │ │ │ ├── GuiImage.java │ │ │ ├── GuiLabel.java │ │ │ ├── GuiNumberField.java │ │ │ ├── GuiPasswordField.java │ │ │ ├── GuiSlider.java │ │ │ ├── GuiTextField.java │ │ │ ├── GuiTexturedButton.java │ │ │ ├── GuiToggleButton.java │ │ │ ├── GuiTooltip.java │ │ │ ├── IGuiButton.java │ │ │ ├── IGuiCheckbox.java │ │ │ ├── IGuiClickable.java │ │ │ ├── IGuiHorizontalScrollbar.java │ │ │ ├── IGuiImage.java │ │ │ ├── IGuiLabel.java │ │ │ ├── IGuiNumberField.java │ │ │ ├── IGuiSlider.java │ │ │ ├── IGuiTextField.java │ │ │ ├── IGuiTexturedButton.java │ │ │ ├── IGuiToggleButton.java │ │ │ └── advanced │ │ │ │ ├── AbstractGuiColorPicker.java │ │ │ │ ├── AbstractGuiDropdownMenu.java │ │ │ │ ├── AbstractGuiProgressBar.java │ │ │ │ ├── AbstractGuiResourceLoadingList.java │ │ │ │ ├── AbstractGuiTextArea.java │ │ │ │ ├── AbstractGuiTimeline.java │ │ │ │ ├── AbstractGuiTimelineTime.java │ │ │ │ ├── GuiColorPicker.java │ │ │ │ ├── GuiDropdownMenu.java │ │ │ │ ├── GuiProgressBar.java │ │ │ │ ├── GuiResourceLoadingList.java │ │ │ │ ├── GuiTextArea.java │ │ │ │ ├── GuiTimeline.java │ │ │ │ ├── GuiTimelineTime.java │ │ │ │ ├── IGuiColorPicker.java │ │ │ │ ├── IGuiDropdownMenu.java │ │ │ │ ├── IGuiProgressBar.java │ │ │ │ ├── IGuiTextArea.java │ │ │ │ ├── IGuiTimeline.java │ │ │ │ └── IGuiTimelineTime.java │ │ ├── function │ │ │ ├── Clickable.java │ │ │ ├── Closeable.java │ │ │ ├── Draggable.java │ │ │ ├── Focusable.java │ │ │ ├── Loadable.java │ │ │ ├── Scrollable.java │ │ │ ├── Tickable.java │ │ │ └── Typeable.java │ │ ├── layout │ │ │ ├── CustomLayout.java │ │ │ ├── GridLayout.java │ │ │ ├── HorizontalLayout.java │ │ │ ├── Layout.java │ │ │ ├── LayoutData.java │ │ │ ├── VerticalLayout.java │ │ │ └── VoidLayoutData.java │ │ ├── popup │ │ │ ├── AbstractGuiPopup.java │ │ │ ├── GuiFileChooserPopup.java │ │ │ ├── GuiInfoPopup.java │ │ │ └── GuiYesNoPopup.java │ │ ├── utils │ │ │ ├── Colors.java │ │ │ ├── Consumer.java │ │ │ ├── Consumers.java │ │ │ ├── Event.java │ │ │ ├── EventRegistration.java │ │ │ ├── EventRegistrations.java │ │ │ ├── MouseUtils.java │ │ │ ├── NonNull.java │ │ │ ├── StringUtils.java │ │ │ └── Utils.java │ │ └── versions │ │ │ ├── Image.java │ │ │ ├── MCVer.java │ │ │ ├── MatrixStack.java │ │ │ ├── callbacks │ │ │ ├── InitScreenCallback.java │ │ │ ├── KeyboardCallback.java │ │ │ ├── MouseCallback.java │ │ │ ├── OpenGuiScreenCallback.java │ │ │ ├── PostRenderScreenCallback.java │ │ │ ├── PreTickCallback.java │ │ │ └── RenderHudCallback.java │ │ │ └── forge │ │ │ └── EventsAdapter.java │ │ ├── mixin │ │ ├── AbstractButtonWidgetAccessor.java │ │ ├── AddServerScreenAccessor.java │ │ ├── ChunkRenderDispatcherAccessor.java │ │ ├── ContainerLocalRenderInformationAccessor.java │ │ ├── EntityAccessor.java │ │ ├── EntityLivingBaseAccessor.java │ │ ├── EntityOtherPlayerMPAccessor.java │ │ ├── EntityPlayerAccessor.java │ │ ├── FirstPersonRendererAccessor.java │ │ ├── GuiMainMenuAccessor.java │ │ ├── GuiScreenAccessor.java │ │ ├── IntegratedServerAccessor.java │ │ ├── ItemRendererAccessor.java │ │ ├── KeyBindingAccessor.java │ │ ├── MainWindowAccessor.java │ │ ├── MinecraftAccessor.java │ │ ├── MixinCamera.java │ │ ├── MixinChunkRenderWorker.java │ │ ├── MixinChunkVisibility.java │ │ ├── MixinClientPlayNetHandler.java │ │ ├── MixinDownloadingPackFinder.java │ │ ├── MixinEffectRenderer.java │ │ ├── MixinEntityRenderer.java │ │ ├── MixinFMLClientHandler.java │ │ ├── MixinFMLHandshakeHandler.java │ │ ├── MixinGameRenderer.java │ │ ├── MixinGlStateManager.java │ │ ├── MixinGuiScreen.java │ │ ├── MixinGuiSpectator.java │ │ ├── MixinInGameHud.java │ │ ├── MixinKeyboardListener.java │ │ ├── MixinMinecraft.java │ │ ├── MixinModelRenderer.java │ │ ├── MixinMouse.java │ │ ├── MixinMouseHelper.java │ │ ├── MixinMouseListener.java │ │ ├── MixinNetHandlerLoginClient.java │ │ ├── MixinNetHandlerPlayClient.java │ │ ├── MixinNetworkDispatcher.java │ │ ├── MixinOpenGlHelper.java │ │ ├── MixinParticleManager.java │ │ ├── MixinPlayerControllerMP.java │ │ ├── MixinRender.java │ │ ├── MixinRenderArrow.java │ │ ├── MixinRenderGlobal.java │ │ ├── MixinRenderItem.java │ │ ├── MixinRenderLivingBase.java │ │ ├── MixinRenderManager.java │ │ ├── MixinS26PacketMapChunkBulk.java │ │ ├── MixinScreen.java │ │ ├── MixinServerInfo.java │ │ ├── MixinShaderEntityRenderer.java │ │ ├── MixinShaderRenderChunk.java │ │ ├── MixinShaders.java │ │ ├── MixinShadersRender.java │ │ ├── MixinTileEntityEndPortalRenderer.java │ │ ├── MixinTileEntityRendererDispatcher.java │ │ ├── MixinViewFrustum.java │ │ ├── MixinWorldClient.java │ │ ├── Mixin_BlockOnChunkRebuilds.java │ │ ├── Mixin_ChromaKeyColorSky.java │ │ ├── Mixin_ChromaKeyDisableFog.java │ │ ├── Mixin_ChromaKeyForceSky.java │ │ ├── Mixin_ChunkRenderWorker.java │ │ ├── Mixin_ContextualKeyBindings.java │ │ ├── Mixin_EffectRenderer.java │ │ ├── Mixin_EntityLivingBaseAccessor.java │ │ ├── Mixin_ForceChunkLoading.java │ │ ├── Mixin_HideDynamicResourcePacks.java │ │ ├── Mixin_HideNameTags.java │ │ ├── Mixin_HideNameTags_LivingEntity.java │ │ ├── Mixin_KeyboardListener.java │ │ ├── Mixin_MoveRealmsButton.java │ │ ├── Mixin_Omnidirectional_Camera.java │ │ ├── Mixin_Omnidirectional_DisableFrustumCulling.java │ │ ├── Mixin_Omnidirectional_Rotation.java │ │ ├── Mixin_Omnidirectional_SkipHand.java │ │ ├── Mixin_ParticleManager.java │ │ ├── Mixin_PlayerControllerMP.java │ │ ├── Mixin_PreserveDepthDuringHandRendering.java │ │ ├── Mixin_RegisterDynamicResourcePacks.java │ │ ├── Mixin_RenderGlobal.java │ │ ├── Mixin_RenderHudCallback.java │ │ ├── Mixin_RenderItem.java │ │ ├── Mixin_RenderLivingBase.java │ │ ├── Mixin_RenderManager.java │ │ ├── Mixin_ShowSpectatedHand_NoOF.java │ │ ├── Mixin_ShowSpectatedHand_OF.java │ │ ├── Mixin_SkipBlockOutlinesDuringRender.java │ │ ├── Mixin_StabilizeCamera.java │ │ ├── Mixin_Stereoscopic_Camera.java │ │ ├── Mixin_Stereoscopic_HandRenderPass.java │ │ ├── Mixin_WindowsWorkaroundForTinyEXRNatives.java │ │ ├── Mixin_WorldRendererAccessor.java │ │ ├── NetworkManagerAccessor.java │ │ ├── NetworkRegistryAccessor.java │ │ ├── ParticleAccessor.java │ │ ├── ResourcePackRepositoryAccessor.java │ │ ├── SPacketSpawnMobAccessor.java │ │ ├── SPacketSpawnPlayerAccessor.java │ │ ├── TimerAccessor.java │ │ └── WorldRendererAccessor.java │ │ ├── pathing │ │ ├── gui │ │ │ └── GuiKeyframeRepository.java │ │ ├── player │ │ │ ├── AbstractTimelinePlayer.java │ │ │ ├── RealtimeTimelinePlayer.java │ │ │ └── ReplayTimer.java │ │ └── properties │ │ │ ├── CameraProperties.java │ │ │ ├── SpectatorProperty.java │ │ │ └── TimestampProperty.java │ │ ├── recording │ │ ├── ReplayModRecording.java │ │ ├── ServerInfoExt.java │ │ ├── Setting.java │ │ ├── gui │ │ │ ├── GuiRecordingControls.java │ │ │ ├── GuiRecordingOverlay.java │ │ │ └── GuiSavingReplay.java │ │ ├── handler │ │ │ ├── ConnectionEventHandler.java │ │ │ ├── FMLHandshakeFilter.java │ │ │ ├── GuiHandler.java │ │ │ └── RecordingEventHandler.java │ │ └── packet │ │ │ ├── PacketListener.java │ │ │ ├── PacketRecorder.java │ │ │ └── ResourcePackRecorder.java │ │ ├── render │ │ ├── CameraPathExporter.java │ │ ├── EXRWriter.java │ │ ├── FFmpegWriter.java │ │ ├── PNGWriter.java │ │ ├── RenderSettings.java │ │ ├── ReplayModRender.java │ │ ├── Setting.java │ │ ├── blend │ │ │ ├── BlendFrameCapturer.java │ │ │ ├── BlendMaterials.java │ │ │ ├── BlendMeshBuilder.java │ │ │ ├── BlendState.java │ │ │ ├── Exporter.java │ │ │ ├── ToJson.java │ │ │ ├── Util.java │ │ │ ├── data │ │ │ │ ├── DAction.java │ │ │ │ ├── DId.java │ │ │ │ ├── DImage.java │ │ │ │ ├── DMaterial.java │ │ │ │ ├── DMesh.java │ │ │ │ ├── DObject.java │ │ │ │ ├── DPackedFile.java │ │ │ │ ├── DScene.java │ │ │ │ ├── DTexture.java │ │ │ │ └── Serializer.java │ │ │ └── exporters │ │ │ │ ├── ChunkExporter.java │ │ │ │ ├── EntityExporter.java │ │ │ │ ├── ItemExporter.java │ │ │ │ ├── ModelRendererExporter.java │ │ │ │ ├── ParticlesExporter.java │ │ │ │ ├── RenderState.java │ │ │ │ └── TileEntityExporter.java │ │ ├── capturer │ │ │ ├── CaptureData.java │ │ │ ├── CubicOpenGlFrameCapturer.java │ │ │ ├── CubicPboOpenGlFrameCapturer.java │ │ │ ├── ODSFrameCapturer.java │ │ │ ├── OpenGlFrameCapturer.java │ │ │ ├── PboOpenGlFrameCapturer.java │ │ │ ├── RenderInfo.java │ │ │ ├── SimpleOpenGlFrameCapturer.java │ │ │ ├── SimplePboOpenGlFrameCapturer.java │ │ │ ├── StereoscopicOpenGlFrameCapturer.java │ │ │ ├── StereoscopicPboOpenGlFrameCapturer.java │ │ │ └── WorldRenderer.java │ │ ├── events │ │ │ └── ReplayRenderCallback.java │ │ ├── frame │ │ │ ├── BitmapFrame.java │ │ │ ├── CubicOpenGlFrame.java │ │ │ ├── ODSOpenGlFrame.java │ │ │ ├── OpenGlFrame.java │ │ │ └── StereoscopicOpenGlFrame.java │ │ ├── gui │ │ │ ├── GuiExportFailed.java │ │ │ ├── GuiRenderQueue.java │ │ │ ├── GuiRenderSettings.java │ │ │ ├── GuiRenderingDone.java │ │ │ └── GuiVideoRenderer.java │ │ ├── hooks │ │ │ ├── EntityRendererHandler.java │ │ │ ├── FogStateCallback.java │ │ │ ├── ForceChunkLoadingHook.java │ │ │ ├── GLStateTracker.java │ │ │ ├── IForceChunkLoading.java │ │ │ └── Texture2DStateCallback.java │ │ ├── metadata │ │ │ └── MetadataInjector.java │ │ ├── processor │ │ │ ├── AbstractFrameProcessor.java │ │ │ ├── CubicToBitmapProcessor.java │ │ │ ├── DummyProcessor.java │ │ │ ├── EquirectangularToBitmapProcessor.java │ │ │ ├── GlToAbsoluteDepthProcessor.java │ │ │ ├── ODSToBitmapProcessor.java │ │ │ ├── OpenGlToBitmapProcessor.java │ │ │ └── StereoscopicToBitmapProcessor.java │ │ ├── rendering │ │ │ ├── Channel.java │ │ │ ├── Frame.java │ │ │ ├── FrameCapturer.java │ │ │ ├── FrameConsumer.java │ │ │ ├── FrameProcessor.java │ │ │ ├── Pipeline.java │ │ │ ├── Pipelines.java │ │ │ └── VideoRenderer.java │ │ ├── shader │ │ │ └── Program.java │ │ └── utils │ │ │ ├── ByteBufferPool.java │ │ │ ├── JailingQueue.java │ │ │ ├── PixelBufferObject.java │ │ │ ├── RenderJob.java │ │ │ ├── StreamPipe.java │ │ │ └── Utils.java │ │ ├── replay │ │ ├── InputReplayTimer.java │ │ ├── NoGuiScreenshot.java │ │ ├── ReplayHandler.java │ │ ├── ReplayModReplay.java │ │ ├── ReplaySender.java │ │ ├── Setting.java │ │ ├── camera │ │ │ ├── CameraController.java │ │ │ ├── CameraControllerRegistry.java │ │ │ ├── CameraEntity.java │ │ │ ├── ClassicCameraController.java │ │ │ ├── SpectatorCameraController.java │ │ │ └── VanillaCameraController.java │ │ ├── events │ │ │ ├── RenderHotbarCallback.java │ │ │ ├── RenderSpectatorCrosshairCallback.java │ │ │ ├── ReplayChatMessageEvent.java │ │ │ ├── ReplayClosedCallback.java │ │ │ ├── ReplayClosingCallback.java │ │ │ ├── ReplayDispatchKeypressesEvent.java │ │ │ └── ReplayOpenedCallback.java │ │ ├── gui │ │ │ ├── overlay │ │ │ │ ├── GuiEditMarkerPopup.java │ │ │ │ ├── GuiMarkerTimeline.java │ │ │ │ └── GuiReplayOverlay.java │ │ │ └── screen │ │ │ │ ├── GuiModCompatWarning.java │ │ │ │ ├── GuiOpeningReplay.java │ │ │ │ └── GuiReplayViewer.java │ │ ├── handler │ │ │ └── GuiHandler.java │ │ └── sender │ │ │ ├── FullReplaySender.java │ │ │ └── QuickReplaySender.java │ │ └── simplepathing │ │ ├── InterpolatorType.java │ │ ├── ReplayModSimplePathing.java │ │ ├── SPTimeline.java │ │ ├── Setting.java │ │ ├── gui │ │ ├── GuiEditKeyframe.java │ │ ├── GuiKeyframeTimeline.java │ │ └── GuiPathing.java │ │ ├── preview │ │ ├── PathPreview.java │ │ └── PathPreviewRenderer.java │ │ └── properties │ │ └── ExplicitInterpolationProperty.java │ └── resources │ ├── META-INF │ └── mods.toml │ ├── ThankYou.txt │ ├── assets │ ├── jgui │ │ └── gui.png │ └── replaymod │ │ ├── camera_head.png │ │ ├── favicon_logo.png │ │ ├── logo.jpg │ │ ├── replay_gui.license │ │ ├── replay_gui.png │ │ ├── shader │ │ ├── ods.frag │ │ └── ods.vert │ │ ├── sounds.json │ │ └── sounds │ │ └── render_success.ogg │ ├── default_thumb.jpg │ ├── dst_root_ca_x3.pem │ ├── fabric.mod.json │ ├── mcmod.info │ ├── mixins.compat.mapwriter.replaymod.json │ ├── mixins.compat.shaders.replaymod.json │ ├── mixins.core.replaymod.json │ ├── mixins.extras.playeroverview.replaymod.json │ ├── mixins.jgui.json │ ├── mixins.nonmmlauncher.replaymod.json │ ├── mixins.recording.replaymod.json │ ├── mixins.render.blend.replaymod.json │ ├── mixins.render.replaymod.json │ ├── mixins.replay.replaymod.json │ ├── mixins.replaymod.json │ ├── pack.mcmeta │ └── replaymod_logo.png └── version.txt /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "src/main/resources/assets/replaymod/lang"] 2 | path = src/main/resources/assets/replaymod/lang 3 | url = https://github.com/ReplayMod/Translations 4 | -------------------------------------------------------------------------------- /Jenkinsfile: -------------------------------------------------------------------------------- 1 | pipeline { 2 | agent { 3 | docker { image 'openjdk:8-jdk' } 4 | } 5 | stages { 6 | stage('Build') { 7 | environment { 8 | GRADLE_USER_HOME = '.gradle/user_home' 9 | } 10 | steps { 11 | cache(maxCacheSize: 4096, caches: [ 12 | [$class: 'ArbitraryFileCache', excludes: 'modules-2/modules-2.lock,*/plugin-resolution/**', includes: '**/*', path: '.gradle/user_home/caches'], 13 | [$class: 'ArbitraryFileCache', excludes: '', includes: '**/*', path: '.gradle/user_home/wrapper'], 14 | [$class: 'ArbitraryFileCache', excludes: '', includes: '**/*', path: '.gradle/loom-cache'], 15 | ]) { 16 | sh './gradlew :jGui:1.7.10:setupCIWorkspace :1.7.10:setupCIWorkspace' 17 | sh './gradlew --parallel' 18 | } 19 | archiveArtifacts 'versions/*/build/libs/*.jar' 20 | } 21 | } 22 | stage('Deploy') { 23 | steps { 24 | withAWS(endpointUrl: 'https://minio.johni0702.de', credentials: 'minio') { 25 | s3Upload bucket: 'replaymod', includePathPattern: '*.jar', workingDir: 'build/libs', acl: 'PublicRead', pathStyleAccessEnabled: true 26 | } 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | content.html 3 | -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | ### Documentation 2 | The documentation at [replaymod.com/docs](https://www.replaymod.com/docs/) is generated from 3 | `content.md` using a custom Node.js script. 4 | 5 | Using an image directly after a header will show it to the right of the text and will show the following 6 | text as its caption. 7 | 8 | Block quotes (`> Quote`) are used to highlight sections of texts: `> **Note:** This is important.` 9 | 10 | Images should be available in two formats: jpg, which is loaded by default and the original png which 11 | is loaded when the user clicks on the image. Note that some might only be available as jpg right now 12 | as their original was lost. 13 | Animated images should be available in webm (vp9) format which is displayed by default and as a gif which is used as 14 | the fallback for browsers that lack webm support. 15 | In `content.md`, the default version is used. 16 | 17 | Make sure you have [npm]() installed. 18 | For the initial setup run `npm install`. 19 | Run `node build` to generate the html. 20 | 21 | Note: The template used for the live version is different and the one here is only for convenient testing. -------------------------------------------------------------------------------- /docs/img/ambient-lighting-comparison.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/ambient-lighting-comparison.jpg -------------------------------------------------------------------------------- /docs/img/ambient-lighting-comparison.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/ambient-lighting-comparison.png -------------------------------------------------------------------------------- /docs/img/asset-manager.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/asset-manager.jpg -------------------------------------------------------------------------------- /docs/img/asset-manager.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/asset-manager.png -------------------------------------------------------------------------------- /docs/img/auth-login.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/auth-login.jpg -------------------------------------------------------------------------------- /docs/img/auth-login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/auth-login.png -------------------------------------------------------------------------------- /docs/img/auth-register.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/auth-register.jpg -------------------------------------------------------------------------------- /docs/img/auth-register.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/auth-register.png -------------------------------------------------------------------------------- /docs/img/camera-tilted.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/camera-tilted.jpg -------------------------------------------------------------------------------- /docs/img/camera-tilted.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/camera-tilted.png -------------------------------------------------------------------------------- /docs/img/chromasky.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/chromasky.jpg -------------------------------------------------------------------------------- /docs/img/chromasky.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/chromasky.png -------------------------------------------------------------------------------- /docs/img/cubic-path.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/cubic-path.gif -------------------------------------------------------------------------------- /docs/img/cubic-path.webm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/cubic-path.webm -------------------------------------------------------------------------------- /docs/img/custom-object-animated.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/custom-object-animated.gif -------------------------------------------------------------------------------- /docs/img/custom-object-animated.webm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/custom-object-animated.webm -------------------------------------------------------------------------------- /docs/img/default-thumb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/default-thumb.jpg -------------------------------------------------------------------------------- /docs/img/depthmapsuzanne.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/depthmapsuzanne.jpg -------------------------------------------------------------------------------- /docs/img/depthmapsuzanne.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/depthmapsuzanne.png -------------------------------------------------------------------------------- /docs/img/eyecon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/eyecon.jpg -------------------------------------------------------------------------------- /docs/img/eyecon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/eyecon.png -------------------------------------------------------------------------------- /docs/img/ffmpeg-missing.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/ffmpeg-missing.jpg -------------------------------------------------------------------------------- /docs/img/ffmpeg-missing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/ffmpeg-missing.png -------------------------------------------------------------------------------- /docs/img/keyframe-editor.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/keyframe-editor.jpg -------------------------------------------------------------------------------- /docs/img/keyframe-editor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/keyframe-editor.png -------------------------------------------------------------------------------- /docs/img/keyframe-repository.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/keyframe-repository.jpg -------------------------------------------------------------------------------- /docs/img/keyframe-repository.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/keyframe-repository.png -------------------------------------------------------------------------------- /docs/img/keyframe-timeline.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/keyframe-timeline.jpg -------------------------------------------------------------------------------- /docs/img/keyframe-timeline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/keyframe-timeline.png -------------------------------------------------------------------------------- /docs/img/linear-path.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/linear-path.gif -------------------------------------------------------------------------------- /docs/img/linear-path.webm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/linear-path.webm -------------------------------------------------------------------------------- /docs/img/marker-timeline.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/marker-timeline.jpg -------------------------------------------------------------------------------- /docs/img/marker-timeline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/marker-timeline.png -------------------------------------------------------------------------------- /docs/img/multimc-addempty.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/multimc-addempty.jpg -------------------------------------------------------------------------------- /docs/img/multimc-addempty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/multimc-addempty.png -------------------------------------------------------------------------------- /docs/img/mutlimc-liteloader.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/mutlimc-liteloader.jpg -------------------------------------------------------------------------------- /docs/img/mutlimc-liteloader.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/mutlimc-liteloader.png -------------------------------------------------------------------------------- /docs/img/object-manager.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/object-manager.jpg -------------------------------------------------------------------------------- /docs/img/object-manager.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/object-manager.png -------------------------------------------------------------------------------- /docs/img/path-preview-icon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/path-preview-icon.jpg -------------------------------------------------------------------------------- /docs/img/path-preview-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/path-preview-icon.png -------------------------------------------------------------------------------- /docs/img/path-preview-spectator.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/path-preview-spectator.jpg -------------------------------------------------------------------------------- /docs/img/path-preview-spectator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/path-preview-spectator.png -------------------------------------------------------------------------------- /docs/img/path-preview.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/path-preview.jpg -------------------------------------------------------------------------------- /docs/img/path-preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/path-preview.png -------------------------------------------------------------------------------- /docs/img/player-overview.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/player-overview.jpg -------------------------------------------------------------------------------- /docs/img/player-overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/player-overview.png -------------------------------------------------------------------------------- /docs/img/position-keyframe-button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/position-keyframe-button.png -------------------------------------------------------------------------------- /docs/img/quality-comparison.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/quality-comparison.jpg -------------------------------------------------------------------------------- /docs/img/quality-comparison.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/quality-comparison.png -------------------------------------------------------------------------------- /docs/img/quickmode-icon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/quickmode-icon.jpg -------------------------------------------------------------------------------- /docs/img/quickmode-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/quickmode-icon.png -------------------------------------------------------------------------------- /docs/img/real-timeline.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/real-timeline.jpg -------------------------------------------------------------------------------- /docs/img/real-timeline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/real-timeline.png -------------------------------------------------------------------------------- /docs/img/recording-indicator.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/recording-indicator.jpg -------------------------------------------------------------------------------- /docs/img/recording-indicator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/recording-indicator.png -------------------------------------------------------------------------------- /docs/img/render-cubic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/render-cubic.jpg -------------------------------------------------------------------------------- /docs/img/render-cubic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/render-cubic.png -------------------------------------------------------------------------------- /docs/img/render-default.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/render-default.jpg -------------------------------------------------------------------------------- /docs/img/render-default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/render-default.png -------------------------------------------------------------------------------- /docs/img/render-equirectangular.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/render-equirectangular.jpg -------------------------------------------------------------------------------- /docs/img/render-equirectangular.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/render-equirectangular.png -------------------------------------------------------------------------------- /docs/img/render-stereoscopic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/render-stereoscopic.jpg -------------------------------------------------------------------------------- /docs/img/render-stereoscopic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/render-stereoscopic.png -------------------------------------------------------------------------------- /docs/img/rendering-screen.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/rendering-screen.jpg -------------------------------------------------------------------------------- /docs/img/rendering-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/rendering-screen.png -------------------------------------------------------------------------------- /docs/img/rendersettings-advanced.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/rendersettings-advanced.jpg -------------------------------------------------------------------------------- /docs/img/rendersettings-advanced.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/rendersettings-advanced.png -------------------------------------------------------------------------------- /docs/img/rendersettings-commandline.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/rendersettings-commandline.jpg -------------------------------------------------------------------------------- /docs/img/rendersettings-commandline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/rendersettings-commandline.png -------------------------------------------------------------------------------- /docs/img/rendersettings-video.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/rendersettings-video.jpg -------------------------------------------------------------------------------- /docs/img/rendersettings-video.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/rendersettings-video.png -------------------------------------------------------------------------------- /docs/img/replay-center.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/replay-center.jpg -------------------------------------------------------------------------------- /docs/img/replay-center.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/replay-center.png -------------------------------------------------------------------------------- /docs/img/replay-upload.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/replay-upload.jpg -------------------------------------------------------------------------------- /docs/img/replay-upload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/replay-upload.png -------------------------------------------------------------------------------- /docs/img/replay-viewer.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/replay-viewer.jpg -------------------------------------------------------------------------------- /docs/img/replay-viewer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/replay-viewer.png -------------------------------------------------------------------------------- /docs/img/spectator-keyframe-button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/spectator-keyframe-button.png -------------------------------------------------------------------------------- /docs/img/time-keyframe-button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/docs/img/time-keyframe-button.png -------------------------------------------------------------------------------- /docs/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "replaymod-docs", 3 | "version": "0.0.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "array-findindex-polyfill": { 8 | "version": "0.1.0", 9 | "resolved": "https://registry.npmjs.org/array-findindex-polyfill/-/array-findindex-polyfill-0.1.0.tgz", 10 | "integrity": "sha1-w2JmW+x2RfItejw6rJeT9xw2Iu8=" 11 | }, 12 | "md-jml": { 13 | "version": "2.0.1", 14 | "resolved": "https://registry.npmjs.org/md-jml/-/md-jml-2.0.1.tgz", 15 | "integrity": "sha1-th99rTm1JPVKCmpthnMcTRLOCDo=" 16 | }, 17 | "string.prototype.endswith": { 18 | "version": "0.2.0", 19 | "resolved": "https://registry.npmjs.org/string.prototype.endswith/-/string.prototype.endswith-0.2.0.tgz", 20 | "integrity": "sha1-oZwg3uUamHd+mkfhDwm+OTubunU=" 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /docs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "replaymod-docs", 3 | "version": "0.0.0", 4 | "description": "", 5 | "main": "convert.js", 6 | "author": "Jonas Herzig ", 7 | "license": "GPLv3", 8 | "dependencies": { 9 | "md-jml": "~2.0.1", 10 | "array-findindex-polyfill": "~0.1.0", 11 | "string.prototype.endswith": "~0.2.0" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /docs/template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Minecraft Replay Mod - Documentation 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 |
21 |
22 |
23 | {{index}} 24 |
25 |
26 | {{content}} 27 |
28 |
29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /ffmpeg-install-scripts/ffmpeg-path-installer.bat: -------------------------------------------------------------------------------- 1 | ECHO OFF 2 | 3 | IF NOT EXIST bin\ffmpeg.exe ( 4 | CLS 5 | ECHO bin\ffmpeg.exe could not be found. 6 | GOTO:error 7 | ) 8 | 9 | CD bin || GOTO:error 10 | PROMPT $G 11 | CLS 12 | SETX PATH "%CD%;%PATH%" 13 | ECHO. 14 | ECHO Successfully set ffmpeg's PATH variable. 15 | ECHO If you move this folder, make sure to run this script again. 16 | ECHO. 17 | PAUSE 18 | GOTO:EOF 19 | 20 | :error 21 | ECHO. 22 | ECHO Press any key to exit. 23 | PAUSE >nul 24 | GOTO:EOF 25 | -------------------------------------------------------------------------------- /ffmpeg-install-scripts/ffmpeg-path-installer.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | if [ ! -e "ffmpeg" ] 3 | then 4 | echo "ffmpeg couldn't be found. Make sure you are executing this script from the same folder." 5 | exit 6 | fi 7 | mkdir -p /usr/local/bin 8 | cp ffmpeg /usr/local/bin/ 9 | export PATH=$PATH:/usr/local/bin 10 | 11 | echo "Successfully copied ffmpeg to /usr/local/bin and set the PATH variable." -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Sets default memory used for gradle commands. Can be overridden by user or command line properties. 2 | # This is required to provide enough memory for the Minecraft decompilation process. 3 | org.gradle.jvmargs=-Xmx3G 4 | org.gradle.daemon=true 5 | org.gradle.parallel=false 6 | org.gradle.configureondemand=false 7 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionSha256Sum=fd591a34af7385730970399f473afabdb8b28d57fd97d6625c388d090039d6fd 4 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.1-bin.zip 5 | zipStoreBase=GRADLE_USER_HOME 6 | zipStorePath=wrapper/dists 7 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/compat/ReplayModCompat.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.compat; 2 | 3 | import com.replaymod.compat.optifine.DisableFastRender; 4 | import com.replaymod.compat.shaders.ShaderBeginRender; 5 | import com.replaymod.core.Module; 6 | import org.apache.logging.log4j.LogManager; 7 | import org.apache.logging.log4j.Logger; 8 | 9 | public class ReplayModCompat implements Module { 10 | public static Logger LOGGER = LogManager.getLogger(); 11 | 12 | @Override 13 | public void initClient() { 14 | new ShaderBeginRender().register(); 15 | new DisableFastRender().register(); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/compat/bettersprinting/DisableBetterSprinting.java: -------------------------------------------------------------------------------- 1 | // 1.12.2 and below 2 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/compat/mapwriter/mixin/MixinMinecraft.java: -------------------------------------------------------------------------------- 1 | // 1.12.2 and below 2 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/compat/optifine/DisableFastRender.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.compat.optifine; 2 | 3 | import com.replaymod.core.versions.MCVer; 4 | import com.replaymod.gui.utils.EventRegistrations; 5 | import com.replaymod.render.events.ReplayRenderCallback; 6 | import net.minecraft.client.Minecraft; 7 | 8 | public class DisableFastRender extends EventRegistrations { 9 | 10 | private final Minecraft mc = Minecraft.getInstance(); 11 | 12 | private boolean wasFastRender = false; 13 | 14 | { 15 | on(ReplayRenderCallback.Pre.EVENT, renderer -> onRenderBegin()); 16 | } 17 | 18 | private void onRenderBegin() { 19 | if (!MCVer.hasOptifine()) return; 20 | 21 | try { 22 | wasFastRender = (boolean) OptifineReflection.gameSettings_ofFastRender.get(mc.gameSettings); 23 | OptifineReflection.gameSettings_ofFastRender.set(mc.gameSettings, false); 24 | } catch (IllegalAccessException e) { 25 | e.printStackTrace(); 26 | } 27 | } 28 | 29 | { 30 | on(ReplayRenderCallback.Post.EVENT, renderer -> onRenderEnd()); 31 | } 32 | 33 | private void onRenderEnd() { 34 | if (!MCVer.hasOptifine()) return; 35 | 36 | try { 37 | OptifineReflection.gameSettings_ofFastRender.set(mc.gameSettings, wasFastRender); 38 | } catch (IllegalAccessException e) { 39 | e.printStackTrace(); 40 | } 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/compat/optifine/OptifineReflection.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.compat.optifine; 2 | 3 | import net.minecraft.client.GameSettings; 4 | 5 | import java.lang.reflect.Field; 6 | import java.lang.reflect.InvocationTargetException; 7 | 8 | public class OptifineReflection { 9 | 10 | // GameSettings.ofFastRender 11 | public static Field gameSettings_ofFastRender; 12 | 13 | static { 14 | try { 15 | // this throws an ignored ClassNotFoundException if Optifine isn't installed 16 | Class.forName("Config"); 17 | 18 | gameSettings_ofFastRender = GameSettings.class.getDeclaredField("ofFastRender"); 19 | gameSettings_ofFastRender.setAccessible(true); 20 | } catch (ClassNotFoundException ignore) { 21 | // no optifine installed 22 | } catch (NoSuchFieldException e) { 23 | // the field wasn't found. Has it been renamed? 24 | e.printStackTrace(); 25 | } 26 | } 27 | 28 | public static void reloadLang() { 29 | try { 30 | Class langClass; 31 | try { 32 | langClass = Class.forName("Lang"); // Pre Optifine 1.12.2 E1 33 | } catch (ClassNotFoundException ignore) { 34 | langClass = Class.forName("net.optifine.Lang"); // Post Optifine 1.12.2 E1 35 | } 36 | langClass.getDeclaredMethod("resourcesReloaded").invoke(null); 37 | } catch (ClassNotFoundException ignore) { 38 | // no optifine installed 39 | } catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException e) { 40 | e.printStackTrace(); 41 | } 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/compat/oranges17animations/HideInvisibleEntities.java: -------------------------------------------------------------------------------- 1 | // 1.12.2 and below 2 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/compat/shaders/ShaderBeginRender.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.compat.shaders; 2 | 3 | import com.replaymod.core.events.PreRenderCallback; 4 | import com.replaymod.gui.utils.EventRegistrations; 5 | import com.replaymod.render.hooks.EntityRendererHandler; 6 | import net.minecraft.client.Minecraft; 7 | 8 | import java.lang.reflect.InvocationTargetException; 9 | 10 | public class ShaderBeginRender extends EventRegistrations { 11 | 12 | private final Minecraft mc = Minecraft.getInstance(); 13 | 14 | /** 15 | * Invokes Shaders#beginRender when rendering a video, 16 | * as this would usually get called by EntityRenderer#renderWorld, 17 | * which we're not calling during rendering. 18 | */ { 19 | on(PreRenderCallback.EVENT, this::onRenderTickStart); 20 | } 21 | 22 | private void onRenderTickStart() { 23 | if (ShaderReflection.shaders_beginRender == null) return; 24 | if (ShaderReflection.config_isShaders == null) return; 25 | 26 | try { 27 | // check if video is being rendered 28 | if (((EntityRendererHandler.IEntityRenderer) mc.gameRenderer).replayModRender_getHandler() == null) 29 | return; 30 | 31 | // check if Shaders are enabled 32 | if (!(boolean) (ShaderReflection.config_isShaders.invoke(null))) return; 33 | 34 | ShaderReflection.shaders_beginRender.invoke(null, mc, 35 | mc.gameRenderer.getActiveRenderInfo(), 36 | mc.getRenderPartialTicks(), 0); 37 | } catch (IllegalAccessException | InvocationTargetException e) { 38 | e.printStackTrace(); 39 | } 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/core/DummyChainLoadEntryPoint.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/src/main/java/com/replaymod/core/DummyChainLoadEntryPoint.java -------------------------------------------------------------------------------- /src/main/java/com/replaymod/core/LoadingPlugin.java: -------------------------------------------------------------------------------- 1 | // 1.12.2 and below 2 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/core/MinecraftMethodAccessor.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.core; 2 | 3 | public interface MinecraftMethodAccessor { 4 | void replayModProcessKeyBinds(); 5 | 6 | void replayModExecuteTaskQueue(); 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/core/Module.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.core; 2 | 3 | public interface Module { 4 | // FMLCommonSetupEvent for 1.13+, FMLInitializationEvent below 5 | default void initCommon() { 6 | } 7 | 8 | // FMLClientSetupEvent for 1.13+, FMLInitializationEvent (if client) below 9 | default void initClient() { 10 | } 11 | 12 | // FMLClientSetupEvent for 1.13+, FMLInitializationEvent below 13 | default void registerKeyBindings(KeyBindingRegistry registry) { 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/core/ReplayModBackend.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.core; 2 | 3 | import com.replaymod.core.versions.forge.EventsAdapter; 4 | import net.minecraftforge.fml.ModList; 5 | import net.minecraftforge.fml.common.Mod; 6 | import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; 7 | import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; 8 | 9 | @Mod(ReplayMod.MOD_ID) 10 | public class ReplayModBackend { 11 | private final ReplayMod mod = new ReplayMod(this); 12 | private final EventsAdapter eventsAdapter = new EventsAdapter(); 13 | 14 | // @Deprecated 15 | // public static Configuration config; 16 | 17 | public ReplayModBackend() { 18 | FMLJavaModLoadingContext.get().getModEventBus().addListener(this::init); 19 | } 20 | 21 | public void init(FMLCommonSetupEvent event) { 22 | mod.initModules(); 23 | eventsAdapter.register(); 24 | // config = new Configuration(event.getSuggestedConfigurationFile()); 25 | // config.load(); 26 | // SettingsRegistry settingsRegistry = mod.getSettingsRegistry(); 27 | // settingsRegistry.backend.setConfiguration(config); 28 | // settingsRegistry.save(); // Save default values to disk 29 | } 30 | 31 | public String getVersion() { 32 | return "2.5.1"; 33 | } 34 | 35 | public String getMinecraftVersion() { 36 | return "1.16.4"; 37 | } 38 | 39 | public boolean isModLoaded(String id) { 40 | return ModList.get().isLoaded(id); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/core/ReplayModMMLauncher.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/src/main/java/com/replaymod/core/ReplayModMMLauncher.java -------------------------------------------------------------------------------- /src/main/java/com/replaymod/core/ReplayModNonMMLauncher.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/src/main/java/com/replaymod/core/ReplayModNonMMLauncher.java -------------------------------------------------------------------------------- /src/main/java/com/replaymod/core/Setting.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.core; 2 | 3 | public final class Setting extends SettingsRegistry.SettingKeys { 4 | public static final Setting NOTIFICATIONS = make("notifications", "notifications", true); 5 | public static final Setting RECORDING_PATH = advanced("recordingPath", null, "./replay_recordings/"); 6 | public static final Setting CACHE_PATH = advanced("cachePath", null, "./.replay_cache/"); 7 | 8 | private static Setting make(String key, String displayName, T defaultValue) { 9 | return new Setting<>("core", key, displayName, defaultValue); 10 | } 11 | 12 | private static Setting advanced(String key, String displayName, T defaultValue) { 13 | return new Setting<>("advanced", key, displayName, defaultValue); 14 | } 15 | 16 | public Setting(String category, String key, String displayString, T defaultValue) { 17 | super(category, key, displayString == null ? null : "replaymod.gui.settings." + displayString, defaultValue); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/core/asm/GLErrorTransformer.java: -------------------------------------------------------------------------------- 1 | // 1.7.10 and below 2 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/core/asm/GLStateTrackerTransformer.java: -------------------------------------------------------------------------------- 1 | // 1.7.10 and below 2 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/core/events/KeyBindingEventCallback.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.core.events; 2 | 3 | import com.replaymod.gui.utils.Event; 4 | 5 | public interface KeyBindingEventCallback { 6 | Event EVENT = Event.create((listeners) -> 7 | () -> { 8 | for (KeyBindingEventCallback listener : listeners) { 9 | listener.onKeybindingEvent(); 10 | } 11 | } 12 | ); 13 | 14 | void onKeybindingEvent(); 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/core/events/KeyEventCallback.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.core.events; 2 | 3 | import com.replaymod.gui.utils.Event; 4 | 5 | public interface KeyEventCallback { 6 | Event EVENT = Event.create((listeners) -> 7 | (key, scanCode, action, modifiers) -> { 8 | for (KeyEventCallback listener : listeners) { 9 | if (listener.onKeyEvent(key, scanCode, action, modifiers)) { 10 | return true; 11 | } 12 | } 13 | return false; 14 | } 15 | ); 16 | 17 | int ACTION_RELEASE = org.lwjgl.glfw.GLFW.GLFW_RELEASE; 18 | int ACTION_PRESS = org.lwjgl.glfw.GLFW.GLFW_PRESS; 19 | 20 | boolean onKeyEvent(int key, int scanCode, int action, int modifiers); 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/core/events/PostRenderCallback.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.core.events; 2 | 3 | import com.replaymod.gui.utils.Event; 4 | 5 | public interface PostRenderCallback { 6 | Event EVENT = Event.create((listeners) -> 7 | () -> { 8 | for (PostRenderCallback listener : listeners) { 9 | listener.postRender(); 10 | } 11 | } 12 | ); 13 | 14 | void postRender(); 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/core/events/PostRenderWorldCallback.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.core.events; 2 | 3 | import com.mojang.blaze3d.matrix.MatrixStack; 4 | import com.replaymod.gui.utils.Event; 5 | 6 | public interface PostRenderWorldCallback { 7 | Event EVENT = Event.create((listeners) -> 8 | (MatrixStack matrixStack) -> { 9 | for (PostRenderWorldCallback listener : listeners) { 10 | listener.postRenderWorld(matrixStack); 11 | } 12 | } 13 | ); 14 | 15 | void postRenderWorld(MatrixStack matrixStack); 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/core/events/PreRenderCallback.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.core.events; 2 | 3 | import com.replaymod.gui.utils.Event; 4 | 5 | public interface PreRenderCallback { 6 | Event EVENT = Event.create((listeners) -> 7 | () -> { 8 | for (PreRenderCallback listener : listeners) { 9 | listener.preRender(); 10 | } 11 | } 12 | ); 13 | 14 | void preRender(); 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/core/events/PreRenderHandCallback.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.core.events; 2 | 3 | import com.replaymod.gui.utils.Event; 4 | 5 | public interface PreRenderHandCallback { 6 | Event EVENT = Event.create((listeners) -> 7 | () -> { 8 | for (PreRenderHandCallback listener : listeners) { 9 | if (listener.preRenderHand()) { 10 | return true; 11 | } 12 | } 13 | return false; 14 | } 15 | ); 16 | 17 | boolean preRenderHand(); 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/core/events/SettingsChangedCallback.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.core.events; 2 | 3 | import com.replaymod.core.SettingsRegistry; 4 | import com.replaymod.gui.utils.Event; 5 | 6 | public interface SettingsChangedCallback { 7 | Event EVENT = Event.create((listeners) -> 8 | (registry, key) -> { 9 | for (SettingsChangedCallback listener : listeners) { 10 | listener.onSettingsChanged(registry, key); 11 | } 12 | } 13 | ); 14 | 15 | void onSettingsChanged(SettingsRegistry registry, SettingsRegistry.SettingKey key); 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/core/gui/GuiFactory.java: -------------------------------------------------------------------------------- 1 | // 1.12.2 and below 2 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/core/gui/GuiReplayButton.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.core.gui; 2 | 3 | import com.replaymod.core.ReplayMod; 4 | import com.replaymod.gui.GuiRenderer; 5 | import com.replaymod.gui.RenderInfo; 6 | import com.replaymod.gui.element.GuiButton; 7 | import de.johni0702.minecraft.gui.utils.lwjgl.ReadableDimension; 8 | 9 | public class GuiReplayButton extends GuiButton { 10 | @Override 11 | public void draw(GuiRenderer renderer, ReadableDimension size, RenderInfo renderInfo) { 12 | super.draw(renderer, size, renderInfo); 13 | 14 | renderer.bindTexture(ReplayMod.LOGO_FAVICON); 15 | renderer.drawTexturedRect(3, 3, 0, 0, size.getWidth() - 6, size.getHeight() - 6, 1, 1, 1, 1); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/core/gui/ModMenuApiImpl.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/src/main/java/com/replaymod/core/gui/ModMenuApiImpl.java -------------------------------------------------------------------------------- /src/main/java/com/replaymod/core/utils/ModInfoGetter.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.core.utils; 2 | 3 | import com.replaymod.replaystudio.data.ModInfo; 4 | import net.minecraftforge.fml.ModList; 5 | 6 | import java.util.Collection; 7 | import java.util.stream.Collectors; 8 | 9 | class ModInfoGetter { 10 | static Collection getInstalledNetworkMods() { 11 | return ModList.get().getMods().stream() 12 | .map(mod -> new ModInfo(mod.getModId(), mod.getModId(), mod.getVersion().toString())) 13 | .collect(Collectors.toList()); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/core/utils/Patterns.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.core.utils; 2 | 3 | import java.util.regex.Pattern; 4 | 5 | public class Patterns { 6 | public static final Pattern ALPHANUMERIC_UNDERSCORE = Pattern.compile("^[a-z0-9_]*$", Pattern.CASE_INSENSITIVE); 7 | public static final Pattern ALPHANUMERIC_COMMA = Pattern.compile("^[a-z0-9,]*$", Pattern.CASE_INSENSITIVE); 8 | public static final Pattern ALPHANUMERIC_SPACE_HYPHEN_UNDERSCORE = Pattern.compile("^[a-z0-9 \\-_]*$", Pattern.CASE_INSENSITIVE); 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/core/utils/WrappedTimer.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.core.utils; 2 | 3 | import com.replaymod.mixin.TimerAccessor; 4 | import net.minecraft.util.Timer; 5 | 6 | public class WrappedTimer extends Timer { 7 | public static final float DEFAULT_MS_PER_TICK = 1000 / 20; 8 | 9 | protected final Timer wrapped; 10 | 11 | public WrappedTimer(Timer wrapped) { 12 | super(0, 0); 13 | this.wrapped = wrapped; 14 | copy(wrapped, this); 15 | } 16 | 17 | @Override 18 | public int 19 | getPartialTicks( 20 | long sysClock 21 | ) { 22 | copy(this, wrapped); 23 | try { 24 | return 25 | wrapped.getPartialTicks( 26 | sysClock 27 | ); 28 | } finally { 29 | copy(wrapped, this); 30 | } 31 | } 32 | 33 | protected void copy(Timer from, Timer to) { 34 | TimerAccessor fromA = (TimerAccessor) from; 35 | TimerAccessor toA = (TimerAccessor) to; 36 | 37 | to.renderPartialTicks = from.renderPartialTicks; 38 | toA.setLastSyncSysClock(fromA.getLastSyncSysClock()); 39 | to.elapsedPartialTicks = from.elapsedPartialTicks; 40 | toA.setTickLength(fromA.getTickLength()); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/core/versions/BufferBuilder.java: -------------------------------------------------------------------------------- 1 | // 1.7.10 and below 2 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/core/versions/GLFW.java: -------------------------------------------------------------------------------- 1 | // 1.12.2 and below 2 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/core/versions/Window.java: -------------------------------------------------------------------------------- 1 | // 1.12.2 and below 2 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/core/versions/forge/Patterns.java: -------------------------------------------------------------------------------- 1 | // 1.12.2 and before 2 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/core/versions/scheduler/Scheduler.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.core.versions.scheduler; 2 | 3 | import java.util.concurrent.ExecutionException; 4 | import java.util.concurrent.TimeoutException; 5 | 6 | public interface Scheduler { 7 | /** 8 | * Execute the given runnable on the main client thread, returning only after it has been run (or after 30 seconds). 9 | */ 10 | void runSync(Runnable runnable) throws InterruptedException, ExecutionException, TimeoutException; 11 | 12 | /** 13 | * Execute the given runnable after game has started (once the overlay has been closed). 14 | * Most importantly, it will run after resources (including language keys!) have been loaded. 15 | * Below 1.14, this is equivalent to {@link #runLater(Runnable)}. 16 | */ 17 | void runPostStartup(Runnable runnable); 18 | 19 | /** 20 | * Pre-1.14 MC would hold the lock on the scheduledTasks queue while executing its tasks 21 | * such that no new tasks could be submitted while one of them was running. 22 | * This would cause issues with long-running tasks (e.g. video rendering) as it would 23 | * block all async tasks (e.g. skin loading). 24 | */ 25 | void runLaterWithoutLock(Runnable runnable); 26 | 27 | void runLater(Runnable runnable); 28 | 29 | void runTasks(); 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/editor/ReplayModEditor.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.editor; 2 | 3 | import com.replaymod.core.Module; 4 | import com.replaymod.core.ReplayMod; 5 | import com.replaymod.editor.handler.GuiHandler; 6 | import org.apache.logging.log4j.LogManager; 7 | import org.apache.logging.log4j.Logger; 8 | 9 | public class ReplayModEditor implements Module { 10 | { 11 | instance = this; 12 | } 13 | 14 | public static ReplayModEditor instance; 15 | 16 | private ReplayMod core; 17 | 18 | public static Logger LOGGER = LogManager.getLogger(); 19 | 20 | public ReplayModEditor(ReplayMod core) { 21 | this.core = core; 22 | } 23 | 24 | @Override 25 | public void initClient() { 26 | new GuiHandler().register(); 27 | } 28 | 29 | public ReplayMod getCore() { 30 | return core; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/extras/Extra.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.extras; 2 | 3 | import com.replaymod.core.ReplayMod; 4 | 5 | public interface Extra { 6 | void register(ReplayMod mod) throws Exception; 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/extras/Setting.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.extras; 2 | 3 | import com.replaymod.core.SettingsRegistry; 4 | 5 | import java.util.Arrays; 6 | import java.util.stream.Collectors; 7 | 8 | public final class Setting { 9 | public static final SettingsRegistry.SettingKey ASK_FOR_OPEN_EYE = 10 | new SettingsRegistry.SettingKeys<>("advanced", "askForOpenEye", null, true); 11 | public static final SettingsRegistry.SettingKey SKIP_POST_SCREENSHOT_GUI = 12 | new SettingsRegistry.SettingKeys<>("advanced", "skipPostScreenshotGui", null, false); 13 | public static final SettingsRegistry.MultipleChoiceSettingKeys FULL_BRIGHTNESS = new SettingsRegistry.MultipleChoiceSettingKeys<>( 14 | "advanced", "fullBrightness", "replaymod.gui.settings.fullbrightness", 15 | FullBrightness.Type.Gamma.toString()); 16 | 17 | static { 18 | FULL_BRIGHTNESS.setChoices(Arrays.stream(FullBrightness.Type.values()).map(Object::toString).collect(Collectors.toList())); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/extras/advancedscreenshots/AdvancedScreenshots.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.extras.advancedscreenshots; 2 | 3 | import com.replaymod.core.ReplayMod; 4 | import com.replaymod.extras.Extra; 5 | 6 | public class AdvancedScreenshots implements Extra { 7 | 8 | private ReplayMod mod; 9 | 10 | @Override 11 | public void register(ReplayMod mod) { 12 | this.mod = mod; 13 | } 14 | 15 | private static AdvancedScreenshots instance; 16 | 17 | { 18 | instance = this; 19 | } 20 | 21 | public static void take() { 22 | if (instance != null) { 23 | instance.takeScreenshot(); 24 | } 25 | } 26 | 27 | private void takeScreenshot() { 28 | ReplayMod.instance.runLater(() -> new GuiCreateScreenshot(mod).open()); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/extras/youtube/VideoVisibility.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.extras.youtube; 2 | 3 | import net.minecraft.client.resources.I18n; 4 | 5 | public enum VideoVisibility { 6 | PUBLIC, UNLISTED, PRIVATE; 7 | 8 | @Override 9 | public String toString() { 10 | return I18n.format("replaymod.gui.videovisibility." + name().toLowerCase()); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/gradle/remap/Pattern.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.gradle.remap; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | @Retention(RetentionPolicy.SOURCE) 9 | @Target(ElementType.METHOD) 10 | public @interface Pattern { 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/gui/element/GuiTooltip.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of jGui API, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2016 johni0702 5 | * Copyright (c) contributors 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy 8 | * of this software and associated documentation files (the "Software"), to deal 9 | * in the Software without restriction, including without limitation the rights 10 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the Software is 12 | * furnished to do so, subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in 15 | * all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | * THE SOFTWARE. 24 | */ 25 | package com.replaymod.gui.element; 26 | 27 | public class GuiTooltip extends AbstractGuiTooltip { 28 | @Override 29 | protected GuiTooltip getThis() { 30 | return this; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/gui/element/IGuiCheckbox.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of jGui API, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2016 johni0702 5 | * Copyright (c) contributors 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy 8 | * of this software and associated documentation files (the "Software"), to deal 9 | * in the Software without restriction, including without limitation the rights 10 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the Software is 12 | * furnished to do so, subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in 15 | * all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | * THE SOFTWARE. 24 | */ 25 | package com.replaymod.gui.element; 26 | 27 | public interface IGuiCheckbox> extends IGuiClickable { 28 | T setLabel(String label); 29 | 30 | T setI18nLabel(String label, Object... args); 31 | 32 | T setChecked(boolean checked); 33 | 34 | String getLabel(); 35 | 36 | boolean isChecked(); 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/gui/element/IGuiClickable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of jGui API, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2016 johni0702 5 | * Copyright (c) contributors 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy 8 | * of this software and associated documentation files (the "Software"), to deal 9 | * in the Software without restriction, including without limitation the rights 10 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the Software is 12 | * furnished to do so, subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in 15 | * all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | * THE SOFTWARE. 24 | */ 25 | package com.replaymod.gui.element; 26 | 27 | public interface IGuiClickable> extends GuiElement { 28 | T onClick(Runnable onClick); 29 | 30 | Runnable getOnClick(); 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/gui/element/IGuiToggleButton.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of jGui API, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2016 johni0702 5 | * Copyright (c) contributors 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy 8 | * of this software and associated documentation files (the "Software"), to deal 9 | * in the Software without restriction, including without limitation the rights 10 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the Software is 12 | * furnished to do so, subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in 15 | * all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | * THE SOFTWARE. 24 | */ 25 | package com.replaymod.gui.element; 26 | 27 | public interface IGuiToggleButton> extends IGuiButton { 28 | T setValues(V[] values); 29 | 30 | T setSelected(int selected); 31 | 32 | V getSelectedValue(); 33 | 34 | int getSelected(); 35 | 36 | V[] getValues(); 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/gui/function/Clickable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of jGui API, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2016 johni0702 5 | * Copyright (c) contributors 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy 8 | * of this software and associated documentation files (the "Software"), to deal 9 | * in the Software without restriction, including without limitation the rights 10 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the Software is 12 | * furnished to do so, subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in 15 | * all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | * THE SOFTWARE. 24 | */ 25 | package com.replaymod.gui.function; 26 | 27 | import de.johni0702.minecraft.gui.utils.lwjgl.ReadablePoint; 28 | 29 | public interface Clickable { 30 | boolean mouseClick(ReadablePoint position, int button); 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/gui/function/Closeable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of jGui API, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2016 johni0702 5 | * Copyright (c) contributors 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy 8 | * of this software and associated documentation files (the "Software"), to deal 9 | * in the Software without restriction, including without limitation the rights 10 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the Software is 12 | * furnished to do so, subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in 15 | * all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | * THE SOFTWARE. 24 | */ 25 | package com.replaymod.gui.function; 26 | 27 | public interface Closeable { 28 | void close(); 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/gui/function/Draggable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of jGui API, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2016 johni0702 5 | * Copyright (c) contributors 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy 8 | * of this software and associated documentation files (the "Software"), to deal 9 | * in the Software without restriction, including without limitation the rights 10 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the Software is 12 | * furnished to do so, subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in 15 | * all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | * THE SOFTWARE. 24 | */ 25 | package com.replaymod.gui.function; 26 | 27 | import de.johni0702.minecraft.gui.utils.lwjgl.ReadablePoint; 28 | 29 | public interface Draggable extends Clickable { 30 | boolean mouseDrag(ReadablePoint position, int button, @Deprecated long timeSinceLastCall); 31 | 32 | boolean mouseRelease(ReadablePoint position, int button); 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/gui/function/Loadable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of jGui API, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2016 johni0702 5 | * Copyright (c) contributors 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy 8 | * of this software and associated documentation files (the "Software"), to deal 9 | * in the Software without restriction, including without limitation the rights 10 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the Software is 12 | * furnished to do so, subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in 15 | * all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | * THE SOFTWARE. 24 | */ 25 | package com.replaymod.gui.function; 26 | 27 | public interface Loadable { 28 | void load(); 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/gui/function/Tickable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of jGui API, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2016 johni0702 5 | * Copyright (c) contributors 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy 8 | * of this software and associated documentation files (the "Software"), to deal 9 | * in the Software without restriction, including without limitation the rights 10 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the Software is 12 | * furnished to do so, subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in 15 | * all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | * THE SOFTWARE. 24 | */ 25 | package com.replaymod.gui.function; 26 | 27 | public interface Tickable { 28 | void tick(); 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/gui/function/Typeable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of jGui API, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2016 johni0702 5 | * Copyright (c) contributors 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy 8 | * of this software and associated documentation files (the "Software"), to deal 9 | * in the Software without restriction, including without limitation the rights 10 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the Software is 12 | * furnished to do so, subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in 15 | * all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | * THE SOFTWARE. 24 | */ 25 | package com.replaymod.gui.function; 26 | 27 | import de.johni0702.minecraft.gui.utils.lwjgl.ReadablePoint; 28 | 29 | public interface Typeable { 30 | boolean typeKey(ReadablePoint mousePosition, int keyCode, char keyChar, boolean ctrlDown, boolean shiftDown); 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/gui/layout/LayoutData.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of jGui API, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2016 johni0702 5 | * Copyright (c) contributors 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy 8 | * of this software and associated documentation files (the "Software"), to deal 9 | * in the Software without restriction, including without limitation the rights 10 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the Software is 12 | * furnished to do so, subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in 15 | * all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | * THE SOFTWARE. 24 | */ 25 | package com.replaymod.gui.layout; 26 | 27 | public interface LayoutData { 28 | LayoutData NONE = VoidLayoutData.INSTANCE; 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/gui/layout/VoidLayoutData.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of jGui API, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2016 johni0702 5 | * Copyright (c) contributors 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy 8 | * of this software and associated documentation files (the "Software"), to deal 9 | * in the Software without restriction, including without limitation the rights 10 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the Software is 12 | * furnished to do so, subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in 15 | * all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | * THE SOFTWARE. 24 | */ 25 | package com.replaymod.gui.layout; 26 | 27 | public class VoidLayoutData implements LayoutData { 28 | public static final VoidLayoutData INSTANCE = new VoidLayoutData(); 29 | 30 | private VoidLayoutData() { 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/gui/utils/Consumer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of jGui API, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2016 johni0702 5 | * Copyright (c) contributors 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy 8 | * of this software and associated documentation files (the "Software"), to deal 9 | * in the Software without restriction, including without limitation the rights 10 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the Software is 12 | * furnished to do so, subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in 15 | * all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | * THE SOFTWARE. 24 | */ 25 | package com.replaymod.gui.utils; 26 | 27 | public interface Consumer { 28 | void consume(T obj); 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/gui/utils/Consumers.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of jGui API, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2016 johni0702 5 | * Copyright (c) contributors 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy 8 | * of this software and associated documentation files (the "Software"), to deal 9 | * in the Software without restriction, including without limitation the rights 10 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the Software is 12 | * furnished to do so, subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in 15 | * all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | * THE SOFTWARE. 24 | */ 25 | package com.replaymod.gui.utils; 26 | 27 | public class Consumers { 28 | public static com.replaymod.gui.utils.Consumer from(final Runnable runnable) { 29 | return new Consumer() { 30 | @Override 31 | public void consume(U obj) { 32 | runnable.run(); 33 | } 34 | }; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/gui/utils/Event.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.gui.utils; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | import java.util.function.Function; 6 | 7 | public class Event { 8 | public static Event create(Function, T> invokerFactory) { 9 | return new Event<>(invokerFactory); 10 | } 11 | 12 | private T invoker; 13 | private Function, T> invokerFactory; 14 | private List listeners = new ArrayList<>(); 15 | 16 | private Event(Function, T> invokerFactory) { 17 | this.invokerFactory = invokerFactory; 18 | update(); 19 | } 20 | 21 | void register(T listener) { 22 | listeners.add(listener); 23 | update(); 24 | } 25 | 26 | void unregister(T listener) { 27 | listeners.remove(listener); 28 | update(); 29 | } 30 | 31 | private void update() { 32 | invoker = invokerFactory.apply(new ArrayList<>(listeners)); 33 | } 34 | 35 | public T invoker() { 36 | return invoker; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/gui/utils/EventRegistration.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.gui.utils; 2 | 3 | public class EventRegistration { 4 | public static EventRegistration create(Event event, T callback) { 5 | return new EventRegistration<>(event, callback); 6 | } 7 | 8 | public static EventRegistration register(Event event, T callback) { 9 | EventRegistration registration = new EventRegistration<>(event, callback); 10 | registration.register(); 11 | return registration; 12 | } 13 | 14 | private final Event event; 15 | private final T listener; 16 | private boolean registered; 17 | 18 | private EventRegistration(Event event, T listener) { 19 | this.event = event; 20 | this.listener = listener; 21 | } 22 | 23 | public void register() { 24 | if (registered) { 25 | throw new IllegalStateException(); 26 | } 27 | 28 | event.register(listener); 29 | registered = true; 30 | } 31 | 32 | public void unregister() { 33 | if (!registered) { 34 | throw new IllegalStateException(); 35 | } 36 | 37 | event.unregister(listener); 38 | registered = false; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/gui/utils/EventRegistrations.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.gui.utils; 2 | 3 | import com.replaymod.gui.versions.forge.EventsAdapter; 4 | import net.minecraftforge.common.MinecraftForge; 5 | 6 | import java.util.ArrayList; 7 | import java.util.List; 8 | 9 | public class EventRegistrations { 10 | static { 11 | new EventsAdapter().register(); 12 | } 13 | 14 | private List> registrations = new ArrayList<>(); 15 | 16 | public EventRegistrations on(EventRegistration registration) { 17 | registrations.add(registration); 18 | return this; 19 | } 20 | 21 | public EventRegistrations on(Event event, T listener) { 22 | return on(EventRegistration.create(event, listener)); 23 | } 24 | 25 | public void register() { 26 | MinecraftForge.EVENT_BUS.register(this); 27 | for (EventRegistration registration : registrations) { 28 | registration.register(); 29 | } 30 | } 31 | 32 | public void unregister() { 33 | MinecraftForge.EVENT_BUS.unregister(this); 34 | for (EventRegistration registration : registrations) { 35 | registration.unregister(); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/gui/utils/NonNull.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.gui.utils; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Target; 5 | 6 | @Target({ElementType.FIELD, ElementType.LOCAL_VARIABLE, ElementType.METHOD, ElementType.PARAMETER}) 7 | public @interface NonNull { 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/gui/versions/MatrixStack.java: -------------------------------------------------------------------------------- 1 | // MC < 1.15 2 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/gui/versions/callbacks/InitScreenCallback.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.gui.versions.callbacks; 2 | 3 | import com.replaymod.gui.utils.Event; 4 | import net.minecraft.client.gui.screen.Screen; 5 | import net.minecraft.client.gui.widget.Widget; 6 | 7 | import java.util.List; 8 | 9 | public interface InitScreenCallback { 10 | Event EVENT = Event.create((listeners) -> 11 | (screen, buttons) -> { 12 | for (InitScreenCallback listener : listeners) { 13 | listener.initScreen(screen, buttons); 14 | } 15 | } 16 | ); 17 | 18 | void initScreen(Screen screen, List buttons); 19 | 20 | interface Pre { 21 | Event EVENT = Event.create((listeners) -> 22 | (screen) -> { 23 | for (InitScreenCallback.Pre listener : listeners) { 24 | listener.preInitScreen(screen); 25 | } 26 | } 27 | ); 28 | 29 | void preInitScreen(Screen screen); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/gui/versions/callbacks/OpenGuiScreenCallback.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.gui.versions.callbacks; 2 | 3 | import com.replaymod.gui.utils.Event; 4 | import net.minecraft.client.gui.screen.Screen; 5 | 6 | public interface OpenGuiScreenCallback { 7 | Event EVENT = Event.create((listeners) -> 8 | (screen) -> { 9 | for (OpenGuiScreenCallback listener : listeners) { 10 | listener.openGuiScreen(screen); 11 | } 12 | } 13 | ); 14 | 15 | void openGuiScreen(Screen screen); 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/gui/versions/callbacks/PostRenderScreenCallback.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.gui.versions.callbacks; 2 | 3 | import com.mojang.blaze3d.matrix.MatrixStack; 4 | import com.replaymod.gui.utils.Event; 5 | 6 | public interface PostRenderScreenCallback { 7 | Event EVENT = Event.create((listeners) -> 8 | (stack, partialTicks) -> { 9 | for (PostRenderScreenCallback listener : listeners) { 10 | listener.postRenderScreen(stack, partialTicks); 11 | } 12 | } 13 | ); 14 | 15 | void postRenderScreen(MatrixStack stack, float partialTicks); 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/gui/versions/callbacks/PreTickCallback.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.gui.versions.callbacks; 2 | 3 | import com.replaymod.gui.utils.Event; 4 | 5 | public interface PreTickCallback { 6 | Event EVENT = Event.create((listeners) -> 7 | () -> { 8 | for (PreTickCallback listener : listeners) { 9 | listener.preTick(); 10 | } 11 | } 12 | ); 13 | 14 | void preTick(); 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/gui/versions/callbacks/RenderHudCallback.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.gui.versions.callbacks; 2 | 3 | import com.mojang.blaze3d.matrix.MatrixStack; 4 | import com.replaymod.gui.utils.Event; 5 | 6 | public interface RenderHudCallback { 7 | Event EVENT = Event.create((listeners) -> 8 | (stack, partialTicks) -> { 9 | for (RenderHudCallback listener : listeners) { 10 | listener.renderHud(stack, partialTicks); 11 | } 12 | } 13 | ); 14 | 15 | void renderHud(MatrixStack stack, float partialTicks); 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/AbstractButtonWidgetAccessor.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.mixin; 2 | 3 | import net.minecraft.client.gui.widget.Widget; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | @Mixin(Widget.class) 8 | public interface AbstractButtonWidgetAccessor { 9 | @Accessor 10 | int getHeight(); 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/AddServerScreenAccessor.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.mixin; 2 | 3 | import net.minecraft.client.gui.screen.AddServerScreen; 4 | import net.minecraft.client.multiplayer.ServerData; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.gen.Accessor; 7 | 8 | @Mixin(AddServerScreen.class) 9 | public interface AddServerScreenAccessor { 10 | @Accessor("serverData") 11 | ServerData getServer(); 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/ChunkRenderDispatcherAccessor.java: -------------------------------------------------------------------------------- 1 | // 1.14.4 to 1.8 2 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/ContainerLocalRenderInformationAccessor.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/src/main/java/com/replaymod/mixin/ContainerLocalRenderInformationAccessor.java -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/EntityAccessor.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/src/main/java/com/replaymod/mixin/EntityAccessor.java -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/EntityLivingBaseAccessor.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.mixin; 2 | 3 | import net.minecraft.entity.LivingEntity; 4 | import net.minecraft.network.datasync.DataParameter; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.gen.Accessor; 7 | 8 | import javax.annotation.Nonnull; 9 | 10 | @Mixin(LivingEntity.class) 11 | public interface EntityLivingBaseAccessor { 12 | @Accessor("LIVING_FLAGS") 13 | @Nonnull 14 | @SuppressWarnings("ConstantConditions") 15 | static DataParameter getLivingFlags() { 16 | return null; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/EntityOtherPlayerMPAccessor.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/src/main/java/com/replaymod/mixin/EntityOtherPlayerMPAccessor.java -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/EntityPlayerAccessor.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.mixin; 2 | 3 | import net.minecraft.entity.player.PlayerEntity; 4 | import net.minecraft.item.ItemStack; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.gen.Accessor; 7 | 8 | @Mixin(PlayerEntity.class) 9 | public interface EntityPlayerAccessor extends Mixin_EntityLivingBaseAccessor { 10 | @Accessor 11 | ItemStack getItemStackMainHand(); 12 | 13 | @Accessor 14 | void setItemStackMainHand(ItemStack value); 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/FirstPersonRendererAccessor.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.mixin; 2 | 3 | import net.minecraft.client.renderer.FirstPersonRenderer; 4 | import net.minecraft.item.ItemStack; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.gen.Accessor; 7 | 8 | @Mixin(FirstPersonRenderer.class) 9 | public interface FirstPersonRendererAccessor { 10 | @Accessor 11 | void setItemStackMainHand(ItemStack value); 12 | 13 | @Accessor 14 | void setItemStackOffHand(ItemStack value); 15 | 16 | @Accessor 17 | void setEquippedProgressMainHand(float value); 18 | 19 | @Accessor 20 | void setPrevEquippedProgressMainHand(float value); 21 | 22 | @Accessor 23 | void setEquippedProgressOffHand(float value); 24 | 25 | @Accessor 26 | void setPrevEquippedProgressOffHand(float value); 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/GuiMainMenuAccessor.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.mixin; 2 | 3 | import net.minecraft.client.gui.screen.MainMenuScreen; 4 | import net.minecraft.client.gui.screen.Screen; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.gen.Accessor; 7 | 8 | @Mixin(MainMenuScreen.class) 9 | public interface GuiMainMenuAccessor { 10 | @Accessor 11 | Screen getRealmsNotification(); 12 | 13 | @Accessor 14 | void setRealmsNotification(Screen value); 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/GuiScreenAccessor.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.mixin; 2 | 3 | import net.minecraft.client.gui.IGuiEventListener; 4 | import net.minecraft.client.gui.screen.Screen; 5 | import net.minecraft.client.gui.widget.Widget; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.gen.Accessor; 8 | 9 | import java.util.List; 10 | 11 | @Mixin(Screen.class) 12 | public interface GuiScreenAccessor { 13 | @Accessor 14 | List getButtons(); 15 | 16 | @Accessor 17 | List getChildren(); 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/IntegratedServerAccessor.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.mixin; 2 | 3 | import net.minecraft.server.integrated.IntegratedServer; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | @Mixin(IntegratedServer.class) 8 | public interface IntegratedServerAccessor { 9 | // TODO probably https://github.com/ReplayMod/remap/issues/10 10 | @Accessor("isGamePaused") 11 | boolean isGamePaused(); 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/ItemRendererAccessor.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.mixin; 2 | 3 | import net.minecraft.client.renderer.ItemRenderer; 4 | import net.minecraft.client.renderer.color.ItemColors; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.gen.Accessor; 7 | 8 | @Mixin(ItemRenderer.class) 9 | public interface ItemRendererAccessor { 10 | @Accessor 11 | ItemColors getItemColors(); 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/KeyBindingAccessor.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.mixin; 2 | 3 | import net.minecraft.client.settings.KeyBinding; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | @Mixin(KeyBinding.class) 8 | public interface KeyBindingAccessor { 9 | @Accessor 10 | int getPressTime(); 11 | 12 | @Accessor 13 | void setPressTime(int value); 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/MainWindowAccessor.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.mixin; 2 | 3 | import net.minecraft.client.MainWindow; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | @Mixin(MainWindow.class) 8 | public interface MainWindowAccessor { 9 | @Accessor 10 | int getFramebufferWidth(); 11 | 12 | @Accessor 13 | void setFramebufferWidth(int value); 14 | 15 | @Accessor 16 | int getFramebufferHeight(); 17 | 18 | @Accessor 19 | void setFramebufferHeight(int value); 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/MinecraftAccessor.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.mixin; 2 | 3 | import net.minecraft.client.Minecraft; 4 | import net.minecraft.crash.CrashReport; 5 | import net.minecraft.util.Timer; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.gen.Accessor; 8 | 9 | import java.util.Queue; 10 | import java.util.concurrent.CompletableFuture; 11 | 12 | 13 | @Mixin(Minecraft.class) 14 | public interface MinecraftAccessor { 15 | @Accessor 16 | Timer getTimer(); 17 | 18 | @Accessor 19 | void setTimer(Timer value); 20 | 21 | @Accessor("futureRefreshResources") 22 | CompletableFuture getResourceReloadFuture(); 23 | 24 | @Accessor("futureRefreshResources") 25 | void setResourceReloadFuture(CompletableFuture value); 26 | 27 | @Accessor("queueChunkTracking") 28 | Queue getRenderTaskQueue(); 29 | 30 | @Accessor 31 | CrashReport getCrashReporter(); 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/MixinCamera.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.mixin; 2 | 3 | import com.mojang.blaze3d.matrix.MatrixStack; 4 | import com.replaymod.replay.camera.CameraEntity; 5 | import net.minecraft.client.Minecraft; 6 | import net.minecraft.client.renderer.GameRenderer; 7 | import net.minecraft.entity.Entity; 8 | import net.minecraft.util.math.vector.Vector3f; 9 | import org.spongepowered.asm.mixin.Final; 10 | import org.spongepowered.asm.mixin.Mixin; 11 | import org.spongepowered.asm.mixin.Shadow; 12 | import org.spongepowered.asm.mixin.injection.At; 13 | import org.spongepowered.asm.mixin.injection.Inject; 14 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 15 | 16 | @Mixin(GameRenderer.class) 17 | public class MixinCamera { 18 | @Shadow 19 | @Final 20 | private Minecraft mc; 21 | 22 | @Inject( 23 | method = "renderWorld", 24 | at = @At( 25 | value = "INVOKE", 26 | target = "Lnet/minecraft/client/renderer/ActiveRenderInfo;getPitch()F" 27 | ) 28 | ) 29 | private void applyRoll(float float_1, long long_1, MatrixStack matrixStack, CallbackInfo ci) { 30 | Entity entity = this.mc.getRenderViewEntity() == null ? this.mc.player : this.mc.getRenderViewEntity(); 31 | if (entity instanceof CameraEntity) { 32 | matrixStack.rotate(Vector3f.ZP.rotationDegrees(((CameraEntity) entity).roll)); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/MixinChunkRenderWorker.java: -------------------------------------------------------------------------------- 1 | // 1.14.4 - 1.8 2 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/MixinChunkVisibility.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.mixin; 2 | 3 | import org.spongepowered.asm.mixin.Mixin; 4 | import org.spongepowered.asm.mixin.Pseudo; 5 | import org.spongepowered.asm.mixin.Shadow; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.Inject; 8 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 9 | 10 | @Pseudo 11 | @Mixin(targets = "net/optifine/render/ChunkVisibility", remap = false) 12 | public abstract class MixinChunkVisibility { 13 | @Shadow 14 | private static int counter; 15 | 16 | /** 17 | * OF doesn't properly reset the counter when exiting a world. 18 | * It'll only be reset when getMaxChunkY is called which only happens for 19 | * SP worlds (i.e. not in a replay or MP). 20 | * As a result, it may end up in a non-0 state, which will cause isFinished 21 | * to unconditionally return false, therefore unconditionally setting 22 | * needsTerrainUpdate to true on each call to WorldRenderer.setupTerrain, 23 | * therefore unnecessarily consuming resources and live-locking when 24 | * rendering the shader pass. 25 | */ 26 | @Inject(method = "reset", at = @At("HEAD"), remap = false) 27 | private static void replayModCompat_fixImproperReset(CallbackInfo ci) { 28 | MixinChunkVisibility.counter = 0; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/MixinDownloadingPackFinder.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.mixin; 2 | 3 | import com.replaymod.gui.utils.Consumer; 4 | import com.replaymod.recording.packet.ResourcePackRecorder; 5 | import net.minecraft.client.resources.DownloadingPackFinder; 6 | import net.minecraft.resources.IPackNameDecorator; 7 | import org.spongepowered.asm.mixin.Mixin; 8 | import org.spongepowered.asm.mixin.injection.At; 9 | import org.spongepowered.asm.mixin.injection.Inject; 10 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 11 | 12 | import java.io.File; 13 | 14 | @Mixin(DownloadingPackFinder.class) 15 | public abstract class MixinDownloadingPackFinder implements ResourcePackRecorder.IDownloadingPackFinder { 16 | private Consumer requestCallback; 17 | 18 | @Override 19 | public void setRequestCallback(Consumer callback) { 20 | requestCallback = callback; 21 | } 22 | 23 | @Inject(method = "setServerPack", at = @At("HEAD")) 24 | private void recordDownloadedPack( 25 | File file, 26 | IPackNameDecorator arg, 27 | CallbackInfoReturnable ci 28 | ) { 29 | if (requestCallback != null) { 30 | requestCallback.consume(file); 31 | requestCallback = null; 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/MixinEffectRenderer.java: -------------------------------------------------------------------------------- 1 | // 1.8.9 and below 2 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/MixinEntityRenderer.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.mixin; 2 | 3 | import com.replaymod.render.hooks.EntityRendererHandler; 4 | import net.minecraft.client.renderer.GameRenderer; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | 7 | @Mixin(GameRenderer.class) 8 | public abstract class MixinEntityRenderer implements EntityRendererHandler.IEntityRenderer { 9 | private EntityRendererHandler replayModRender_handler; 10 | 11 | @Override 12 | public void replayModRender_setHandler(EntityRendererHandler handler) { 13 | this.replayModRender_handler = handler; 14 | } 15 | 16 | @Override 17 | public EntityRendererHandler replayModRender_getHandler() { 18 | return replayModRender_handler; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/MixinFMLClientHandler.java: -------------------------------------------------------------------------------- 1 | // 1.7.10 and below 2 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/MixinGameRenderer.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.mixin; 2 | 3 | import com.mojang.blaze3d.matrix.MatrixStack; 4 | import com.replaymod.core.events.PostRenderWorldCallback; 5 | import com.replaymod.core.events.PreRenderHandCallback; 6 | import net.minecraft.client.renderer.ActiveRenderInfo; 7 | import net.minecraft.client.renderer.GameRenderer; 8 | import org.spongepowered.asm.mixin.Mixin; 9 | import org.spongepowered.asm.mixin.injection.At; 10 | import org.spongepowered.asm.mixin.injection.Inject; 11 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 12 | 13 | @Mixin(GameRenderer.class) 14 | public class MixinGameRenderer { 15 | @Inject( 16 | method = "renderWorld", 17 | at = @At( 18 | value = "FIELD", 19 | target = "Lnet/minecraft/client/renderer/GameRenderer;renderHand:Z" 20 | ) 21 | ) 22 | private void postRenderWorld( 23 | float partialTicks, 24 | long nanoTime, 25 | MatrixStack matrixStack, 26 | CallbackInfo ci) { 27 | PostRenderWorldCallback.EVENT.invoker().postRenderWorld(matrixStack); 28 | } 29 | 30 | @Inject(method = "renderHand", at = @At("HEAD"), cancellable = true) 31 | private void preRenderHand( 32 | MatrixStack matrixStack, 33 | ActiveRenderInfo camera, 34 | float partialTicks, 35 | CallbackInfo ci) { 36 | if (PreRenderHandCallback.EVENT.invoker().preRenderHand()) { 37 | ci.cancel(); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/MixinGlStateManager.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.mixin; 2 | 3 | import com.mojang.blaze3d.platform.GlStateManager; 4 | import com.replaymod.render.hooks.FogStateCallback; 5 | import com.replaymod.render.hooks.Texture2DStateCallback; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.Shadow; 8 | import org.spongepowered.asm.mixin.injection.At; 9 | import org.spongepowered.asm.mixin.injection.Inject; 10 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 11 | 12 | @Mixin(GlStateManager.class) 13 | public abstract class MixinGlStateManager { 14 | @Shadow 15 | private static int activeTexture; 16 | 17 | @Inject(method = "enableFog", at = @At("HEAD")) 18 | private static void enableFog(CallbackInfo ci) { 19 | FogStateCallback.EVENT.invoker().fogStateChanged(true); 20 | } 21 | 22 | @Inject(method = "disableFog", at = @At("HEAD")) 23 | private static void disableFog(CallbackInfo ci) { 24 | FogStateCallback.EVENT.invoker().fogStateChanged(false); 25 | } 26 | 27 | @Inject(method = "enableTexture", at = @At("HEAD")) 28 | private static void enableTexture(CallbackInfo ci) { 29 | Texture2DStateCallback.EVENT.invoker().texture2DStateChanged(MixinGlStateManager.activeTexture, true); 30 | } 31 | 32 | @Inject(method = "disableTexture", at = @At("HEAD")) 33 | private static void disableTexture(CallbackInfo ci) { 34 | Texture2DStateCallback.EVENT.invoker().texture2DStateChanged(MixinGlStateManager.activeTexture, false); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/MixinGuiScreen.java: -------------------------------------------------------------------------------- 1 | // 1.7.10 and below 2 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/MixinGuiSpectator.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.mixin; 2 | 3 | import com.replaymod.replay.camera.CameraEntity; 4 | import net.minecraft.client.gui.SpectatorGui; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.Inject; 8 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 9 | 10 | import static com.replaymod.core.versions.MCVer.getMinecraft; 11 | 12 | @Mixin(SpectatorGui.class) 13 | public abstract class MixinGuiSpectator { 14 | @Inject(method = "onMouseScroll", at = @At("HEAD"), cancellable = true) 15 | public void isInReplay( 16 | double i, 17 | CallbackInfo ci 18 | ) { 19 | // Prevent spectator gui from opening while in a replay 20 | if (getMinecraft().player instanceof CameraEntity) { 21 | ci.cancel(); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/MixinInGameHud.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.mixin; 2 | 3 | import com.replaymod.replay.events.RenderHotbarCallback; 4 | import com.replaymod.replay.events.RenderSpectatorCrosshairCallback; 5 | import net.minecraft.client.gui.IngameGui; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Inject; 9 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 10 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 11 | 12 | @Mixin(IngameGui.class) 13 | public class MixinInGameHud { 14 | @Inject(method = "isTargetNamedMenuProvider", at = @At("HEAD"), cancellable = true) 15 | private void shouldRenderSpectatorCrosshair(CallbackInfoReturnable ci) { 16 | Boolean state = RenderSpectatorCrosshairCallback.EVENT.invoker().shouldRenderSpectatorCrosshair(); 17 | if (state != null) { 18 | ci.setReturnValue(state); 19 | } 20 | } 21 | 22 | @Inject(method = "renderHotbar", at = @At("HEAD"), cancellable = true) 23 | private void shouldRenderHotbar(CallbackInfo ci) { 24 | Boolean state = RenderHotbarCallback.EVENT.invoker().shouldRenderHotbar(); 25 | if (state == Boolean.FALSE) { 26 | ci.cancel(); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/MixinKeyboardListener.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.mixin; 2 | 3 | import com.replaymod.core.events.KeyBindingEventCallback; 4 | import com.replaymod.core.events.KeyEventCallback; 5 | import net.minecraft.client.KeyboardListener; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Inject; 9 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 10 | 11 | @Mixin(KeyboardListener.class) 12 | public class MixinKeyboardListener { 13 | private static final String ON_KEY_PRESSED = "Lnet/minecraft/client/settings/KeyBinding;onTick(Lnet/minecraft/client/util/InputMappings$Input;)V"; 14 | 15 | @Inject(method = "onKeyEvent", at = @At(value = "INVOKE", target = ON_KEY_PRESSED), cancellable = true) 16 | private void beforeKeyBindingTick(long windowPointer, int key, int scanCode, int action, int modifiers, CallbackInfo ci) { 17 | if (KeyEventCallback.EVENT.invoker().onKeyEvent(key, scanCode, action, modifiers)) { 18 | ci.cancel(); 19 | } 20 | } 21 | 22 | @Inject(method = "onKeyEvent", at = @At(value = "INVOKE", target = ON_KEY_PRESSED, shift = At.Shift.AFTER)) 23 | private void afterKeyBindingTick(long windowPointer, int key, int scanCode, int action, int modifiers, CallbackInfo ci) { 24 | KeyBindingEventCallback.EVENT.invoker().onKeybindingEvent(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/MixinModelRenderer.java: -------------------------------------------------------------------------------- 1 | // FIXME 1.15 2 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/MixinMouse.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.mixin; 2 | 3 | import com.replaymod.core.events.KeyBindingEventCallback; 4 | import net.minecraft.client.MouseHelper; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.Inject; 8 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 9 | 10 | @Mixin(MouseHelper.class) 11 | public class MixinMouse { 12 | @Inject(method = "mouseButtonCallback", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/settings/KeyBinding;onTick(Lnet/minecraft/client/util/InputMappings$Input;)V", shift = At.Shift.AFTER)) 13 | private void afterKeyBindingTick(CallbackInfo ci) { 14 | KeyBindingEventCallback.EVENT.invoker().onKeybindingEvent(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/MixinMouseListener.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/src/main/java/com/replaymod/mixin/MixinMouseListener.java -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/MixinNetworkDispatcher.java: -------------------------------------------------------------------------------- 1 | // 1.12.2 and below 2 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/MixinOpenGlHelper.java: -------------------------------------------------------------------------------- 1 | // 1.7.10 and below 2 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/MixinPlayerControllerMP.java: -------------------------------------------------------------------------------- 1 | // 1.9.4 - 1.12.2 2 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/MixinRenderArrow.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.mixin; 2 | 3 | import com.replaymod.replay.ReplayModReplay; 4 | import net.minecraft.client.renderer.culling.ClippingHelper; 5 | import net.minecraft.client.renderer.entity.EntityRenderer; 6 | import net.minecraft.client.renderer.entity.EntityRendererManager; 7 | import net.minecraft.client.renderer.entity.TippedArrowRenderer; 8 | import net.minecraft.entity.Entity; 9 | import org.spongepowered.asm.mixin.Mixin; 10 | 11 | @Mixin(TippedArrowRenderer.class) 12 | public abstract class MixinRenderArrow extends EntityRenderer { 13 | protected MixinRenderArrow(EntityRendererManager renderManager) { 14 | super(renderManager); 15 | } 16 | 17 | @SuppressWarnings("unchecked") 18 | @Override 19 | public boolean shouldRender(Entity entity, 20 | ClippingHelper camera, 21 | double camX, double camY, double camZ) { 22 | // Force arrows to always render, otherwise they stop rendering when you get close to them 23 | return ReplayModReplay.instance.getReplayHandler() != null || super.shouldRender(entity, camera, camX, camY, camZ); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/MixinRenderGlobal.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.mixin; 2 | 3 | import com.replaymod.recording.handler.RecordingEventHandler; 4 | import net.minecraft.client.renderer.WorldRenderer; 5 | import net.minecraft.util.math.BlockPos; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Inject; 9 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 10 | 11 | @Mixin(WorldRenderer.class) 12 | public abstract class MixinRenderGlobal implements RecordingEventHandler.RecordingEventSender { 13 | 14 | private RecordingEventHandler recordingEventHandler; 15 | 16 | @Override 17 | public void setRecordingEventHandler(RecordingEventHandler recordingEventHandler) { 18 | this.recordingEventHandler = recordingEventHandler; 19 | } 20 | 21 | @Override 22 | public RecordingEventHandler getRecordingEventHandler() { 23 | return recordingEventHandler; 24 | } 25 | 26 | @Inject(method = "sendBlockBreakProgress", at = @At("HEAD")) 27 | public void saveBlockBreakProgressPacket(int breakerId, 28 | BlockPos pos, 29 | int progress, CallbackInfo info) { 30 | if (recordingEventHandler != null) { 31 | recordingEventHandler.onBlockBreakAnim(breakerId, 32 | pos, 33 | progress); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/MixinRenderItem.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.mixin; 2 | 3 | import com.mojang.blaze3d.matrix.MatrixStack; 4 | import com.mojang.blaze3d.vertex.IVertexBuilder; 5 | import com.replaymod.render.blend.BlendState; 6 | import com.replaymod.render.blend.exporters.ItemExporter; 7 | import net.minecraft.client.renderer.ItemRenderer; 8 | import net.minecraft.client.renderer.model.IBakedModel; 9 | import net.minecraft.item.ItemStack; 10 | import org.spongepowered.asm.mixin.Mixin; 11 | import org.spongepowered.asm.mixin.injection.At; 12 | import org.spongepowered.asm.mixin.injection.Inject; 13 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 14 | 15 | @Mixin(ItemRenderer.class) 16 | public abstract class MixinRenderItem { 17 | @Inject(method = "renderModel", at = @At("HEAD")) 18 | private void onRenderModel(IBakedModel model, ItemStack stack, int int_1, int int_2, MatrixStack matrixStack_1, IVertexBuilder vertexConsumer_1, CallbackInfo ci) { 19 | BlendState blendState = BlendState.getState(); 20 | if (blendState != null) { 21 | blendState.get(ItemExporter.class).onRender(this, model, stack); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/MixinRenderLivingBase.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.mixin; 2 | 3 | import com.replaymod.render.blend.BlendState; 4 | import com.replaymod.render.blend.exporters.EntityExporter; 5 | import net.minecraft.client.renderer.entity.LivingRenderer; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Inject; 9 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 10 | 11 | @Mixin(LivingRenderer.class) 12 | public abstract class MixinRenderLivingBase { 13 | @Inject(method = "render", at = @At( 14 | value = "INVOKE", 15 | target = "Lnet/minecraft/client/renderer/entity/LivingRenderer;preRenderCallback(Lnet/minecraft/entity/LivingEntity;Lcom/mojang/blaze3d/matrix/MatrixStack;F)V", 16 | shift = At.Shift.AFTER 17 | )) 18 | private void recordModelMatrix(CallbackInfo ci) { 19 | BlendState blendState = BlendState.getState(); 20 | if (blendState != null) { 21 | blendState.get(EntityExporter.class).postEntityLivingSetup(); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/MixinS26PacketMapChunkBulk.java: -------------------------------------------------------------------------------- 1 | // 1.7.10 and below 2 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/MixinScreen.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.mixin; 2 | 3 | import com.replaymod.gui.versions.callbacks.InitScreenCallback; 4 | import net.minecraft.client.Minecraft; 5 | import net.minecraft.client.gui.screen.Screen; 6 | import net.minecraft.client.gui.widget.Widget; 7 | import org.spongepowered.asm.mixin.Final; 8 | import org.spongepowered.asm.mixin.Mixin; 9 | import org.spongepowered.asm.mixin.Shadow; 10 | import org.spongepowered.asm.mixin.injection.At; 11 | import org.spongepowered.asm.mixin.injection.Inject; 12 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 13 | 14 | import java.util.List; 15 | 16 | @Mixin(Screen.class) 17 | public class MixinScreen { 18 | @Shadow 19 | protected @Final 20 | List buttons; 21 | 22 | @Inject(method = "init(Lnet/minecraft/client/Minecraft;II)V", at = @At("HEAD")) 23 | private void preInit(Minecraft minecraftClient_1, int int_1, int int_2, CallbackInfo ci) { 24 | InitScreenCallback.Pre.EVENT.invoker().preInitScreen((Screen) (Object) this); 25 | } 26 | 27 | @Inject(method = "init(Lnet/minecraft/client/Minecraft;II)V", at = @At("RETURN")) 28 | private void init(Minecraft minecraftClient_1, int int_1, int int_2, CallbackInfo ci) { 29 | InitScreenCallback.EVENT.invoker().initScreen((Screen) (Object) this, buttons); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/MixinShaderEntityRenderer.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.mixin; 2 | 3 | import com.replaymod.compat.shaders.ShaderReflection; 4 | import com.replaymod.replay.ReplayHandler; 5 | import com.replaymod.replay.ReplayModReplay; 6 | import net.minecraft.client.renderer.GameRenderer; 7 | import org.spongepowered.asm.mixin.Mixin; 8 | import org.spongepowered.asm.mixin.injection.At; 9 | import org.spongepowered.asm.mixin.injection.Inject; 10 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 11 | 12 | @Mixin(GameRenderer.class) 13 | public abstract class MixinShaderEntityRenderer { 14 | 15 | @Inject(method = "renderWorld", at = @At("HEAD")) 16 | private void replayModCompat_updateShaderFrameTimeCounter(CallbackInfo ignore) { 17 | if (ReplayModReplay.instance.getReplayHandler() == null) return; 18 | if (ShaderReflection.shaders_frameTimeCounter == null) return; 19 | 20 | ReplayHandler replayHandler = ReplayModReplay.instance.getReplayHandler(); 21 | float timestamp = replayHandler.getReplaySender().currentTimeStamp() / 1000f % 3600f; 22 | try { 23 | ShaderReflection.shaders_frameTimeCounter.set(null, timestamp); 24 | } catch (Exception e) { 25 | e.printStackTrace(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/MixinShaders.java: -------------------------------------------------------------------------------- 1 | // 1.7.10 and below 2 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/MixinShadersRender.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.mixin; 2 | 3 | import com.mojang.blaze3d.matrix.MatrixStack; 4 | import com.replaymod.core.events.PreRenderHandCallback; 5 | import net.minecraft.client.renderer.ActiveRenderInfo; 6 | import net.minecraft.client.renderer.GameRenderer; 7 | import org.spongepowered.asm.mixin.Mixin; 8 | import org.spongepowered.asm.mixin.Pseudo; 9 | import org.spongepowered.asm.mixin.injection.At; 10 | import org.spongepowered.asm.mixin.injection.Inject; 11 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 12 | 13 | @Pseudo 14 | @Mixin(targets = { 15 | "shadersmod/client/ShadersRender", // Pre Optifine 1.12.2 E1 16 | "net/optifine/shaders/ShadersRender" // Post Optifine 1.12.2 E1 17 | }, remap = false) 18 | public abstract class MixinShadersRender { 19 | 20 | @Inject(method = {"renderHand0", "renderHand1"}, at = @At("HEAD"), cancellable = true, remap = false) 21 | private static void replayModCompat_disableRenderHand0( 22 | GameRenderer er, 23 | MatrixStack stack, 24 | ActiveRenderInfo camera, 25 | float partialTicks, 26 | CallbackInfo ci) { 27 | if (PreRenderHandCallback.EVENT.invoker().preRenderHand()) { 28 | ci.cancel(); 29 | } 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/MixinTileEntityEndPortalRenderer.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.mixin; 2 | 3 | import com.replaymod.replay.ReplayHandler; 4 | import com.replaymod.replay.ReplayModReplay; 5 | import net.minecraft.util.Util; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Redirect; 9 | 10 | @Mixin(net.minecraft.client.renderer.RenderState.PortalTexturingState.class) 11 | public class MixinTileEntityEndPortalRenderer { 12 | @Redirect(method = "func_228597_a_", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/Util;milliTime()J")) 13 | static 14 | private long replayModReplay_getEnchantmentTime() { 15 | ReplayHandler replayHandler = ReplayModReplay.instance.getReplayHandler(); 16 | if (replayHandler != null) { 17 | return replayHandler.getReplaySender().currentTimeStamp(); 18 | } 19 | return Util.milliTime(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/MixinTileEntityRendererDispatcher.java: -------------------------------------------------------------------------------- 1 | // FIXME 1.15 2 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/MixinViewFrustum.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.mixin; 2 | 3 | import net.minecraft.client.renderer.ViewFrustum; 4 | import net.minecraft.client.renderer.chunk.ChunkRenderDispatcher.ChunkRender; 5 | import net.minecraft.util.math.BlockPos; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Redirect; 9 | 10 | @Mixin(ViewFrustum.class) 11 | public abstract class MixinViewFrustum { 12 | @Redirect( 13 | method = "updateChunkPositions", 14 | at = @At( 15 | value = "INVOKE", 16 | target = "Lnet/minecraft/client/renderer/chunk/ChunkRenderDispatcher$ChunkRender;setPosition(III)V" 17 | ) 18 | ) 19 | private void replayModReplay_updatePositionAndMarkForUpdate( 20 | ChunkRender renderChunk, 21 | int x, int y, int z 22 | ) { 23 | BlockPos pos = new BlockPos(x, y, z); 24 | if (!pos.equals(renderChunk.getPosition())) { 25 | renderChunk.setPosition(x, y, z); 26 | renderChunk.setNeedsUpdate(false); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/Mixin_ChromaKeyDisableFog.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.mixin; 2 | 3 | import com.replaymod.core.versions.MCVer; 4 | import com.replaymod.render.hooks.EntityRendererHandler; 5 | import net.minecraft.client.renderer.FogRenderer; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Inject; 9 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 10 | 11 | @Mixin(FogRenderer.class) 12 | public abstract class Mixin_ChromaKeyDisableFog { 13 | @Inject(method = "setupFog", at = @At("HEAD"), cancellable = true) 14 | private 15 | static void replayModRender_onSetupFog(CallbackInfo ci) { 16 | EntityRendererHandler handler = 17 | ((EntityRendererHandler.IEntityRenderer) MCVer.getMinecraft().gameRenderer).replayModRender_getHandler(); 18 | if (handler == null) return; 19 | if (handler.getSettings().getChromaKeyingColor() != null) { 20 | ci.cancel(); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/Mixin_ChromaKeyForceSky.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.mixin; 2 | 3 | import com.replaymod.render.hooks.EntityRendererHandler; 4 | import de.johni0702.minecraft.gui.utils.lwjgl.ReadableColor; 5 | import net.minecraft.client.Minecraft; 6 | import net.minecraft.client.renderer.WorldRenderer; 7 | import org.spongepowered.asm.mixin.Final; 8 | import org.spongepowered.asm.mixin.Mixin; 9 | import org.spongepowered.asm.mixin.Shadow; 10 | import org.spongepowered.asm.mixin.injection.Constant; 11 | import org.spongepowered.asm.mixin.injection.ModifyConstant; 12 | 13 | /** 14 | * Forces the sky to always render when chroma keying is active. Ordinarily it only renders when the render distance is 15 | * at 4 or greater. 16 | */ 17 | @Mixin(WorldRenderer.class) 18 | public abstract class Mixin_ChromaKeyForceSky { 19 | @Shadow 20 | @Final 21 | private Minecraft mc; 22 | 23 | @ModifyConstant(method = "updateCameraAndRender", constant = @Constant(intValue = 4)) 24 | private int forceSkyWhenChromaKeying(int value) { 25 | EntityRendererHandler handler = ((EntityRendererHandler.IEntityRenderer) this.mc.gameRenderer).replayModRender_getHandler(); 26 | if (handler != null) { 27 | ReadableColor color = handler.getSettings().getChromaKeyingColor(); 28 | if (color != null) { 29 | return 0; 30 | } 31 | } 32 | return value; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/Mixin_ChunkRenderWorker.java: -------------------------------------------------------------------------------- 1 | // FIXME 1.15 2 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/Mixin_EffectRenderer.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/src/main/java/com/replaymod/mixin/Mixin_EffectRenderer.java -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/Mixin_EntityLivingBaseAccessor.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.mixin; 2 | 3 | import net.minecraft.entity.LivingEntity; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | @Mixin(LivingEntity.class) 8 | public interface Mixin_EntityLivingBaseAccessor { 9 | @Accessor 10 | double getInterpTargetX(); 11 | 12 | @Accessor 13 | double getInterpTargetY(); 14 | 15 | @Accessor 16 | double getInterpTargetZ(); 17 | 18 | @Accessor 19 | double getInterpTargetYaw(); 20 | 21 | @Accessor 22 | double getInterpTargetPitch(); 23 | 24 | @Accessor 25 | int getActiveItemStackUseCount(); 26 | 27 | @Accessor 28 | void setActiveItemStackUseCount(int value); 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/Mixin_HideDynamicResourcePacks.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/src/main/java/com/replaymod/mixin/Mixin_HideDynamicResourcePacks.java -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/Mixin_HideNameTags.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.mixin; 2 | 3 | import com.replaymod.core.versions.MCVer; 4 | import com.replaymod.render.hooks.EntityRendererHandler; 5 | import net.minecraft.client.renderer.entity.EntityRenderer; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Inject; 9 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 10 | 11 | @Mixin(EntityRenderer.class) 12 | public abstract class Mixin_HideNameTags { 13 | @Inject(method = "renderName", at = @At("HEAD"), cancellable = true) 14 | private void replayModRender_areAllNamesHidden(CallbackInfo ci) { 15 | EntityRendererHandler handler = ((EntityRendererHandler.IEntityRenderer) MCVer.getMinecraft().gameRenderer).replayModRender_getHandler(); 16 | if (handler != null && !handler.getSettings().isRenderNameTags()) { 17 | ci.cancel(); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/Mixin_HideNameTags_LivingEntity.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.mixin; 2 | 3 | import net.minecraft.client.renderer.entity.LivingRenderer; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | 6 | @Mixin(LivingRenderer.class) 7 | public abstract class Mixin_HideNameTags_LivingEntity { 8 | // 1.8.9 and below 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/Mixin_KeyboardListener.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.mixin; 2 | 3 | import com.replaymod.extras.advancedscreenshots.AdvancedScreenshots; 4 | import com.replaymod.replay.ReplayModReplay; 5 | import net.minecraft.client.KeyboardListener; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Inject; 9 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 10 | 11 | @Mixin(KeyboardListener.class) 12 | public abstract class Mixin_KeyboardListener { 13 | @Inject( 14 | method = "onKeyEvent", 15 | at = @At( 16 | value = "INVOKE", 17 | target = "Lnet/minecraft/util/ScreenShotHelper;saveScreenshot(Ljava/io/File;IILnet/minecraft/client/shader/Framebuffer;Ljava/util/function/Consumer;)V" 18 | ), 19 | cancellable = true 20 | ) 21 | private void takeScreenshot(CallbackInfo ci) { 22 | if (ReplayModReplay.instance.getReplayHandler() != null) { 23 | AdvancedScreenshots.take(); 24 | ci.cancel(); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/Mixin_MoveRealmsButton.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.mixin; 2 | 3 | import com.replaymod.core.ReplayMod; 4 | import com.replaymod.replay.Setting; 5 | import com.replaymod.replay.handler.GuiHandler.MainMenuButtonPosition; 6 | import net.minecraft.client.gui.screen.MainMenuScreen; 7 | import org.spongepowered.asm.mixin.Mixin; 8 | import org.spongepowered.asm.mixin.injection.At; 9 | import org.spongepowered.asm.mixin.injection.ModifyArg; 10 | 11 | @Mixin(MainMenuScreen.class) 12 | public abstract class Mixin_MoveRealmsButton { 13 | @ModifyArg( 14 | method = "init", 15 | at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screen/Screen;init(Lnet/minecraft/client/Minecraft;II)V"), 16 | index = 2 17 | ) 18 | private int adjustRealmsButton(int height) { 19 | String setting = ReplayMod.instance.getSettingsRegistry().get(Setting.MAIN_MENU_BUTTON); 20 | if (MainMenuButtonPosition.valueOf(setting) == MainMenuButtonPosition.BIG) { 21 | height -= 24 * 4; 22 | } 23 | return height; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/Mixin_Omnidirectional_Camera.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.mixin; 2 | 3 | import com.replaymod.render.hooks.EntityRendererHandler; 4 | import net.minecraft.client.renderer.GameRenderer; 5 | import net.minecraft.util.math.vector.Matrix4f; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Redirect; 9 | 10 | @Mixin(GameRenderer.class) 11 | public abstract class Mixin_Omnidirectional_Camera implements EntityRendererHandler.IEntityRenderer { 12 | @Redirect(method = "method_22973", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/math/vector/Matrix4f;perspective(DFFF)Lnet/minecraft/util/math/vector/Matrix4f;")) 13 | private Matrix4f replayModRender_perspective$0(double fovY, float aspect, float zNear, float zFar) { 14 | return replayModRender_perspective((float) fovY, aspect, zNear, zFar); 15 | } 16 | 17 | private Matrix4f replayModRender_perspective(float fovY, float aspect, float zNear, float zFar) { 18 | if (replayModRender_getHandler() != null && replayModRender_getHandler().omnidirectional) { 19 | fovY = 90; 20 | aspect = 1; 21 | } 22 | return Matrix4f.perspective(fovY, aspect, zNear, zFar); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/Mixin_Omnidirectional_DisableFrustumCulling.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.mixin; 2 | 3 | import com.replaymod.core.versions.MCVer; 4 | import com.replaymod.render.hooks.EntityRendererHandler; 5 | import net.minecraft.client.renderer.culling.ClippingHelper; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Inject; 9 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 10 | 11 | @Mixin(ClippingHelper.class) 12 | public abstract class Mixin_Omnidirectional_DisableFrustumCulling { 13 | @Inject(method = "isBoxInFrustumRaw", at = @At("HEAD"), cancellable = true) 14 | public void intersects(CallbackInfoReturnable ci) { 15 | EntityRendererHandler handler = ((EntityRendererHandler.IEntityRenderer) MCVer.getMinecraft().gameRenderer).replayModRender_getHandler(); 16 | if (handler != null && handler.omnidirectional) { 17 | // Note the following used to be true but for simplicity non-ODS omnidirectional is the same now too. 18 | // Normally the camera is always facing the direction of the omnidirectional image face that is currently 19 | // getting rendered. With ODS however, the camera is always facing forwards and the turning happens in the 20 | // vertex shader (non-trivial due to stereo). As such, all chunks need to be rendered all the time for ODS. 21 | ci.setReturnValue(true); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/Mixin_Omnidirectional_SkipHand.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.mixin; 2 | 3 | import com.mojang.blaze3d.matrix.MatrixStack; 4 | import com.replaymod.render.hooks.EntityRendererHandler; 5 | import net.minecraft.client.renderer.ActiveRenderInfo; 6 | import net.minecraft.client.renderer.GameRenderer; 7 | import org.spongepowered.asm.mixin.Mixin; 8 | import org.spongepowered.asm.mixin.injection.At; 9 | import org.spongepowered.asm.mixin.injection.Inject; 10 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 11 | 12 | @Mixin(GameRenderer.class) 13 | public abstract class Mixin_Omnidirectional_SkipHand implements EntityRendererHandler.IEntityRenderer { 14 | @Inject(method = "renderHand", at = @At("HEAD"), cancellable = true) 15 | private void replayModRender_renderSpectatorHand( 16 | MatrixStack matrixStack, 17 | ActiveRenderInfo camera, 18 | float partialTicks, 19 | CallbackInfo ci 20 | ) { 21 | EntityRendererHandler handler = replayModRender_getHandler(); 22 | if (handler != null && handler.omnidirectional) { 23 | // No spectator hands during 360° view, we wouldn't even know where to put it 24 | ci.cancel(); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/Mixin_ParticleManager.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.mixin; 2 | 3 | import net.minecraft.client.particle.Particle; 4 | import net.minecraft.client.particle.ParticleManager; 5 | import net.minecraft.client.world.ClientWorld; 6 | import org.spongepowered.asm.mixin.Final; 7 | import org.spongepowered.asm.mixin.Mixin; 8 | import org.spongepowered.asm.mixin.Shadow; 9 | import org.spongepowered.asm.mixin.injection.At; 10 | import org.spongepowered.asm.mixin.injection.Inject; 11 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 12 | 13 | import java.util.Queue; 14 | 15 | @Mixin(ParticleManager.class) 16 | public abstract class Mixin_ParticleManager { 17 | @Final 18 | @Shadow 19 | private Queue queue; 20 | 21 | /** 22 | * This method additionally clears the queue of particles to be added when the world is changed. 23 | * Otherwise particles from the previous world might show up in this one if they were spawned after 24 | * the last tick in the previous world. 25 | * 26 | * @param world The new world 27 | * @param ci Callback info 28 | */ 29 | @Inject(method = "clearEffects", at = @At("HEAD")) 30 | public void replayModReplay_clearParticleQueue( 31 | ClientWorld world, 32 | CallbackInfo ci) { 33 | this.queue.clear(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/Mixin_PreserveDepthDuringHandRendering.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.mixin; 2 | 3 | import com.replaymod.render.hooks.EntityRendererHandler; 4 | import net.minecraft.client.renderer.GameRenderer; 5 | import org.lwjgl.opengl.GL11; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.ModifyArg; 9 | 10 | @Mixin(GameRenderer.class) 11 | public abstract class Mixin_PreserveDepthDuringHandRendering { 12 | @ModifyArg( 13 | method = "renderWorld", 14 | at = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/systems/RenderSystem;clear(IZ)V"), 15 | index = 0 16 | ) 17 | private int replayModRender_skipClearWhenRecordingDepth(int mask) { 18 | EntityRendererHandler handler = ((EntityRendererHandler.IEntityRenderer) this).replayModRender_getHandler(); 19 | if (handler != null && handler.getSettings().isDepthMap()) { 20 | mask = mask & ~GL11.GL_DEPTH_BUFFER_BIT; 21 | } 22 | return mask; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/Mixin_RegisterDynamicResourcePacks.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/src/main/java/com/replaymod/mixin/Mixin_RegisterDynamicResourcePacks.java -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/Mixin_RenderGlobal.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.mixin; 2 | 3 | import com.replaymod.render.blend.BlendState; 4 | import com.replaymod.render.blend.exporters.EntityExporter; 5 | import net.minecraft.client.renderer.WorldRenderer; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Inject; 9 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 10 | 11 | @Mixin(WorldRenderer.class) 12 | public abstract class Mixin_RenderGlobal { 13 | 14 | // FIXME wither skull ._. mojang pls 15 | 16 | @Inject(method = "renderEntity", at = @At("HEAD")) 17 | private void preEntityRender(CallbackInfo ci) { 18 | BlendState blendState = BlendState.getState(); 19 | if (blendState != null) { 20 | blendState.get(EntityExporter.class).preEntitiesRender(); 21 | } 22 | } 23 | 24 | @Inject(method = "renderEntity", at = @At("RETURN")) 25 | private void postEntityRender(CallbackInfo ci) { 26 | BlendState blendState = BlendState.getState(); 27 | if (blendState != null) { 28 | blendState.get(EntityExporter.class).postEntitiesRender(); 29 | } 30 | } 31 | 32 | // FIXME 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/Mixin_RenderHudCallback.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/src/main/java/com/replaymod/mixin/Mixin_RenderHudCallback.java -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/Mixin_RenderItem.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.mixin; 2 | 3 | import com.replaymod.replay.ReplayHandler; 4 | import com.replaymod.replay.ReplayModReplay; 5 | import net.minecraft.util.Util; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Redirect; 9 | 10 | @Mixin(net.minecraft.client.renderer.RenderState.class) 11 | public class Mixin_RenderItem { 12 | @Redirect(method = "setupGlintTexturing", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/Util;milliTime()J")) 13 | private static long getEnchantmentTime() { 14 | ReplayHandler replayHandler = ReplayModReplay.instance.getReplayHandler(); 15 | if (replayHandler != null) { 16 | return replayHandler.getReplaySender().currentTimeStamp(); 17 | } 18 | return Util.milliTime(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/Mixin_RenderLivingBase.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.mixin; 2 | 3 | import com.replaymod.replay.camera.CameraEntity; 4 | import net.minecraft.client.renderer.entity.LivingRenderer; 5 | import net.minecraft.entity.LivingEntity; 6 | import net.minecraft.entity.player.PlayerEntity; 7 | import org.spongepowered.asm.mixin.Mixin; 8 | import org.spongepowered.asm.mixin.injection.At; 9 | import org.spongepowered.asm.mixin.injection.Inject; 10 | import org.spongepowered.asm.mixin.injection.Redirect; 11 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 12 | 13 | import static com.replaymod.core.versions.MCVer.getMinecraft; 14 | 15 | @Mixin(LivingRenderer.class) 16 | public abstract class Mixin_RenderLivingBase { 17 | @Inject(method = "canRenderName(Lnet/minecraft/entity/LivingEntity;)Z", at = @At("HEAD"), cancellable = true) 18 | private void replayModReplay_canRenderInvisibleName(LivingEntity entity, CallbackInfoReturnable ci) { 19 | PlayerEntity thePlayer = getMinecraft().player; 20 | if (thePlayer instanceof CameraEntity && entity.isInvisible()) { 21 | ci.setReturnValue(false); 22 | } 23 | } 24 | 25 | @Redirect( 26 | method = "render", 27 | at = @At( 28 | value = "INVOKE", 29 | target = "Lnet/minecraft/entity/LivingEntity;isInvisibleTo(Lnet/minecraft/entity/player/PlayerEntity;)Z" 30 | ) 31 | ) 32 | private boolean replayModReplay_shouldInvisibleNotBeRendered(LivingEntity entity, PlayerEntity thePlayer) { 33 | return thePlayer instanceof CameraEntity || entity.isInvisibleToPlayer(thePlayer); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/Mixin_ShowSpectatedHand_NoOF.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.mixin; 2 | 3 | import com.replaymod.replay.camera.CameraEntity; 4 | import net.minecraft.client.entity.player.ClientPlayerEntity; 5 | import net.minecraft.client.multiplayer.PlayerController; 6 | import net.minecraft.client.renderer.GameRenderer; 7 | import net.minecraft.world.GameType; 8 | import org.spongepowered.asm.mixin.Mixin; 9 | import org.spongepowered.asm.mixin.injection.At; 10 | import org.spongepowered.asm.mixin.injection.Redirect; 11 | 12 | import static com.replaymod.core.versions.MCVer.getMinecraft; 13 | 14 | @Mixin(GameRenderer.class) 15 | public abstract class Mixin_ShowSpectatedHand_NoOF { 16 | @Redirect( 17 | method = "renderHand", 18 | at = @At( 19 | value = "INVOKE", 20 | target = "Lnet/minecraft/client/multiplayer/PlayerController;getCurrentGameType()Lnet/minecraft/world/GameType;" 21 | ) 22 | ) 23 | private GameType getGameMode(PlayerController interactionManager) { 24 | ClientPlayerEntity camera = getMinecraft().player; 25 | if (camera instanceof CameraEntity) { 26 | // alternative doesn't really matter, the caller only checks for equality to SPECTATOR 27 | return camera.isSpectator() ? GameType.SPECTATOR : GameType.SURVIVAL; 28 | } 29 | return interactionManager.getCurrentGameType(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/Mixin_SkipBlockOutlinesDuringRender.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.mixin; 2 | 3 | import com.replaymod.render.hooks.EntityRendererHandler; 4 | import net.minecraft.client.Minecraft; 5 | import net.minecraft.client.renderer.WorldRenderer; 6 | import org.spongepowered.asm.mixin.Final; 7 | import org.spongepowered.asm.mixin.Mixin; 8 | import org.spongepowered.asm.mixin.Shadow; 9 | import org.spongepowered.asm.mixin.injection.At; 10 | import org.spongepowered.asm.mixin.injection.Inject; 11 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 12 | 13 | @Mixin(WorldRenderer.class) 14 | public abstract class Mixin_SkipBlockOutlinesDuringRender { 15 | @Shadow 16 | @Final 17 | private Minecraft mc; 18 | 19 | @Inject(method = "drawSelectionBox", at = @At("HEAD"), cancellable = true) 20 | private void replayModRender_drawSelectionBox(CallbackInfo ci) { 21 | if (((EntityRendererHandler.IEntityRenderer) this.mc.gameRenderer).replayModRender_getHandler() != null) { 22 | ci.cancel(); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/Mixin_Stereoscopic_HandRenderPass.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.mixin; 2 | 3 | import net.minecraft.client.renderer.GameRenderer; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | 6 | @Mixin(GameRenderer.class) 7 | public abstract class Mixin_Stereoscopic_HandRenderPass { 8 | // MC's builtin stereoscopic 3D feature was dropped 9 | // 1.12.2 and before 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/Mixin_WorldRendererAccessor.java: -------------------------------------------------------------------------------- 1 | // FIXME 1.15 2 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/NetworkManagerAccessor.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.mixin; 2 | 3 | import io.netty.channel.Channel; 4 | import net.minecraft.network.NetworkManager; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.gen.Accessor; 7 | 8 | @Mixin(NetworkManager.class) 9 | public interface NetworkManagerAccessor { 10 | @Accessor 11 | Channel getChannel(); 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/NetworkRegistryAccessor.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.mixin; 2 | 3 | import net.minecraftforge.fml.network.NetworkDirection; 4 | import net.minecraftforge.fml.network.NetworkRegistry; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.gen.Invoker; 7 | 8 | import java.util.List; 9 | 10 | @Mixin(NetworkRegistry.class) 11 | public interface NetworkRegistryAccessor { 12 | @Invoker("gatherLoginPayloads") 13 | static List invokeGatherLoginPayloads(NetworkDirection direction, boolean isLocal) { 14 | throw new AssertionError(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/ParticleAccessor.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.mixin; 2 | 3 | import net.minecraft.client.particle.Particle; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | @Mixin(Particle.class) 8 | public interface ParticleAccessor { 9 | @Accessor 10 | double getPrevPosX(); 11 | 12 | @Accessor 13 | double getPrevPosY(); 14 | 15 | @Accessor 16 | double getPrevPosZ(); 17 | 18 | @Accessor 19 | double getPosX(); 20 | 21 | @Accessor 22 | double getPosY(); 23 | 24 | @Accessor 25 | double getPosZ(); 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/ResourcePackRepositoryAccessor.java: -------------------------------------------------------------------------------- 1 | // 1.7.10 and below 2 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/SPacketSpawnMobAccessor.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.mixin; 2 | 3 | import net.minecraft.network.play.server.SSpawnMobPacket; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | 6 | @Mixin(SSpawnMobPacket.class) 7 | public interface SPacketSpawnMobAccessor { 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/SPacketSpawnPlayerAccessor.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.mixin; 2 | 3 | import net.minecraft.network.play.server.SSpawnPlayerPacket; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | 6 | @Mixin(SSpawnPlayerPacket.class) 7 | public interface SPacketSpawnPlayerAccessor { 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/TimerAccessor.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.mixin; 2 | 3 | import net.minecraft.util.Timer; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | @Mixin(Timer.class) 8 | public interface TimerAccessor { 9 | @Accessor 10 | long getLastSyncSysClock(); 11 | 12 | @Accessor 13 | void setLastSyncSysClock(long value); 14 | 15 | @Accessor 16 | float getTickLength(); 17 | 18 | @Accessor 19 | void setTickLength(float value); 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/mixin/WorldRendererAccessor.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.mixin; 2 | 3 | import net.minecraft.client.renderer.WorldRenderer; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | 6 | @Mixin(WorldRenderer.class) 7 | public interface WorldRendererAccessor { 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/pathing/player/RealtimeTimelinePlayer.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.pathing.player; 2 | 3 | import com.google.common.util.concurrent.ListenableFuture; 4 | import com.replaymod.replay.ReplayHandler; 5 | import com.replaymod.replaystudio.pathing.path.Timeline; 6 | 7 | /** 8 | * Timeline player using the system time. 9 | */ 10 | public class RealtimeTimelinePlayer extends AbstractTimelinePlayer { 11 | /** 12 | * Wether the next frame is the first frame. 13 | * We only start measuring time from the second frame 14 | * as the first might have to jump in time which might take time. 15 | */ 16 | private boolean firstFrame; 17 | private boolean secondFrame; 18 | 19 | /** 20 | * System time in milliseconds at the start. 21 | */ 22 | private long startTime; 23 | 24 | public RealtimeTimelinePlayer(ReplayHandler replayHandler) { 25 | super(replayHandler); 26 | } 27 | 28 | @Override 29 | public ListenableFuture start(Timeline timeline) { 30 | firstFrame = true; 31 | return super.start(timeline); 32 | } 33 | 34 | @Override 35 | public void onTick() { 36 | if (secondFrame) { 37 | secondFrame = false; 38 | startTime = System.currentTimeMillis(); 39 | } 40 | super.onTick(); 41 | if (firstFrame) { 42 | firstFrame = false; 43 | secondFrame = true; 44 | } 45 | } 46 | 47 | @Override 48 | public long getTimePassed() { 49 | return startOffset + (firstFrame ? 0 : System.currentTimeMillis() - startTime); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/pathing/player/ReplayTimer.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.pathing.player; 2 | 3 | import com.replaymod.core.utils.WrappedTimer; 4 | import com.replaymod.gui.utils.Event; 5 | import net.minecraft.util.Timer; 6 | 7 | /** 8 | * Wrapper around the current timer that prevents the timer from advancing by itself. 9 | */ 10 | public class ReplayTimer extends WrappedTimer { 11 | private final Timer state = new Timer(0, 0); 12 | 13 | public int ticksThisFrame; 14 | 15 | public ReplayTimer(Timer wrapped) { 16 | super(wrapped); 17 | } 18 | 19 | @Override 20 | // This should be handled by Remap but it isn't (was handled before a9724e3). 21 | public int 22 | getPartialTicks( 23 | long sysClock 24 | ) { 25 | copy(this, state); // Save our current state 26 | try { 27 | ticksThisFrame = 28 | wrapped.getPartialTicks( 29 | sysClock 30 | ); // Update current state 31 | } finally { 32 | copy(state, this); // Restore our old state 33 | UpdatedCallback.EVENT.invoker().onUpdate(); 34 | } 35 | return ticksThisFrame; 36 | } 37 | 38 | public Timer getWrapped() { 39 | return wrapped; 40 | } 41 | 42 | public interface UpdatedCallback { 43 | Event EVENT = Event.create((listeners) -> 44 | () -> { 45 | for (UpdatedCallback listener : listeners) { 46 | listener.onUpdate(); 47 | } 48 | } 49 | ); 50 | 51 | void onUpdate(); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/recording/ServerInfoExt.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.recording; 2 | 3 | import net.minecraft.client.multiplayer.ServerData; 4 | 5 | /** 6 | * Extension interface for {@link net.minecraft.client.multiplayer.ServerData}. 7 | */ 8 | public interface ServerInfoExt { 9 | 10 | static ServerInfoExt from(ServerData base) { 11 | return (ServerInfoExt) base; 12 | } 13 | 14 | /** 15 | * Per-server optional overwrite for {@link Setting#AUTO_START_RECORDING}. 16 | */ 17 | Boolean getAutoRecording(); 18 | 19 | /** 20 | * Per-server optional overwrite for {@link Setting#AUTO_START_RECORDING}. 21 | */ 22 | void setAutoRecording(Boolean autoRecording); 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/recording/Setting.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.recording; 2 | 3 | import com.replaymod.core.SettingsRegistry; 4 | 5 | public final class Setting extends SettingsRegistry.SettingKeys { 6 | public static final Setting RECORD_SINGLEPLAYER = make("recordSingleplayer", "recordsingleplayer", true); 7 | public static final Setting RECORD_SERVER = make("recordServer", "recordserver", true); 8 | public static final Setting INDICATOR = make("indicator", "indicator", true); 9 | public static final Setting AUTO_START_RECORDING = make("autoStartRecording", "autostartrecording", true); 10 | public static final Setting AUTO_POST_PROCESS = make("autoPostProcess", null, true); 11 | public static final Setting RENAME_DIALOG = make("renameDialog", "rename_recording_dialog", true); 12 | 13 | private static Setting make(String key, String displayName, T defaultValue) { 14 | return new Setting<>(key, displayName, defaultValue); 15 | } 16 | 17 | public Setting(String key, String displayString, T defaultValue) { 18 | super("recording", key, displayString == null ? null : "replaymod.gui.settings." + displayString, defaultValue); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/recording/handler/FMLHandshakeFilter.java: -------------------------------------------------------------------------------- 1 | // 1.12.2 and below 2 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/render/Setting.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.render; 2 | 3 | import com.replaymod.core.SettingsRegistry; 4 | 5 | public final class Setting { 6 | public static final SettingsRegistry.SettingKey RENDER_PATH = 7 | new SettingsRegistry.SettingKeys<>("advanced", "renderPath", null, "./replay_videos/"); 8 | public static final SettingsRegistry.SettingKey SKIP_POST_RENDER_GUI = 9 | new SettingsRegistry.SettingKeys<>("advanced", "skipPostRenderGui", null, false); 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/render/blend/Exporter.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.render.blend; 2 | 3 | import java.io.IOException; 4 | 5 | public interface Exporter { 6 | default void setup() throws IOException { 7 | } 8 | 9 | default void tearDown() throws IOException { 10 | } 11 | 12 | default void preFrame(int frame) throws IOException { 13 | } 14 | 15 | default void postFrame(int frame) throws IOException { 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/render/blend/data/DId.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.render.blend.data; 2 | 3 | import org.cakelab.blender.io.util.Identifier; 4 | 5 | public class DId { 6 | public final Identifier code; 7 | public String name; 8 | 9 | public DId(Identifier code) { 10 | this.code = code; 11 | } 12 | 13 | public DId(Identifier code, String name) { 14 | this.code = code; 15 | this.name = name; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/render/blend/data/DImage.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.render.blend.data; 2 | 3 | import org.apache.commons.lang3.tuple.Pair; 4 | import org.blender.dna.Image; 5 | import org.blender.dna.ImagePackedFile; 6 | import org.cakelab.blender.io.block.BlockCodes; 7 | import org.cakelab.blender.nio.CPointer; 8 | 9 | import java.io.IOException; 10 | import java.util.ArrayList; 11 | import java.util.List; 12 | 13 | public class DImage { 14 | public final DId id = new DId(BlockCodes.ID_IM); 15 | public String filePath; 16 | public List> packedFiles = new ArrayList<>(); 17 | 18 | public CPointer serialize(Serializer serializer) throws IOException { 19 | return serializer.maybeMajor(this, id, Image.class, () -> { 20 | return image -> { 21 | image.getName().fromString(String.valueOf(filePath)); 22 | image.setSource((short) 1); 23 | image.getColorspace_settings().getName().fromString("sRGB"); 24 | image.setAspx(1); 25 | image.setAspy(1); 26 | serializer.writeDataList(ImagePackedFile.class, image.getPackedfiles(), packedFiles.size(), (i, pf) -> { 27 | Pair pair = packedFiles.get(i); 28 | pf.getFilepath().fromString(pair.getLeft()); 29 | pf.setPackedfile(pair.getRight().serialize(serializer)); 30 | }); 31 | }; 32 | }); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/render/blend/data/DPackedFile.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.render.blend.data; 2 | 3 | import org.blender.dna.PackedFile; 4 | import org.cakelab.blender.nio.CPointer; 5 | 6 | import java.io.IOException; 7 | 8 | public class DPackedFile { 9 | public byte[] data; 10 | 11 | public DPackedFile() { 12 | } 13 | 14 | public DPackedFile(byte[] data) { 15 | this.data = data; 16 | } 17 | 18 | public CPointer serialize(Serializer serializer) throws IOException { 19 | PackedFile packedFile = serializer.writeData(PackedFile.class); 20 | packedFile.setSize(data.length); 21 | packedFile.setSeek(0); 22 | packedFile.setData(serializer.writeBytes(data).cast(Object.class)); 23 | return packedFile.__io__addressof(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/render/blend/data/DTexture.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.render.blend.data; 2 | 3 | import org.blender.dna.Image; 4 | import org.blender.dna.Tex; 5 | import org.cakelab.blender.io.block.BlockCodes; 6 | import org.cakelab.blender.nio.CPointer; 7 | 8 | import java.io.IOException; 9 | 10 | public class DTexture { 11 | public final DId id = new DId(BlockCodes.ID_TE); 12 | public DImage image; 13 | 14 | public CPointer serialize(Serializer serializer) throws IOException { 15 | return serializer.maybeMajor(this, id, Tex.class, () -> { 16 | CPointer image = this.image.serialize(serializer); 17 | return tex -> { 18 | tex.setIma(image); 19 | tex.setType((short) 8 /* TEX_IMAGE */); 20 | tex.setImaflag((short) 2 /* TEX_USEALPHA */); 21 | tex.setCropxmax(1); 22 | tex.setCropymax(1); 23 | tex.setRfac(1); 24 | tex.setGfac(1); 25 | tex.setBfac(1); 26 | tex.setBright(1); 27 | tex.setContrast(1); 28 | tex.setSaturation(1); 29 | }; 30 | }); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/render/blend/exporters/ChunkExporter.java: -------------------------------------------------------------------------------- 1 | // FIXME 1.15 2 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/render/capturer/CaptureData.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.render.capturer; 2 | 3 | public interface CaptureData { 4 | } 5 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/render/capturer/CubicOpenGlFrameCapturer.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.render.capturer; 2 | 3 | import com.replaymod.render.frame.CubicOpenGlFrame; 4 | import com.replaymod.render.rendering.Channel; 5 | 6 | import java.util.Collections; 7 | import java.util.Map; 8 | 9 | public class CubicOpenGlFrameCapturer extends OpenGlFrameCapturer { 10 | public enum Data implements CaptureData { 11 | LEFT, RIGHT, FRONT, BACK, TOP, BOTTOM 12 | } 13 | 14 | private final int frameSize; 15 | 16 | public CubicOpenGlFrameCapturer(WorldRenderer worldRenderer, RenderInfo renderInfo, int frameSize) { 17 | super(worldRenderer, renderInfo); 18 | this.frameSize = frameSize; 19 | worldRenderer.setOmnidirectional(true); 20 | } 21 | 22 | @Override 23 | protected int getFrameWidth() { 24 | return frameSize; 25 | } 26 | 27 | @Override 28 | protected int getFrameHeight() { 29 | return frameSize; 30 | } 31 | 32 | @Override 33 | public Map process() { 34 | float partialTicks = renderInfo.updateForNextFrame(); 35 | int frameId = framesDone++; 36 | CubicOpenGlFrame frame = new CubicOpenGlFrame(renderFrame(frameId, partialTicks, Data.LEFT), 37 | renderFrame(frameId, partialTicks, Data.RIGHT), 38 | renderFrame(frameId, partialTicks, Data.FRONT), 39 | renderFrame(frameId, partialTicks, Data.BACK), 40 | renderFrame(frameId, partialTicks, Data.TOP), 41 | renderFrame(frameId, partialTicks, Data.BOTTOM)); 42 | return Collections.singletonMap(Channel.BRGA, frame); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/render/capturer/CubicPboOpenGlFrameCapturer.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.render.capturer; 2 | 3 | import com.replaymod.render.frame.CubicOpenGlFrame; 4 | import com.replaymod.render.frame.OpenGlFrame; 5 | 6 | public class CubicPboOpenGlFrameCapturer extends 7 | PboOpenGlFrameCapturer { 8 | 9 | private final int frameSize; 10 | 11 | public CubicPboOpenGlFrameCapturer(WorldRenderer worldRenderer, RenderInfo renderInfo, int frameSize) { 12 | super(worldRenderer, renderInfo, CubicOpenGlFrameCapturer.Data.class, frameSize * frameSize); 13 | this.frameSize = frameSize; 14 | worldRenderer.setOmnidirectional(true); 15 | } 16 | 17 | @Override 18 | protected int getFrameWidth() { 19 | return frameSize; 20 | } 21 | 22 | @Override 23 | protected int getFrameHeight() { 24 | return frameSize; 25 | } 26 | 27 | @Override 28 | protected CubicOpenGlFrame create(OpenGlFrame[] from) { 29 | return new CubicOpenGlFrame(from[0], from[1], from[2], from[3], from[4], from[5]); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/render/capturer/RenderInfo.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.render.capturer; 2 | 3 | import com.replaymod.render.RenderSettings; 4 | import de.johni0702.minecraft.gui.utils.lwjgl.ReadableDimension; 5 | 6 | public interface RenderInfo { 7 | ReadableDimension getFrameSize(); 8 | 9 | int getFramesDone(); 10 | 11 | int getTotalFrames(); 12 | 13 | float updateForNextFrame(); 14 | 15 | RenderSettings getRenderSettings(); 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/render/capturer/SimpleOpenGlFrameCapturer.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.render.capturer; 2 | 3 | import com.replaymod.render.frame.OpenGlFrame; 4 | import com.replaymod.render.rendering.Channel; 5 | 6 | import java.util.Collections; 7 | import java.util.Map; 8 | 9 | public class SimpleOpenGlFrameCapturer extends OpenGlFrameCapturer { 10 | 11 | public SimpleOpenGlFrameCapturer(WorldRenderer worldRenderer, RenderInfo renderInfo) { 12 | super(worldRenderer, renderInfo); 13 | } 14 | 15 | @Override 16 | public Map process() { 17 | float partialTicks = renderInfo.updateForNextFrame(); 18 | OpenGlFrame frame = renderFrame(framesDone++, partialTicks); 19 | return Collections.singletonMap(Channel.BRGA, frame); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/render/capturer/SimplePboOpenGlFrameCapturer.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.render.capturer; 2 | 3 | import com.replaymod.render.frame.OpenGlFrame; 4 | 5 | public class SimplePboOpenGlFrameCapturer extends PboOpenGlFrameCapturer { 6 | 7 | public SimplePboOpenGlFrameCapturer(WorldRenderer worldRenderer, RenderInfo renderInfo) { 8 | super(worldRenderer, renderInfo, SinglePass.class, 9 | renderInfo.getFrameSize().getWidth() * renderInfo.getFrameSize().getHeight()); 10 | } 11 | 12 | @Override 13 | protected OpenGlFrame create(OpenGlFrame[] from) { 14 | return from[0]; 15 | } 16 | 17 | public enum SinglePass implements CaptureData { 18 | SINGLE_PASS 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/render/capturer/StereoscopicOpenGlFrameCapturer.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.render.capturer; 2 | 3 | import com.replaymod.render.frame.OpenGlFrame; 4 | import com.replaymod.render.frame.StereoscopicOpenGlFrame; 5 | import com.replaymod.render.rendering.Channel; 6 | 7 | import java.util.Collections; 8 | import java.util.Map; 9 | 10 | public class StereoscopicOpenGlFrameCapturer 11 | extends OpenGlFrameCapturer { 12 | public enum Data implements CaptureData { 13 | LEFT_EYE, RIGHT_EYE 14 | } 15 | 16 | public StereoscopicOpenGlFrameCapturer(WorldRenderer worldRenderer, RenderInfo renderInfo) { 17 | super(worldRenderer, renderInfo); 18 | } 19 | 20 | @Override 21 | protected int getFrameWidth() { 22 | return super.getFrameWidth() / 2; 23 | } 24 | 25 | @Override 26 | public Map process() { 27 | float partialTicks = renderInfo.updateForNextFrame(); 28 | int frameId = framesDone++; 29 | OpenGlFrame left = renderFrame(frameId, partialTicks, Data.LEFT_EYE); 30 | OpenGlFrame right = renderFrame(frameId, partialTicks, Data.RIGHT_EYE); 31 | StereoscopicOpenGlFrame frame = new StereoscopicOpenGlFrame(left, right); 32 | return Collections.singletonMap(Channel.BRGA, frame); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/render/capturer/StereoscopicPboOpenGlFrameCapturer.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.render.capturer; 2 | 3 | import com.replaymod.render.frame.OpenGlFrame; 4 | import com.replaymod.render.frame.StereoscopicOpenGlFrame; 5 | 6 | public class StereoscopicPboOpenGlFrameCapturer 7 | extends PboOpenGlFrameCapturer { 8 | 9 | public StereoscopicPboOpenGlFrameCapturer(WorldRenderer worldRenderer, RenderInfo renderInfo) { 10 | super(worldRenderer, renderInfo, StereoscopicOpenGlFrameCapturer.Data.class, 11 | renderInfo.getFrameSize().getWidth() / 2 * renderInfo.getFrameSize().getHeight()); 12 | } 13 | 14 | @Override 15 | protected int getFrameWidth() { 16 | return super.getFrameWidth() / 2; 17 | } 18 | 19 | @Override 20 | protected StereoscopicOpenGlFrame create(OpenGlFrame[] from) { 21 | return new StereoscopicOpenGlFrame(from[0], from[1]); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/render/capturer/WorldRenderer.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.render.capturer; 2 | 3 | import java.io.Closeable; 4 | 5 | public interface WorldRenderer extends Closeable { 6 | void renderWorld(float partialTicks, CaptureData data); 7 | 8 | void setOmnidirectional(boolean omnidirectional); 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/render/events/ReplayRenderCallback.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.render.events; 2 | 3 | import com.replaymod.gui.utils.Event; 4 | import com.replaymod.render.rendering.VideoRenderer; 5 | 6 | public interface ReplayRenderCallback { 7 | interface Pre { 8 | Event
 EVENT = Event.create((listeners) ->
 9 |                 (renderer) -> {
10 |                     for (Pre listener : listeners) {
11 |                         listener.beforeRendering(renderer);
12 |                     }
13 |                 });
14 | 
15 |         void beforeRendering(VideoRenderer renderer);
16 |     }
17 | 
18 |     interface Post {
19 |         Event EVENT = Event.create((listeners) ->
20 |                 (renderer) -> {
21 |                     for (Post listener : listeners) {
22 |                         listener.afterRendering(renderer);
23 |                     }
24 |                 });
25 | 
26 |         void afterRendering(VideoRenderer renderer);
27 |     }
28 | }
29 | 


--------------------------------------------------------------------------------
/src/main/java/com/replaymod/render/frame/BitmapFrame.java:
--------------------------------------------------------------------------------
 1 | package com.replaymod.render.frame;
 2 | 
 3 | import com.replaymod.render.rendering.Frame;
 4 | import de.johni0702.minecraft.gui.utils.lwjgl.ReadableDimension;
 5 | import org.apache.commons.lang3.Validate;
 6 | 
 7 | import java.nio.ByteBuffer;
 8 | 
 9 | public class BitmapFrame implements Frame {
10 |     private final int frameId;
11 |     private final ReadableDimension size;
12 |     private final int bytesPerPixel;
13 |     private final ByteBuffer byteBuffer;
14 | 
15 |     public BitmapFrame(int frameId, ReadableDimension size, int bytesPerPixel, ByteBuffer byteBuffer) {
16 |         Validate.isTrue(size.getWidth() * size.getHeight() * bytesPerPixel == byteBuffer.remaining(),
17 |                 "Buffer size is %d (cap: %d) but should be %d",
18 |                 byteBuffer.remaining(), byteBuffer.capacity(), size.getWidth() * size.getHeight() * bytesPerPixel);
19 |         this.frameId = frameId;
20 |         this.size = size;
21 |         this.bytesPerPixel = bytesPerPixel;
22 |         this.byteBuffer = byteBuffer;
23 |     }
24 | 
25 |     public int getFrameId() {
26 |         return this.frameId;
27 |     }
28 | 
29 |     public ReadableDimension getSize() {
30 |         return this.size;
31 |     }
32 | 
33 |     public int getBytesPerPixel() {
34 |         return bytesPerPixel;
35 |     }
36 | 
37 |     public ByteBuffer getByteBuffer() {
38 |         return this.byteBuffer;
39 |     }
40 | }
41 | 


--------------------------------------------------------------------------------
/src/main/java/com/replaymod/render/frame/ODSOpenGlFrame.java:
--------------------------------------------------------------------------------
 1 | package com.replaymod.render.frame;
 2 | 
 3 | import com.replaymod.render.rendering.Frame;
 4 | import org.apache.commons.lang3.Validate;
 5 | 
 6 | public class ODSOpenGlFrame implements Frame {
 7 |     private final CubicOpenGlFrame left, right;
 8 | 
 9 |     public ODSOpenGlFrame(CubicOpenGlFrame left, CubicOpenGlFrame right) {
10 |         Validate.isTrue(left.getFrameId() == right.getFrameId(), "Frame ids do not match.");
11 |         this.left = left;
12 |         this.right = right;
13 |     }
14 | 
15 |     @Override
16 |     public int getFrameId() {
17 |         return left.getFrameId();
18 |     }
19 | 
20 |     public CubicOpenGlFrame getLeft() {
21 |         return this.left;
22 |     }
23 | 
24 |     public CubicOpenGlFrame getRight() {
25 |         return this.right;
26 |     }
27 | }
28 | 


--------------------------------------------------------------------------------
/src/main/java/com/replaymod/render/frame/OpenGlFrame.java:
--------------------------------------------------------------------------------
 1 | package com.replaymod.render.frame;
 2 | 
 3 | import com.replaymod.render.rendering.Frame;
 4 | import de.johni0702.minecraft.gui.utils.lwjgl.ReadableDimension;
 5 | 
 6 | import java.nio.ByteBuffer;
 7 | 
 8 | public class OpenGlFrame implements Frame {
 9 |     private final int frameId;
10 |     private final ReadableDimension size;
11 |     private final int bytesPerPixel;
12 |     private final ByteBuffer byteBuffer;
13 | 
14 |     public OpenGlFrame(int frameId, ReadableDimension size, int bytesPerPixel, ByteBuffer byteBuffer) {
15 |         this.frameId = frameId;
16 |         this.size = size;
17 |         this.bytesPerPixel = bytesPerPixel;
18 |         this.byteBuffer = byteBuffer;
19 |     }
20 | 
21 |     public int getFrameId() {
22 |         return this.frameId;
23 |     }
24 | 
25 |     public ReadableDimension getSize() {
26 |         return this.size;
27 |     }
28 | 
29 |     public int getBytesPerPixel() {
30 |         return bytesPerPixel;
31 |     }
32 | 
33 |     public ByteBuffer getByteBuffer() {
34 |         return this.byteBuffer;
35 |     }
36 | }
37 | 


--------------------------------------------------------------------------------
/src/main/java/com/replaymod/render/frame/StereoscopicOpenGlFrame.java:
--------------------------------------------------------------------------------
 1 | package com.replaymod.render.frame;
 2 | 
 3 | import com.replaymod.render.rendering.Frame;
 4 | import org.apache.commons.lang3.Validate;
 5 | 
 6 | public class StereoscopicOpenGlFrame implements Frame {
 7 |     private final OpenGlFrame left, right;
 8 | 
 9 |     public StereoscopicOpenGlFrame(OpenGlFrame left, OpenGlFrame right) {
10 |         Validate.isTrue(left.getFrameId() == right.getFrameId(), "Frame ids do not match.");
11 |         Validate.isTrue(left.getByteBuffer().remaining() == right.getByteBuffer().remaining(), "Buffer size does not match.");
12 |         this.left = left;
13 |         this.right = right;
14 |     }
15 | 
16 |     @Override
17 |     public int getFrameId() {
18 |         return left.getFrameId();
19 |     }
20 | 
21 |     public OpenGlFrame getLeft() {
22 |         return this.left;
23 |     }
24 | 
25 |     public OpenGlFrame getRight() {
26 |         return this.right;
27 |     }
28 | }
29 | 


--------------------------------------------------------------------------------
/src/main/java/com/replaymod/render/hooks/FogStateCallback.java:
--------------------------------------------------------------------------------
 1 | package com.replaymod.render.hooks;
 2 | 
 3 | import com.replaymod.gui.utils.Event;
 4 | 
 5 | public interface FogStateCallback {
 6 |     Event EVENT = Event.create((listeners) ->
 7 |             (enabled) -> {
 8 |                 for (FogStateCallback listener : listeners) {
 9 |                     listener.fogStateChanged(enabled);
10 |                 }
11 |             }
12 |     );
13 | 
14 |     void fogStateChanged(boolean enabled);
15 | }
16 | 


--------------------------------------------------------------------------------
/src/main/java/com/replaymod/render/hooks/ForceChunkLoadingHook.java:
--------------------------------------------------------------------------------
 1 | package com.replaymod.render.hooks;
 2 | 
 3 | import net.minecraft.client.renderer.WorldRenderer;
 4 | 
 5 | public class ForceChunkLoadingHook {
 6 | 
 7 |     private final WorldRenderer hooked;
 8 | 
 9 |     public ForceChunkLoadingHook(WorldRenderer renderGlobal) {
10 |         this.hooked = renderGlobal;
11 | 
12 |         IForceChunkLoading.from(renderGlobal).replayModRender_setHook(this);
13 |     }
14 | 
15 |     public void uninstall() {
16 |         IForceChunkLoading.from(hooked).replayModRender_setHook(null);
17 |     }
18 | 
19 |     public interface IBlockOnChunkRebuilds {
20 |         boolean uploadEverythingBlocking();
21 |     }
22 | }
23 | 


--------------------------------------------------------------------------------
/src/main/java/com/replaymod/render/hooks/GLStateTracker.java:
--------------------------------------------------------------------------------
1 | // 1.7.10 and below
2 | 


--------------------------------------------------------------------------------
/src/main/java/com/replaymod/render/hooks/IForceChunkLoading.java:
--------------------------------------------------------------------------------
 1 | package com.replaymod.render.hooks;
 2 | 
 3 | import net.minecraft.client.renderer.WorldRenderer;
 4 | 
 5 | public interface IForceChunkLoading {
 6 |     void replayModRender_setHook(ForceChunkLoadingHook hook);
 7 | 
 8 |     static IForceChunkLoading from(WorldRenderer worldRenderer) {
 9 |         return (IForceChunkLoading) worldRenderer;
10 |     }
11 | }
12 | 


--------------------------------------------------------------------------------
/src/main/java/com/replaymod/render/hooks/Texture2DStateCallback.java:
--------------------------------------------------------------------------------
 1 | package com.replaymod.render.hooks;
 2 | 
 3 | import com.replaymod.gui.utils.Event;
 4 | 
 5 | public interface Texture2DStateCallback {
 6 |     Event EVENT = Event.create((listeners) ->
 7 |             (slot, enabled) -> {
 8 |                 for (Texture2DStateCallback listener : listeners) {
 9 |                     listener.texture2DStateChanged(slot, enabled);
10 |                 }
11 |             }
12 |     );
13 | 
14 |     void texture2DStateChanged(int slot, boolean enabled);
15 | }
16 | 


--------------------------------------------------------------------------------
/src/main/java/com/replaymod/render/processor/AbstractFrameProcessor.java:
--------------------------------------------------------------------------------
 1 | package com.replaymod.render.processor;
 2 | 
 3 | import com.replaymod.render.rendering.Frame;
 4 | import com.replaymod.render.rendering.FrameProcessor;
 5 | 
 6 | import java.io.IOException;
 7 | 
 8 | public abstract class AbstractFrameProcessor implements FrameProcessor {
 9 |     @Override
10 |     public void close() throws IOException {
11 |     }
12 | }
13 | 


--------------------------------------------------------------------------------
/src/main/java/com/replaymod/render/processor/DummyProcessor.java:
--------------------------------------------------------------------------------
 1 | package com.replaymod.render.processor;
 2 | 
 3 | import com.replaymod.render.rendering.Frame;
 4 | 
 5 | public class DummyProcessor extends AbstractFrameProcessor {
 6 |     @Override
 7 |     public F process(F rawFrame) {
 8 |         return rawFrame;
 9 |     }
10 | }
11 | 


--------------------------------------------------------------------------------
/src/main/java/com/replaymod/render/processor/GlToAbsoluteDepthProcessor.java:
--------------------------------------------------------------------------------
 1 | package com.replaymod.render.processor;
 2 | 
 3 | import com.replaymod.render.frame.BitmapFrame;
 4 | 
 5 | import java.nio.FloatBuffer;
 6 | 
 7 | public class GlToAbsoluteDepthProcessor extends AbstractFrameProcessor {
 8 |     // absolute depth is 2 * near * far / (far + near - (far - near) * (2 * z - 1))
 9 |     // precomputed:     [      a       ]  [    b     ]  [    c     ]
10 |     private final float a;
11 |     private final float b;
12 |     private final float c;
13 | 
14 |     public GlToAbsoluteDepthProcessor(float near, float far) {
15 |         a = 2 * near * far;
16 |         b = far + near;
17 |         c = far - near;
18 |     }
19 | 
20 |     @Override
21 |     public BitmapFrame process(BitmapFrame frame) {
22 | 
23 |         FloatBuffer buffer = frame.getByteBuffer().asFloatBuffer();
24 |         int len = buffer.remaining();
25 |         for (int i = 0; i < len; i++) {
26 |             float z = buffer.get(i);
27 |             z = a / (b - c * (2 * z - 1));
28 |             buffer.put(i, z);
29 |         }
30 | 
31 |         return frame;
32 |     }
33 | }
34 | 


--------------------------------------------------------------------------------
/src/main/java/com/replaymod/render/processor/OpenGlToBitmapProcessor.java:
--------------------------------------------------------------------------------
 1 | package com.replaymod.render.processor;
 2 | 
 3 | import com.replaymod.render.frame.BitmapFrame;
 4 | import com.replaymod.render.frame.OpenGlFrame;
 5 | import de.johni0702.minecraft.gui.utils.lwjgl.ReadableDimension;
 6 | 
 7 | import java.nio.ByteBuffer;
 8 | 
 9 | public class OpenGlToBitmapProcessor extends AbstractFrameProcessor {
10 | 
11 |     private byte[] row, rowSwap;
12 | 
13 |     @Override
14 |     public BitmapFrame process(OpenGlFrame rawFrame) {
15 |         // Flip whole image in place
16 | 
17 |         ReadableDimension size = rawFrame.getSize();
18 |         int bpp = rawFrame.getBytesPerPixel();
19 |         int rowSize = size.getWidth() * bpp;
20 |         if (row == null || row.length < rowSize) {
21 |             row = new byte[rowSize];
22 |             rowSwap = new byte[rowSize];
23 |         }
24 |         ByteBuffer buffer = rawFrame.getByteBuffer();
25 |         int rows = size.getHeight();
26 |         byte[] row = this.row;
27 |         byte[] rowSwap = this.rowSwap;
28 |         for (int i = 0; i < rows / 2; i++) {
29 |             int from = rowSize * i;
30 |             int to = rowSize * (rows - i - 1);
31 |             buffer.position(from);
32 |             buffer.get(row);
33 |             buffer.position(to);
34 |             buffer.get(rowSwap);
35 |             buffer.position(to);
36 |             buffer.put(row);
37 |             buffer.position(from);
38 |             buffer.put(rowSwap);
39 |         }
40 |         buffer.rewind();
41 |         return new BitmapFrame(rawFrame.getFrameId(), size, bpp, buffer);
42 |     }
43 | }
44 | 


--------------------------------------------------------------------------------
/src/main/java/com/replaymod/render/processor/StereoscopicToBitmapProcessor.java:
--------------------------------------------------------------------------------
 1 | package com.replaymod.render.processor;
 2 | 
 3 | import com.replaymod.render.frame.BitmapFrame;
 4 | import com.replaymod.render.frame.StereoscopicOpenGlFrame;
 5 | import com.replaymod.render.utils.ByteBufferPool;
 6 | import de.johni0702.minecraft.gui.utils.lwjgl.Dimension;
 7 | import de.johni0702.minecraft.gui.utils.lwjgl.ReadableDimension;
 8 | 
 9 | import java.nio.ByteBuffer;
10 | 
11 | import static com.replaymod.render.utils.Utils.openGlBytesToBitmap;
12 | 
13 | public class StereoscopicToBitmapProcessor extends AbstractFrameProcessor {
14 |     @Override
15 |     public BitmapFrame process(StereoscopicOpenGlFrame rawFrame) {
16 |         ReadableDimension size = rawFrame.getLeft().getSize();
17 |         int width = size.getWidth();
18 |         int bpp = rawFrame.getLeft().getBytesPerPixel();
19 |         ByteBuffer result = ByteBufferPool.allocate(width * 2 * size.getHeight() * bpp);
20 |         openGlBytesToBitmap(rawFrame.getLeft(), 0, 0, result, width * 2);
21 |         openGlBytesToBitmap(rawFrame.getRight(), size.getWidth(), 0, result, width * 2);
22 |         ByteBufferPool.release(rawFrame.getLeft().getByteBuffer());
23 |         ByteBufferPool.release(rawFrame.getRight().getByteBuffer());
24 |         return new BitmapFrame(rawFrame.getFrameId(), new Dimension(width * 2, size.getHeight()), bpp, result);
25 |     }
26 | }
27 | 


--------------------------------------------------------------------------------
/src/main/java/com/replaymod/render/rendering/Channel.java:
--------------------------------------------------------------------------------
1 | package com.replaymod.render.rendering;
2 | 
3 | public enum Channel {
4 |     BRGA,
5 |     DEPTH,
6 | }
7 | 


--------------------------------------------------------------------------------
/src/main/java/com/replaymod/render/rendering/Frame.java:
--------------------------------------------------------------------------------
1 | package com.replaymod.render.rendering;
2 | 
3 | public interface Frame {
4 |     int getFrameId();
5 | }
6 | 


--------------------------------------------------------------------------------
/src/main/java/com/replaymod/render/rendering/FrameCapturer.java:
--------------------------------------------------------------------------------
 1 | package com.replaymod.render.rendering;
 2 | 
 3 | import java.io.Closeable;
 4 | import java.util.Map;
 5 | 
 6 | public interface FrameCapturer extends Closeable {
 7 | 
 8 |     boolean isDone();
 9 | 
10 |     Map process();
11 | 
12 | }
13 | 


--------------------------------------------------------------------------------
/src/main/java/com/replaymod/render/rendering/FrameConsumer.java:
--------------------------------------------------------------------------------
 1 | package com.replaymod.render.rendering;
 2 | 
 3 | import java.io.Closeable;
 4 | import java.util.Map;
 5 | 
 6 | public interface FrameConsumer

extends Closeable { 7 | 8 | void consume(Map channels); 9 | 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/render/rendering/FrameProcessor.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.render.rendering; 2 | 3 | import java.io.Closeable; 4 | 5 | public interface FrameProcessor extends Closeable { 6 | 7 | P process(R rawFrame); 8 | 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/render/utils/StreamPipe.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.render.utils; 2 | 3 | import org.apache.commons.io.IOUtils; 4 | 5 | import java.io.IOException; 6 | import java.io.InputStream; 7 | import java.io.OutputStream; 8 | 9 | public class StreamPipe extends Thread { 10 | private final InputStream in; 11 | private final OutputStream out; 12 | 13 | public StreamPipe(InputStream in, OutputStream out) { 14 | super("StreamPipe from " + in + " to " + out); 15 | this.in = in; 16 | this.out = out; 17 | } 18 | 19 | @Override 20 | public void run() { 21 | try { 22 | IOUtils.copy(in, out); 23 | } catch (IOException ignored) { 24 | // We don't care 25 | // Note: Once we use this for something important, we should probably care! 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/replay/ReplaySender.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.replay; 2 | 3 | import com.replaymod.mixin.MinecraftAccessor; 4 | import com.replaymod.mixin.TimerAccessor; 5 | import net.minecraft.client.Minecraft; 6 | 7 | import static com.replaymod.core.versions.MCVer.getMinecraft; 8 | 9 | public interface ReplaySender { 10 | int currentTimeStamp(); 11 | 12 | /** 13 | * Whether the replay is currently paused. 14 | * 15 | * @return {@code true} if it is paused, {@code false} otherwise 16 | */ 17 | public default boolean paused() { 18 | Minecraft mc = getMinecraft(); 19 | TimerAccessor timer = (TimerAccessor) ((MinecraftAccessor) mc).getTimer(); 20 | return timer.getTickLength() == Float.POSITIVE_INFINITY; 21 | } 22 | 23 | void setReplaySpeed(double factor); 24 | 25 | double getReplaySpeed(); 26 | 27 | boolean isAsyncMode(); 28 | 29 | void setAsyncMode(boolean async); 30 | 31 | void setSyncModeAndWait(); 32 | 33 | void jumpToTime(int value); // async 34 | 35 | void sendPacketsTill(int replayTime); // sync 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/replay/Setting.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.replay; 2 | 3 | import com.replaymod.core.SettingsRegistry; 4 | import com.replaymod.replay.handler.GuiHandler.MainMenuButtonPosition; 5 | 6 | import java.util.Arrays; 7 | import java.util.stream.Collectors; 8 | 9 | public final class Setting extends SettingsRegistry.SettingKeys { 10 | public static final Setting SHOW_CHAT = make("showChat", "showchat", true); 11 | public static final Setting SHOW_SERVER_IPS = new Setting<>("showServerIPs", true); 12 | public static final SettingsRegistry.MultipleChoiceSettingKeys CAMERA = 13 | new SettingsRegistry.MultipleChoiceSettingKeys<>( 14 | "replay", "camera", "replaymod.gui.settings.camera", "replaymod.camera.classic"); 15 | public static final SettingsRegistry.MultipleChoiceSettingKeys MAIN_MENU_BUTTON = 16 | new SettingsRegistry.MultipleChoiceSettingKeys<>( 17 | "replay", "mainMenuButton", null, MainMenuButtonPosition.DEFAULT.name()); 18 | 19 | static { 20 | MAIN_MENU_BUTTON.setChoices(Arrays.stream(MainMenuButtonPosition.values()).map(Enum::name).collect(Collectors.toList())); 21 | } 22 | 23 | private static Setting make(String key, String displayName, T defaultValue) { 24 | return new Setting<>(key, displayName, defaultValue); 25 | } 26 | 27 | public Setting(String key, String displayString, T defaultValue) { 28 | super("replay", key, "replaymod.gui.settings." + displayString, defaultValue); 29 | } 30 | 31 | public Setting(String key, T defaultValue) { 32 | super("replay", key, null, defaultValue); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/replay/camera/CameraController.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.replay.camera; 2 | 3 | public interface CameraController { 4 | void update(float partialTicksPassed); 5 | 6 | void increaseSpeed(); 7 | 8 | void decreaseSpeed(); 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/replay/camera/CameraControllerRegistry.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.replay.camera; 2 | 3 | import com.google.common.base.Function; 4 | import com.google.common.base.Preconditions; 5 | import com.replaymod.replay.Setting; 6 | 7 | import java.util.ArrayList; 8 | import java.util.Collections; 9 | import java.util.Map; 10 | import java.util.Set; 11 | import java.util.concurrent.ConcurrentHashMap; 12 | 13 | public class CameraControllerRegistry { 14 | private final Map> constructors = new ConcurrentHashMap<>(); 15 | 16 | public void register(String name, Function constructor) { 17 | Preconditions.checkState(!constructors.containsKey(name), "Controller " + name + " is already registered."); 18 | constructors.put(name, constructor); 19 | Setting.CAMERA.setChoices(new ArrayList<>(getControllers())); 20 | } 21 | 22 | public Set getControllers() { 23 | return Collections.unmodifiableSet(constructors.keySet()); 24 | } 25 | 26 | public CameraController create(String name, CameraEntity cameraEntity) { 27 | return constructors.get(name).apply(cameraEntity); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/replay/events/RenderHotbarCallback.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.replay.events; 2 | 3 | import com.replaymod.gui.utils.Event; 4 | 5 | public interface RenderHotbarCallback { 6 | Event EVENT = Event.create((listeners) -> 7 | () -> { 8 | for (RenderHotbarCallback listener : listeners) { 9 | Boolean state = listener.shouldRenderHotbar(); 10 | if (state != null) { 11 | return state; 12 | } 13 | } 14 | return null; 15 | } 16 | ); 17 | 18 | Boolean shouldRenderHotbar(); 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/replay/events/RenderSpectatorCrosshairCallback.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.replay.events; 2 | 3 | import com.replaymod.gui.utils.Event; 4 | 5 | public interface RenderSpectatorCrosshairCallback { 6 | Event EVENT = Event.create((listeners) -> 7 | () -> { 8 | for (RenderSpectatorCrosshairCallback listener : listeners) { 9 | Boolean state = listener.shouldRenderSpectatorCrosshair(); 10 | if (state != null) { 11 | return state; 12 | } 13 | } 14 | return null; 15 | } 16 | ); 17 | 18 | Boolean shouldRenderSpectatorCrosshair(); 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/replay/events/ReplayChatMessageEvent.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.replay.events; 2 | 3 | import com.replaymod.replay.camera.CameraEntity; 4 | import net.minecraftforge.eventbus.api.Cancelable; 5 | import net.minecraftforge.eventbus.api.Event; 6 | 7 | @Cancelable 8 | public class ReplayChatMessageEvent extends Event { 9 | private final CameraEntity cameraEntity; 10 | 11 | public ReplayChatMessageEvent(CameraEntity cameraEntity) { 12 | this.cameraEntity = cameraEntity; 13 | } 14 | 15 | public CameraEntity getCameraEntity() { 16 | return cameraEntity; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/replay/events/ReplayClosedCallback.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.replay.events; 2 | 3 | import com.replaymod.gui.utils.Event; 4 | import com.replaymod.replay.ReplayHandler; 5 | 6 | public interface ReplayClosedCallback { 7 | Event EVENT = Event.create((listeners) -> 8 | (replayHandler) -> { 9 | for (ReplayClosedCallback listener : listeners) { 10 | listener.replayClosed(replayHandler); 11 | } 12 | }); 13 | 14 | void replayClosed(ReplayHandler replayHandler); 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/replay/events/ReplayClosingCallback.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.replay.events; 2 | 3 | import com.replaymod.gui.utils.Event; 4 | import com.replaymod.replay.ReplayHandler; 5 | 6 | import java.io.IOException; 7 | 8 | public interface ReplayClosingCallback { 9 | Event EVENT = Event.create((listeners) -> 10 | (replayHandler) -> { 11 | for (ReplayClosingCallback listener : listeners) { 12 | listener.replayClosing(replayHandler); 13 | } 14 | }); 15 | 16 | void replayClosing(ReplayHandler replayHandler) throws IOException; 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/replay/events/ReplayDispatchKeypressesEvent.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/src/main/java/com/replaymod/replay/events/ReplayDispatchKeypressesEvent.java -------------------------------------------------------------------------------- /src/main/java/com/replaymod/replay/events/ReplayOpenedCallback.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.replay.events; 2 | 3 | import com.replaymod.gui.utils.Event; 4 | import com.replaymod.replay.ReplayHandler; 5 | 6 | import java.io.IOException; 7 | 8 | public interface ReplayOpenedCallback { 9 | Event EVENT = Event.create((listeners) -> 10 | (replayHandler) -> { 11 | for (ReplayOpenedCallback listener : listeners) { 12 | listener.replayOpened(replayHandler); 13 | } 14 | }); 15 | 16 | void replayOpened(ReplayHandler replayHandler) throws IOException; 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/replaymod/replay/gui/screen/GuiOpeningReplay.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/src/main/java/com/replaymod/replay/gui/screen/GuiOpeningReplay.java -------------------------------------------------------------------------------- /src/main/java/com/replaymod/simplepathing/properties/ExplicitInterpolationProperty.java: -------------------------------------------------------------------------------- 1 | package com.replaymod.simplepathing.properties; 2 | 3 | import com.google.gson.stream.JsonReader; 4 | import com.google.gson.stream.JsonWriter; 5 | import com.replaymod.gui.utils.NonNull; 6 | import com.replaymod.replaystudio.pathing.property.AbstractProperty; 7 | import com.replaymod.replaystudio.pathing.property.PropertyPart; 8 | import org.apache.commons.lang3.ObjectUtils; 9 | 10 | import java.io.IOException; 11 | import java.util.Collection; 12 | import java.util.Collections; 13 | 14 | /** 15 | * Property indicating that the next path segment's interpolator is fixed 16 | */ 17 | public class ExplicitInterpolationProperty extends AbstractProperty { 18 | public static final ExplicitInterpolationProperty PROPERTY = new ExplicitInterpolationProperty(); 19 | 20 | private ExplicitInterpolationProperty() { 21 | super("interpolationFixed", "", null, new Object()); 22 | } 23 | 24 | @Override 25 | public Collection> getParts() { 26 | return Collections.emptyList(); 27 | } 28 | 29 | @Override 30 | public void applyToGame(Object value, @NonNull Object replayHandler) { 31 | // dummy property, do nothing 32 | } 33 | 34 | @Override 35 | public void toJson(JsonWriter writer, Object value) throws IOException { 36 | writer.nullValue(); 37 | } 38 | 39 | @Override 40 | public Object fromJson(JsonReader reader) throws IOException { 41 | reader.nextNull(); 42 | return ObjectUtils.NULL; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/resources/META-INF/mods.toml: -------------------------------------------------------------------------------- 1 | modLoader="javafml" 2 | loaderVersion="[35,)" 3 | issueTrackerURL="https://github.com/ReplayMod/ReplayMod/issues" 4 | showAsResourcePack=false 5 | license="GPLv3" 6 | [[mods]] 7 | modId="replaymod" 8 | version="2.5.1" 9 | displayName="Replay Mod" 10 | updateJSONURL="" 11 | displayURL="https://replaymod.com" 12 | logoFile="replaymod_logo.png" 13 | credits="I'd like to thank my mother and father." 14 | authors=["CrushedPixel", "johni0702"] 15 | description="A Mod which allows you to record, replay and share your Minecraft experience." 16 | 17 | [[dependencies.replaymod]] 18 | modId="forge" 19 | mandatory=true 20 | versionRange="[35,)" 21 | ordering="NONE" 22 | side="BOTH" 23 | 24 | [[dependencies.replaymod]] 25 | modId="minecraft" 26 | mandatory=true 27 | versionRange="[1.16.4]" 28 | ordering="NONE" 29 | side="BOTH" 30 | -------------------------------------------------------------------------------- /src/main/resources/ThankYou.txt: -------------------------------------------------------------------------------- 1 | Thanks to the following users for backing the Replay Mod on Kickstarter: 2 | 3 | legocreeperspy 4 | TheMinebox 5 | Ben Bostrom 6 | NiceMarkMC 7 | Itay Sharon 8 | Schnicks_NZ 9 | iTrebor 10 | bjaydubya 11 | BlackBeltPanda 12 | TZimon 13 | Ccoolboy 14 | Max Bloomstine 15 | Brendan George (waj171) 16 | Reflexin 17 | Vol4n3 18 | Cameron Bess - Bluffamuchuck 19 | Sorceror Nobody 20 | Misterx7772 21 | tripl3dogdare 22 | Talesseed 23 | RoboDuckMC 24 | Soapthgr8 25 | irtimaled 26 | Alexander Domashenko 27 | Jellomutt 28 | Charles T -------------------------------------------------------------------------------- /src/main/resources/assets/jgui/gui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/src/main/resources/assets/jgui/gui.png -------------------------------------------------------------------------------- /src/main/resources/assets/replaymod/camera_head.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/src/main/resources/assets/replaymod/camera_head.png -------------------------------------------------------------------------------- /src/main/resources/assets/replaymod/favicon_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/src/main/resources/assets/replaymod/favicon_logo.png -------------------------------------------------------------------------------- /src/main/resources/assets/replaymod/logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/src/main/resources/assets/replaymod/logo.jpg -------------------------------------------------------------------------------- /src/main/resources/assets/replaymod/replay_gui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/src/main/resources/assets/replaymod/replay_gui.png -------------------------------------------------------------------------------- /src/main/resources/assets/replaymod/shader/ods.frag: -------------------------------------------------------------------------------- 1 | #version 110 2 | 3 | varying vec4 vertColor; 4 | 5 | varying vec4 textureCoord; 6 | varying vec4 lightMapCoord; 7 | varying vec4 overlayCoords; 8 | 9 | uniform sampler2D texture; 10 | uniform sampler2D lightMap; 11 | uniform sampler2D overlay; 12 | 13 | uniform bool textureEnabled; 14 | uniform bool lightMapEnabled; 15 | uniform bool overlayEnabled; 16 | uniform bool fogEnabled; 17 | 18 | void main() { 19 | vec4 color = vertColor; 20 | if (textureEnabled) { 21 | color *= texture2D(texture, textureCoord.st); 22 | } 23 | if (overlayEnabled) { 24 | vec4 c = texture2D(overlay, overlayCoords.st); 25 | color = vec4(mix(c.rgb, color.rgb, c.a), color.a); 26 | } 27 | if (lightMapEnabled) { 28 | color *= texture2D(lightMap, lightMapCoord.st); 29 | } 30 | if (fogEnabled) { 31 | color.rgb = mix(color.rgb, gl_Fog.color.rgb, clamp((gl_FogFragCoord - gl_Fog.start) * gl_Fog.scale, 0.0, 1.0)); 32 | } 33 | gl_FragColor = color; 34 | } 35 | -------------------------------------------------------------------------------- /src/main/resources/assets/replaymod/sounds.json: -------------------------------------------------------------------------------- 1 | { 2 | "render_success": { 3 | "sounds": [{ "name": "replaymod:render_success" }] 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /src/main/resources/assets/replaymod/sounds/render_success.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/src/main/resources/assets/replaymod/sounds/render_success.ogg -------------------------------------------------------------------------------- /src/main/resources/default_thumb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/src/main/resources/default_thumb.jpg -------------------------------------------------------------------------------- /src/main/resources/dst_root_ca_x3.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDSjCCAjKgAwIBAgIQRK+wgNajJ7qJMDmGLvhAazANBgkqhkiG9w0BAQUFADA/ 3 | MSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMT 4 | DkRTVCBSb290IENBIFgzMB4XDTAwMDkzMDIxMTIxOVoXDTIxMDkzMDE0MDExNVow 5 | PzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMRcwFQYDVQQD 6 | Ew5EU1QgUm9vdCBDQSBYMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB 7 | AN+v6ZdQCINXtMxiZfaQguzH0yxrMMpb7NnDfcdAwRgUi+DoM3ZJKuM/IUmTrE4O 8 | rz5Iy2Xu/NMhD2XSKtkyj4zl93ewEnu1lcCJo6m67XMuegwGMoOifooUMM0RoOEq 9 | OLl5CjH9UL2AZd+3UWODyOKIYepLYYHsUmu5ouJLGiifSKOeDNoJjj4XLh7dIN9b 10 | xiqKqy69cK3FCxolkHRyxXtqqzTWMIn/5WgTe1QLyNau7Fqckh49ZLOMxt+/yUFw 11 | 7BZy1SbsOFU5Q9D8/RhcQPGX69Wam40dutolucbY38EVAjqr2m7xPi71XAicPNaD 12 | aeQQmxkqtilX4+U9m5/wAl0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNV 13 | HQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMSnsaR7LHH62+FLkHX/xBVghYkQMA0GCSqG 14 | SIb3DQEBBQUAA4IBAQCjGiybFwBcqR7uKGY3Or+Dxz9LwwmglSBd49lZRNI+DT69 15 | ikugdB/OEIKcdBodfpga3csTS7MgROSR6cz8faXbauX+5v3gTt23ADq1cEmv8uXr 16 | AvHRAosZy5Q6XkjEGB5YGV8eAlrwDPGxrancWYaLbumR9YbK+rlmM6pZW87ipxZz 17 | R8srzJmwN0jP41ZL9c8PDHIyh8bwRLtTcm1D9SZImlJnt1ir/md2cXjbDaJWFBM5 18 | JDGFoqgCWjBH4d1QB7wCCZAA62RjYJsWvIjJEubSfZGL+T0yjWW06XyxV3bqxbYo 19 | Ob8VZRzI9neWagqNdwvYkQsEjgfbKbYK7p2CNTUQ 20 | -----END CERTIFICATE----- 21 | -------------------------------------------------------------------------------- /src/main/resources/fabric.mod.json: -------------------------------------------------------------------------------- 1 | { 2 | "schemaVersion": 1, 3 | "id": "replaymod", 4 | "version": "${version}", 5 | 6 | "name": "Replay Mod", 7 | "description": "A Mod which allows you to record, replay and share your Minecraft experience.", 8 | "authors": [ 9 | "CrushedPixel", 10 | "johni0702" 11 | ], 12 | "contact": { 13 | "homepage": "https://replaymod.com/", 14 | "sources": "https://github.com/ReplayMod/ReplayMod" 15 | }, 16 | 17 | "license": "GPL-3.0-or-later", 18 | "icon": "assets/replaymod/favicon_logo.png", 19 | 20 | "environment": "client", 21 | "entrypoints": { 22 | "client": [ 23 | "com.replaymod.core.ReplayModBackend" 24 | ], 25 | "modmenu": [ 26 | "com.replaymod.core.gui.ModMenuApiImpl" 27 | ], 28 | "preLaunch": [ 29 | "com.replaymod.core.DummyChainLoadEntryPoint" 30 | ], 31 | "mm:early_risers": [ 32 | "com.replaymod.core.ReplayModMMLauncher" 33 | ] 34 | }, 35 | "mixins": [ 36 | "mixins.jgui.json", 37 | "mixins.nonmmlauncher.replaymod.json" 38 | ], 39 | 40 | "depends": { 41 | "fabricloader": ">=0.7.0", 42 | "fabric-networking-v0": "*", 43 | "fabric-keybindings-v0": "*", 44 | "fabric-resource-loader-v0": "*" 45 | }, 46 | 47 | "custom": { 48 | "mm:early_risers": [ 49 | "com.replaymod.core.ReplayModMMLauncher" 50 | ], 51 | "modmenu:clientsideOnly": true 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/main/resources/mixins.compat.mapwriter.replaymod.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": false, 3 | "package": "com.replaymod.compat.mapwriter.mixin", 4 | "mixins": [], 5 | "server": [], 6 | "client": [ 7 | ], 8 | "compatibilityLevel": "JAVA_8", 9 | "minVersion": "0.6.11", 10 | "refmap": "mixins.replaymod.refmap.json" 11 | } 12 | -------------------------------------------------------------------------------- /src/main/resources/mixins.compat.shaders.replaymod.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": false, 3 | "package": "com.replaymod.compat.shaders.mixin", 4 | "mixins": [], 5 | "server": [], 6 | "client": [ 7 | "MixinChunkVisibility", 8 | "MixinShaderEntityRenderer", 9 | "MixinShaderRenderChunk", 10 | "MixinShadersRender" 11 | ], 12 | "compatibilityLevel": "JAVA_8", 13 | "minVersion": "0.6.11", 14 | "refmap": "mixins.replaymod.refmap.json" 15 | } 16 | -------------------------------------------------------------------------------- /src/main/resources/mixins.core.replaymod.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": true, 3 | "package": "com.replaymod.core.mixin", 4 | "mixins": [], 5 | "server": [], 6 | "client": [ 7 | "Mixin_ContextualKeyBindings", 8 | "AbstractButtonWidgetAccessor", 9 | "MixinGameRenderer", 10 | "MixinMouse", 11 | "MixinKeyboardListener", 12 | "MixinMinecraft", 13 | "GuiMainMenuAccessor", 14 | "GuiScreenAccessor", 15 | "KeyBindingAccessor", 16 | "MinecraftAccessor", 17 | "TimerAccessor" 18 | ], 19 | "compatibilityLevel": "JAVA_8", 20 | "minVersion": "0.6.11", 21 | "refmap": "mixins.replaymod.refmap.json" 22 | } 23 | -------------------------------------------------------------------------------- /src/main/resources/mixins.extras.playeroverview.replaymod.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": true, 3 | "package": "com.replaymod.extras.playeroverview.mixin", 4 | "mixins": [], 5 | "server": [], 6 | "client": [ 7 | "com.replaymod.mixin.MixinRender" 8 | ], 9 | "compatibilityLevel": "JAVA_8", 10 | "minVersion": "0.6.11", 11 | "refmap": "mixins.replaymod.refmap.json" 12 | } 13 | -------------------------------------------------------------------------------- /src/main/resources/mixins.jgui.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": true, 3 | "package": "de.johni0702.minecraft.gui.versions.mixin", 4 | "mixins": [], 5 | "server": [], 6 | "client": [ 7 | ], 8 | "compatibilityLevel": "JAVA_8", 9 | "minVersion": "0.6.11", 10 | "refmap": "mixins.jgui.refmap.json" 11 | } 12 | -------------------------------------------------------------------------------- /src/main/resources/mixins.nonmmlauncher.replaymod.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": true, 3 | "package": "com.replaymod.mmdummy", 4 | "plugin": "com.replaymod.core.ReplayModNonMMLauncher", 5 | "mixins": [], 6 | "server": [], 7 | "client": [], 8 | "compatibilityLevel": "JAVA_8", 9 | "minVersion": "0.6.11", 10 | "refmap": "mixins.nonmmlauncher.replaymod.refmap.json" 11 | } -------------------------------------------------------------------------------- /src/main/resources/mixins.recording.replaymod.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": true, 3 | "package": "com.replaymod.recording.mixin", 4 | "mixins": [], 5 | "server": [], 6 | "client": [ 7 | "AddServerScreenAccessor", 8 | "EntityLivingBaseAccessor", 9 | "IntegratedServerAccessor", 10 | "NetworkManagerAccessor", 11 | "SPacketSpawnMobAccessor", 12 | "SPacketSpawnPlayerAccessor", 13 | "MixinServerInfo", 14 | "MixinDownloadingPackFinder", 15 | "MixinMouseHelper", 16 | "MixinWorldClient", 17 | "MixinNetHandlerLoginClient", 18 | "MixinNetHandlerPlayClient", 19 | "MixinRenderGlobal" 20 | ], 21 | "compatibilityLevel": "JAVA_8", 22 | "minVersion": "0.6.11", 23 | "refmap": "mixins.replaymod.refmap.json" 24 | } 25 | -------------------------------------------------------------------------------- /src/main/resources/mixins.render.blend.replaymod.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": true, 3 | "package": "com.replaymod.render.blend.mixin", 4 | "mixins": [], 5 | "server": [], 6 | "client": [ 7 | "ItemRendererAccessor", 8 | "ParticleAccessor", 9 | "Mixin_RenderGlobal", 10 | "MixinRenderItem", 11 | "MixinRenderLivingBase", 12 | "Mixin_RenderManager" 13 | ], 14 | "compatibilityLevel": "JAVA_8", 15 | "minVersion": "0.6.11", 16 | "refmap": "mixins.replaymod.refmap.json" 17 | } 18 | -------------------------------------------------------------------------------- /src/main/resources/mixins.render.replaymod.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": true, 3 | "package": "com.replaymod.render.mixin", 4 | "mixins": [], 5 | "server": [], 6 | "client": [ 7 | "Mixin_ChromaKeyColorSky", 8 | "Mixin_ChromaKeyDisableFog", 9 | "Mixin_ChromaKeyForceSky", 10 | "Mixin_ForceChunkLoading", 11 | "Mixin_HideNameTags", 12 | "Mixin_HideNameTags_LivingEntity", 13 | "Mixin_Omnidirectional_Camera", 14 | "Mixin_Omnidirectional_DisableFrustumCulling", 15 | "Mixin_Omnidirectional_Rotation", 16 | "Mixin_Omnidirectional_SkipHand", 17 | "Mixin_SkipBlockOutlinesDuringRender", 18 | "Mixin_StabilizeCamera", 19 | "Mixin_Stereoscopic_Camera", 20 | "Mixin_Stereoscopic_HandRenderPass", 21 | "Mixin_BlockOnChunkRebuilds", 22 | "Mixin_PreserveDepthDuringHandRendering", 23 | "Mixin_WindowsWorkaroundForTinyEXRNatives", 24 | "MainWindowAccessor", 25 | "WorldRendererAccessor", 26 | "MixinParticleManager", 27 | "MixinEntityRenderer", 28 | "MixinGlStateManager", 29 | "MixinRenderManager" 30 | ], 31 | "compatibilityLevel": "JAVA_8", 32 | "minVersion": "0.6.11", 33 | "refmap": "mixins.replaymod.refmap.json" 34 | } 35 | -------------------------------------------------------------------------------- /src/main/resources/mixins.replay.replaymod.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": true, 3 | "package": "com.replaymod.replay.mixin", 4 | "plugin": "com.replaymod.core.ReplayModMixinConfigPlugin", 5 | "mixins": [], 6 | "server": [], 7 | "client": [ 8 | "Mixin_MoveRealmsButton", 9 | "MixinCamera", 10 | "MixinInGameHud", 11 | "com.replaymod.mixin.Mixin_EntityLivingBaseAccessor", 12 | "Mixin_ShowSpectatedHand_NoOF", 13 | "Mixin_ShowSpectatedHand_OF", 14 | "EntityPlayerAccessor", 15 | "FirstPersonRendererAccessor", 16 | "com.replaymod.mixin.Mixin_ParticleManager", 17 | "MixinGuiSpectator", 18 | "MixinRenderArrow", 19 | "MixinViewFrustum", 20 | "com.replaymod.mixin.Mixin_KeyboardListener", 21 | "com.replaymod.mixin.Mixin_PlayerControllerMP", 22 | "com.replaymod.mixin.Mixin_RenderItem", 23 | "com.replaymod.mixin.Mixin_RenderLivingBase", 24 | "MixinTileEntityEndPortalRenderer", 25 | "MixinWorldClient" 26 | ], 27 | "compatibilityLevel": "JAVA_8", 28 | "minVersion": "0.6.11", 29 | "refmap": "mixins.replaymod.refmap.json" 30 | } 31 | -------------------------------------------------------------------------------- /src/main/resources/pack.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "pack": { 3 | "description": "ReplayMod resources", 4 | "pack_format": 6 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/main/resources/replaymod_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unhappychoice/ReplayMod/daefeb3c68d349f5f7c95117a19185ae8a491105/src/main/resources/replaymod_logo.png -------------------------------------------------------------------------------- /version.txt: -------------------------------------------------------------------------------- 1 | 2.5.2 2 | --------------------------------------------------------------------------------