Started implementing Spectator Hand Rendering
This commit is contained in:
@@ -3,13 +3,13 @@ package eu.crushedpixel.replaymod.api.replay.holders;
|
|||||||
public class FileRating {
|
public class FileRating {
|
||||||
|
|
||||||
private int file;
|
private int file;
|
||||||
private boolean rating;
|
private String rating;
|
||||||
|
|
||||||
public int getFileID() {
|
public int getFileID() {
|
||||||
return file;
|
return file;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean getRating() {
|
public boolean getRating() {
|
||||||
return rating;
|
return rating.equals("1");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -300,6 +300,8 @@ public class GuiReplayCenter extends GuiScreen implements GuiYesNoCallback {
|
|||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
mc.displayGuiScreen(this);
|
mc.displayGuiScreen(this);
|
||||||
|
elementSelected(currentList.selected);
|
||||||
|
initGui();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,14 +26,14 @@ public class FavoritedFileHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void addToFavorites(Integer id) throws IOException, ApiException {
|
public void addToFavorites(Integer id) throws IOException, ApiException {
|
||||||
|
ReplayMod.apiClient.favFile(AuthenticationHandler.getKey(), id, true);
|
||||||
favorited.remove(id);
|
favorited.remove(id);
|
||||||
favorited.add(id);
|
favorited.add(id);
|
||||||
ReplayMod.apiClient.favFile(AuthenticationHandler.getKey(), id, true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removeFromFavorites(Integer id) throws IOException, ApiException {
|
public void removeFromFavorites(Integer id) throws IOException, ApiException {
|
||||||
favorited.remove(id);
|
|
||||||
ReplayMod.apiClient.favFile(AuthenticationHandler.getKey(), id, false);
|
ReplayMod.apiClient.favFile(AuthenticationHandler.getKey(), id, false);
|
||||||
|
favorited.remove(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void reloadFavorites() {
|
public void reloadFavorites() {
|
||||||
|
|||||||
@@ -28,12 +28,12 @@ public class RatedFileHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void rateFile(int id, Rating.RatingType type) throws IOException, ApiException {
|
public void rateFile(int id, Rating.RatingType type) throws IOException, ApiException {
|
||||||
|
ReplayMod.apiClient.rateFile(AuthenticationHandler.getKey(), id, type);
|
||||||
if(type == Rating.RatingType.LIKE || type == Rating.RatingType.DISLIKE) {
|
if(type == Rating.RatingType.LIKE || type == Rating.RatingType.DISLIKE) {
|
||||||
rated.put(id, type == Rating.RatingType.LIKE);
|
rated.put(id, type == Rating.RatingType.LIKE);
|
||||||
} else {
|
} else {
|
||||||
rated.remove(id);
|
rated.remove(id);
|
||||||
}
|
}
|
||||||
ReplayMod.apiClient.rateFile(AuthenticationHandler.getKey(), id, type);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void reloadRatings() {
|
public void reloadRatings() {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import net.minecraft.client.renderer.EntityRenderer;
|
|||||||
|
|
||||||
public class SafeEntityRenderer extends EntityRenderer {
|
public class SafeEntityRenderer extends EntityRenderer {
|
||||||
|
|
||||||
public SafeEntityRenderer(Minecraft mcIn, EntityRenderer renderer) throws IllegalArgumentException, IllegalAccessException {
|
public SafeEntityRenderer(Minecraft mcIn, EntityRenderer renderer) {
|
||||||
super(mcIn, renderer.resourceManager);
|
super(mcIn, renderer.resourceManager);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,72 @@
|
|||||||
|
package eu.crushedpixel.replaymod.renderer;
|
||||||
|
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.renderer.EntityRenderer;
|
||||||
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
import org.lwjgl.util.glu.Project;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by mariusmetzger on 24/05/15.
|
||||||
|
*/
|
||||||
|
public class SpectatorRenderer extends SafeEntityRenderer {
|
||||||
|
|
||||||
|
private final Minecraft mc;
|
||||||
|
|
||||||
|
public SpectatorRenderer(Minecraft mcIn, EntityRenderer renderer) {
|
||||||
|
super(mcIn, renderer);
|
||||||
|
this.mc = mcIn;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void renderHand(float p_78476_1_, int p_78476_2_) {
|
||||||
|
GlStateManager.matrixMode(5889);
|
||||||
|
GlStateManager.loadIdentity();
|
||||||
|
float f1 = 0.07F;
|
||||||
|
|
||||||
|
if (this.mc.gameSettings.anaglyph)
|
||||||
|
{
|
||||||
|
GlStateManager.translate((float)(-(p_78476_2_ * 2 - 1)) * f1, 0.0F, 0.0F);
|
||||||
|
}
|
||||||
|
|
||||||
|
Project.gluPerspective(this.getFOVModifier(p_78476_1_, false), (float) this.mc.displayWidth / (float) this.mc.displayHeight, 0.05F, this.farPlaneDistance * 2.0F);
|
||||||
|
GlStateManager.matrixMode(5888);
|
||||||
|
GlStateManager.loadIdentity();
|
||||||
|
|
||||||
|
if (this.mc.gameSettings.anaglyph)
|
||||||
|
{
|
||||||
|
GlStateManager.translate((float)(p_78476_2_ * 2 - 1) * 0.1F, 0.0F, 0.0F);
|
||||||
|
}
|
||||||
|
|
||||||
|
GlStateManager.pushMatrix();
|
||||||
|
this.hurtCameraEffect(p_78476_1_);
|
||||||
|
|
||||||
|
if (this.mc.gameSettings.viewBobbing)
|
||||||
|
{
|
||||||
|
this.setupViewBobbing(p_78476_1_);
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean flag = this.mc.getRenderViewEntity() instanceof EntityLivingBase && ((EntityLivingBase)this.mc.getRenderViewEntity()).isPlayerSleeping();
|
||||||
|
|
||||||
|
if (this.mc.gameSettings.thirdPersonView == 0 && !flag && !this.mc.gameSettings.hideGUI && !this.mc.playerController.isSpectator())
|
||||||
|
{
|
||||||
|
this.enableLightmap();
|
||||||
|
this.itemRenderer.renderItemInFirstPerson(p_78476_1_);
|
||||||
|
this.disableLightmap();
|
||||||
|
}
|
||||||
|
|
||||||
|
GlStateManager.popMatrix();
|
||||||
|
|
||||||
|
if (this.mc.gameSettings.thirdPersonView == 0 && !flag)
|
||||||
|
{
|
||||||
|
this.itemRenderer.renderOverlays(p_78476_1_);
|
||||||
|
this.hurtCameraEffect(p_78476_1_);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.mc.gameSettings.viewBobbing)
|
||||||
|
{
|
||||||
|
this.setupViewBobbing(p_78476_1_);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -49,6 +49,10 @@ public net.minecraft.client.renderer.EntityRenderer func_78468_a(IF)V # setupFog
|
|||||||
public net.minecraft.client.renderer.EntityRenderer func_78466_h(F)V # updateFogColor
|
public net.minecraft.client.renderer.EntityRenderer func_78466_h(F)V # updateFogColor
|
||||||
public net.minecraft.client.renderer.EntityRenderer func_78472_g(F)V # updateLightmap
|
public net.minecraft.client.renderer.EntityRenderer func_78472_g(F)V # updateLightmap
|
||||||
|
|
||||||
|
public net.minecraft.client.renderer.EntityRenderer func_78482_e(F)V # hurtCameraEffect
|
||||||
|
public net.minecraft.client.renderer.EntityRenderer func_78475_f(F)V # setupViewBobbing
|
||||||
|
public net.minecraft.client.renderer.EntityRenderer func_78476_b(FI)V # renderHand
|
||||||
|
|
||||||
# RenderGlobal
|
# RenderGlobal
|
||||||
public net.minecraft.client.renderer.RenderGlobal field_174995_M # renderDispatcher
|
public net.minecraft.client.renderer.RenderGlobal field_174995_M # renderDispatcher
|
||||||
public net.minecraft.client.renderer.RenderGlobal field_147595_R # displayListEntitiesDirty
|
public net.minecraft.client.renderer.RenderGlobal field_147595_R # displayListEntitiesDirty
|
||||||
|
|||||||
Reference in New Issue
Block a user