Replaced Spectate Selection GUI with Player Overview GUI, added way to hide specific players

Updated Skin File retrieving to new Mojang API

IMPORTANT: clean and rebuild the IntelliJ project, Access Transformers added!
This commit is contained in:
CrushedPixel
2015-05-20 16:40:17 +02:00
parent 80fbcddb87
commit ce9e717d21
12 changed files with 454 additions and 244 deletions

View File

@@ -4,6 +4,7 @@ import com.mojang.authlib.GameProfile;
import eu.crushedpixel.replaymod.ReplayMod;
import eu.crushedpixel.replaymod.entities.CameraEntity;
import eu.crushedpixel.replaymod.holders.*;
import eu.crushedpixel.replaymod.registry.PlayerHandler;
import eu.crushedpixel.replaymod.utils.ReplayFile;
import eu.crushedpixel.replaymod.utils.ReplayFileIO;
import net.minecraft.client.Minecraft;
@@ -343,6 +344,8 @@ public class ReplayHandler {
KeyframeSet[] paths = currentReplayFile.paths().get();
ReplayHandler.setKeyframeRepository(paths == null ? new KeyframeSet[0] : paths, false);
PlayerHandler.resetHiddenPlayers();
ReplayMod.replaySender = new ReplaySender(currentReplayFile, true);
channel.pipeline().addFirst(ReplayMod.replaySender);
channel.pipeline().fireChannelActive();

View File

@@ -1,32 +0,0 @@
package eu.crushedpixel.replaymod.replay.spectate;
import com.google.common.base.Predicate;
import eu.crushedpixel.replaymod.entities.CameraEntity;
import eu.crushedpixel.replaymod.gui.GuiSpectateSelection;
import eu.crushedpixel.replaymod.replay.ReplayHandler;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.EntityPlayer;
import java.util.List;
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));
}
}