Files
ReplayModCinematic/src/main/java/eu/crushedpixel/replaymod/replay/spectate/SpectateHandler.java
Marius Metzger b4ce266375 Disabled Head rotation while saving replay video
Made video rendering possible while Minecraft is in background
2015-03-08 22:51:50 +01:00

35 lines
974 B
Java

package eu.crushedpixel.replaymod.replay.spectate;
import java.util.List;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.EntityPlayer;
import com.google.common.base.Predicate;
import eu.crushedpixel.replaymod.entities.CameraEntity;
import eu.crushedpixel.replaymod.gui.GuiSpectateSelection;
import eu.crushedpixel.replaymod.replay.ReplayHandler;
public class SpectateHandler {
private static Minecraft mc = Minecraft.getMinecraft();
private static Predicate<EntityPlayer> playerPredicate = new Predicate<EntityPlayer>() {
@Override
public boolean apply(EntityPlayer input) {
if(input instanceof CameraEntity || input == mc.thePlayer) return false;
return true;
}
};
public static void openSpectateSelection() {
if(!ReplayHandler.isInReplay()) {
return;
}
List<EntityPlayer> players = mc.theWorld.getEntities(EntityPlayer.class, playerPredicate);
mc.displayGuiScreen(new GuiSpectateSelection(players));
}
}