Merge branch 1.11.2 into 1.12
13bb0bdMerge branch 1.11-staging into 1.11.2-staging5257a41Merge branch 1.10.2 into 1.11689f897Merge branch 1.9.4 into 1.10.20aed9c3Merge branch 1.8.9 into 1.9.4f36ebf1Merge branch 1.8 into 1.8.908170b3Downgrade FG to 2.1 because FG 2.2 is 1.9+ only41d2547Update translations00e999fFix replay not being closed when opened via URI scheme handler (fixes #92)767ea29Fix book gui not being suppressed during replay (fixes #90)5b04edbHide ReplayMod app entry from menus on Linux6aff99dFix livelock during netty write to embedded channel (fixes #85)703805fFix infinite loop in mc.scheduledTasks (fixes #86)7a4440cUpdate ReplayStudio0b9c56cFix resource packs not working after first time jumping back in time933ee5f[Compat] Fix camera entity with BetterSprinting prior to 2.0.0 (fixes #78)83b1090Fix hotbar being visible while spectating player (fixes #83)5c73117[Compat] Fix invisible entities with Orange's 1.7 Animations (fixes #78)4704b29Replace the RenderPlayer hook (used subclassing) with a mixin (fixes #79)0c226b0Fix path at end of replay resulting in constant reloading (fixes #56)1b9b13eRename render success sound to all lowercase (required for 1.11) (fixes #66)c2000b3Fix only front-facing chunks visible for ODS rendering (fixes #67)aafeeccFix initial login gui not closing on success (fixes #68)9292addUse percent-encoding for replay file names (fixes #71)8499c0fFix name of invis armor stand with CustomNameVisible not rendering (fixes #72)b9ea572Try to handle invalid ffmpeg arguments more gracefully (fixes #77)a2f8c88Fix compression packets being recorded (fixes #80)19629c3Replace usages of System.out with loggerfe1d9b8Stop Forge from allowing the mod to load on other MC versions (fixes #82)d56fa9bUpdate ReplayStudio/MCProtocolLib (Fixes missing ARMOR_STAND MobType)7c719e0Update ReplayStudio/MCProtocolLib (Fixes missing ARMOR_STAND MobType)1a1e96cFix server with RM installed refusing clients without RM (fixes #76)35eb9caReplace usage of FMLLog with the mod logger
This commit is contained in:
@@ -10,7 +10,10 @@ import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
||||
@Mod(modid = ReplayModExtras.MOD_ID,
|
||||
version = "@MOD_VERSION@",
|
||||
@@ -33,6 +36,8 @@ public class ReplayModExtras {
|
||||
OpenEyeExtra.class
|
||||
);
|
||||
|
||||
private final Map<Class<? extends Extra>, Extra> instances = new HashMap<>();
|
||||
|
||||
public static Logger LOGGER;
|
||||
|
||||
@Mod.EventHandler
|
||||
@@ -46,9 +51,14 @@ public class ReplayModExtras {
|
||||
try {
|
||||
Extra extra = cls.newInstance();
|
||||
extra.register(ReplayMod.instance);
|
||||
instances.put(cls, extra);
|
||||
} catch (Throwable t) {
|
||||
LOGGER.warn("Failed to load extra " + cls.getName() + ": ", t);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public <T extends Extra> Optional<T> get(Class<T> cls) {
|
||||
return Optional.ofNullable(instances.get(cls)).map(cls::cast);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,8 +9,6 @@ import com.replaymod.replay.ReplayModReplay;
|
||||
import com.replaymod.replay.camera.CameraEntity;
|
||||
import com.replaymod.replay.events.ReplayCloseEvent;
|
||||
import com.replaymod.replay.events.ReplayOpenEvent;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.client.renderer.entity.RenderPlayer;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraftforge.client.event.RenderHandEvent;
|
||||
@@ -58,12 +56,6 @@ public class PlayerOverview implements Extra {
|
||||
});
|
||||
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
|
||||
RenderManager renderManager = mod.getMinecraft().getRenderManager();
|
||||
@SuppressWarnings("unchecked")
|
||||
Map<String, RenderPlayer> skinMap = renderManager.skinMap;
|
||||
skinMap.put("default", new PlayerRenderHook(this, renderManager, false));
|
||||
skinMap.put("slim", new PlayerRenderHook(this, renderManager, true));
|
||||
}
|
||||
|
||||
public boolean isHidden(UUID uuid) {
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
package com.replaymod.extras.playeroverview;
|
||||
|
||||
import net.minecraft.client.entity.AbstractClientPlayer;
|
||||
import net.minecraft.client.renderer.culling.ICamera;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.client.renderer.entity.RenderPlayer;
|
||||
|
||||
public class PlayerRenderHook extends RenderPlayer {
|
||||
private final PlayerOverview extra;
|
||||
|
||||
public PlayerRenderHook(PlayerOverview extra, RenderManager renderManager, boolean useSmallArms) {
|
||||
super(renderManager, useSmallArms);
|
||||
this.extra = extra;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender(AbstractClientPlayer entity, ICamera camera, double camX, double camY, double camZ) {
|
||||
return !extra.isHidden(entity.getUniqueID()) && super.shouldRender(entity, camera, camX, camY, camZ);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.replaymod.extras.playeroverview.mixin;
|
||||
|
||||
import com.replaymod.extras.ReplayModExtras;
|
||||
import com.replaymod.extras.playeroverview.PlayerOverview;
|
||||
import net.minecraft.client.renderer.culling.ICamera;
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
|
||||
/**
|
||||
* This mixin prevents players that are hidden in the PlayerOverview from being rendered.
|
||||
*
|
||||
* Cancelling the RenderPlayerEvent.Pre is insufficient because it affects neither the shadows nor the fire texture.
|
||||
* See: https://github.com/MinecraftForge/MinecraftForge/issues/2987
|
||||
*
|
||||
* The previous solution was to overwrite the RenderPlayer instances which has been dropped in favor of this one
|
||||
* because it is less compatible with other mods whereas this one should be fine as long as no other mod completely
|
||||
* overwrites the shouldRender method.
|
||||
* One example of the previous solution breaking is when used with VanillaEnhancements because it replaces the
|
||||
* RenderManager with a new custom one which in turn will reset our registered RenderPlayer instances because
|
||||
* it does so after we have already registered with the old RenderManager.
|
||||
*/
|
||||
@Mixin(value = Render.class, priority = 1200)
|
||||
public abstract class MixinRender {
|
||||
@Inject(method = "shouldRender", at=@At("HEAD"), cancellable = true)
|
||||
public void replayModExtras_isPlayerHidden(Entity entity, ICamera camera, double camX, double camY, double camZ, CallbackInfoReturnable<Boolean> ci) {
|
||||
ReplayModExtras.instance.get(PlayerOverview.class).ifPresent(playerOverview -> {
|
||||
if (entity instanceof EntityPlayer) {
|
||||
EntityPlayer player = (EntityPlayer) entity;
|
||||
if (playerOverview.isHidden(player.getUniqueID())) {
|
||||
ci.setReturnValue(false);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -25,6 +25,7 @@ public class LinuxUriScheme extends UriScheme {
|
||||
"Icon=" + iconFile.getAbsolutePath().replace("\\", "\\\\").replace("\"", "\\\"") + "\n" +
|
||||
"Type=Application\n" +
|
||||
"Terminal=false\n" +
|
||||
"NoDisplay=true\n" +
|
||||
"MimeType=x-scheme-handler/replaymod;";
|
||||
|
||||
FileOutputStream out = new FileOutputStream(file);
|
||||
|
||||
@@ -36,6 +36,8 @@ import java.security.GeneralSecurityException;
|
||||
import java.util.Collections;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
import static com.replaymod.extras.ReplayModExtras.LOGGER;
|
||||
|
||||
public class YoutubeUploader {
|
||||
private static final String CLIENT_ID = "743126594724-mfe7pj1k7e47uu5pk4503c8st9vj9ibu.apps.googleusercontent.com";
|
||||
private static final String CLIENT_SECRET = "gMwcy3mRYCRamCIjJIYP7rqc";
|
||||
@@ -137,7 +139,7 @@ public class YoutubeUploader {
|
||||
|
||||
CommandLine commandLine = new CommandLine(settings.getExportCommand());
|
||||
commandLine.addArguments(args);
|
||||
System.out.println("Re-encoding for ODS with " + settings.getExportCommand() + args);
|
||||
LOGGER.info("Re-encoding for ODS with {} {}", settings.getExportCommand(), args);
|
||||
Process process = new ProcessBuilder(commandLine.toStrings()).directory(videoFile.getParentFile()).start();
|
||||
|
||||
final AtomicBoolean active = new AtomicBoolean(true);
|
||||
@@ -149,7 +151,7 @@ public class YoutubeUploader {
|
||||
char c = (char) in.read();
|
||||
if (c == '\r') {
|
||||
String str = sb.toString();
|
||||
System.out.println(str);
|
||||
LOGGER.debug("[FFmpeg] {}", str);
|
||||
if (str.startsWith("frame=")) {
|
||||
str = str.substring(6).trim();
|
||||
str = str.substring(0, str.indexOf(' '));
|
||||
|
||||
Reference in New Issue
Block a user