Fixed Spectator mode particles and sounds computed from where you have been before (MC-46445) (#4728)

This commit is contained in:
CreativeMD 2018-04-01 09:40:26 +02:00 committed by LexManos
parent e82a7605dc
commit 6f642ba6ce
6 changed files with 58 additions and 2 deletions

View file

@ -143,6 +143,15 @@
if (p_147108_1_ instanceof GuiMainMenu || p_147108_1_ instanceof GuiMultiplayer)
{
this.field_71474_y.field_74330_P = false;
@@ -1082,7 +1100,7 @@
long i1 = System.nanoTime() - l;
this.func_71361_d("Pre render");
this.field_71424_I.func_76318_c("sound");
- this.field_147127_av.func_147691_a(this.field_71439_g, this.field_71428_T.field_194147_b);
+ this.field_147127_av.setListener(this.func_175606_aa(), this.field_71428_T.field_194147_b); //Forge: MC-46445 Spectator mode particles and sounds computed from where you have been before
this.field_71424_I.func_76319_b();
this.field_71424_I.func_76320_a("render");
GlStateManager.func_179094_E();
@@ -1094,11 +1112,13 @@
if (!this.field_71454_w)

View file

@ -38,3 +38,15 @@
for (ResourceLocation resourcelocation : this.field_147697_e.func_148742_b())
{
SoundEventAccessor soundeventaccessor = (SoundEventAccessor)this.field_147697_e.func_82594_a(resourcelocation);
@@ -253,6 +268,11 @@
this.field_147694_f.func_148615_a(p_147691_1_, p_147691_2_);
}
+ public void setListener(net.minecraft.entity.Entity entity, float partialTicks)
+ {
+ this.field_147694_f.setListener(entity, partialTicks);
+ }
+
public void func_147689_b()
{
this.field_147694_f.func_148610_e();

View file

@ -47,3 +47,15 @@
}
field_148621_b.debug(field_148623_a, "Playing sound {} for event {} as channel {}", sound.func_188719_a(), resourcelocation, s);
@@ -507,6 +515,11 @@
public void func_148615_a(EntityPlayer p_148615_1_, float p_148615_2_)
{
+ setListener((net.minecraft.entity.Entity) p_148615_1_, p_148615_2_);
+ }
+
+ public void setListener(net.minecraft.entity.Entity p_148615_1_, float p_148615_2_)
+ {
if (this.field_148617_f && p_148615_1_ != null)
{
float f = p_148615_1_.field_70127_C + (p_148615_1_.field_70125_A - p_148615_1_.field_70127_C) * p_148615_2_;

View file

@ -1,6 +1,18 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/ActiveRenderInfo.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/ActiveRenderInfo.java
@@ -108,4 +108,14 @@
@@ -30,6 +30,11 @@
public static void func_74583_a(EntityPlayer p_74583_0_, boolean p_74583_1_)
{
+ updateRenderInfo((Entity) p_74583_0_, p_74583_1_);
+ }
+
+ public static void updateRenderInfo(Entity p_74583_0_, boolean p_74583_1_)
+ {
GlStateManager.func_179111_a(2982, field_178812_b);
GlStateManager.func_179111_a(2983, field_178813_c);
GlStateManager.func_187445_a(2978, field_178814_a);
@@ -108,4 +113,14 @@
{
return field_74596_h;
}

View file

@ -132,6 +132,15 @@
}
else
{
@@ -1262,7 +1274,7 @@
GlStateManager.func_179086_m(16640);
this.field_78531_r.field_71424_I.func_76318_c("camera");
this.func_78479_a(p_175068_2_, p_175068_1_);
- ActiveRenderInfo.func_74583_a(this.field_78531_r.field_71439_g, this.field_78531_r.field_71474_y.field_74320_O == 2);
+ ActiveRenderInfo.updateRenderInfo(this.field_78531_r.func_175606_aa(), this.field_78531_r.field_71474_y.field_74320_O == 2); //Forge: MC-46445 Spectator mode particles and sounds computed from where you have been before
this.field_78531_r.field_71424_I.func_76318_c("frustum");
ClippingHelperImpl.func_78558_a();
this.field_78531_r.field_71424_I.func_76318_c("culling");
@@ -1329,7 +1341,9 @@
GlStateManager.func_179094_E();
RenderHelper.func_74519_b();

View file

@ -67,3 +67,5 @@ net/minecraft/command/EntitySelector.matchesMultiplePlayersDefault(Ljava/lang/St
net/minecraft/command/EntitySelector.isSelectorDefault(Ljava/lang/String;)Z=|p_82378_0_
net/minecraft/client/util/RecipeItemHelper.accountStack(Lnet/minecraft/item/ItemStack;I)V=|p_194112_1_,forceCount
net/minecraft/client/renderer/ActiveRenderInfo.updateRenderInfo(Lnet/minecraft/entity/Entity;Z)V=|p_74583_0_,p_74583_1_
net/minecraft/client/audio/SoundManager.setListener(Lnet/minecraft/entity/Entity;F)V=|p_148615_1_,p_148615_2_