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

@@ -12,7 +12,7 @@ public class KeybindRegistry {
public static final String KEY_LIGHTING = "replaymod.input.lighting";
public static final String KEY_THUMBNAIL = "replaymod.input.thumbnail";
public static final String KEY_SPECTATE = "replaymod.input.spectate";
public static final String KEY_PLAYER_OVERVIEW = "replaymod.input.playeroverview";
public static final String KEY_CLEAR_KEYFRAMES = "replaymod.input.clearkeyframes";
public static final String KEY_SYNC_TIMELINE = "replaymod.input.synctimeline";
public static final String KEY_KEYFRAME_PRESETS = "replaymod.input.keyframerepository";
@@ -27,7 +27,7 @@ public class KeybindRegistry {
bindings.add(new KeyBinding(KEY_LIGHTING, Keyboard.KEY_M, "replaymod.title"));
bindings.add(new KeyBinding(KEY_THUMBNAIL, Keyboard.KEY_N, "replaymod.title"));
bindings.add(new KeyBinding(KEY_SPECTATE, Keyboard.KEY_B, "replaymod.title"));
bindings.add(new KeyBinding(KEY_PLAYER_OVERVIEW, Keyboard.KEY_B, "replaymod.title"));
bindings.add(new KeyBinding(KEY_SYNC_TIMELINE, Keyboard.KEY_V, "replaymod.title"));
bindings.add(new KeyBinding(KEY_CLEAR_KEYFRAMES, Keyboard.KEY_C, "replaymod.title"));
bindings.add(new KeyBinding(KEY_KEYFRAME_PRESETS, Keyboard.KEY_X, "replaymod.title"));

View File

@@ -0,0 +1,67 @@
package eu.crushedpixel.replaymod.registry;
import com.google.common.base.Predicate;
import eu.crushedpixel.replaymod.entities.CameraEntity;
import eu.crushedpixel.replaymod.gui.GuiPlayerOverview;
import eu.crushedpixel.replaymod.replay.ReplayHandler;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import java.util.ArrayList;
import java.util.List;
public class PlayerHandler {
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;
}
};
private static List<Integer> hidden = new ArrayList<Integer>();
public static void hidePlayer(EntityPlayer player) {
hidden.remove((Integer) player.getEntityId());
hidden.add(player.getEntityId());
}
public static void showPlayer(EntityPlayer player) {
hidden.remove((Integer) player.getEntityId());
}
public static void setIsVisible(EntityPlayer player, boolean visible) {
if(visible) showPlayer(player);
else hidePlayer(player);
}
public static List<Integer> getHiddenPlayers() {
return hidden;
}
public static boolean isHidden(int id) {
return hidden.contains(id);
}
public static void resetHiddenPlayers() {
for(int i : hidden) {
Entity ent = mc.theWorld.getEntityByID(i);
if(ent != null) {
ent.setInvisible(false);
}
}
}
public static void openPlayerOverview() {
if(!ReplayHandler.isInReplay()) {
return;
}
List<EntityPlayer> players = mc.theWorld.getEntities(EntityPlayer.class, playerPredicate);
mc.displayGuiScreen(new GuiPlayerOverview(players));
}
}