Reset camera inventory when no longer spectating (fixes #546)

This commit is contained in:
Jonas Herzig
2021-08-15 18:09:57 +02:00
parent 88dece679d
commit 612a90681e
5 changed files with 51 additions and 27 deletions

View File

@@ -9,6 +9,7 @@ import net.minecraft.client.world.ClientWorld;
import net.minecraft.client.render.Tessellator;
import net.minecraft.client.render.entity.EntityRenderDispatcher;
import net.minecraft.client.sound.PositionedSoundInstance;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.util.crash.CrashReportSection;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.PlayerEntity;
@@ -215,6 +216,15 @@ class Patterns {
//#endif
}
@Pattern
private static PlayerInventory getInventory(PlayerEntity entity) {
//#if MC>=11700
//$$ return entity.getInventory();
//#else
return entity.inventory;
//#endif
}
@Pattern
private static Iterable<Entity> loadedEntityList(ClientWorld world) {
//#if MC>=11400