yarn/mappings/net/minecraft/client/render/entity/model
­Sollace 3d228282e6
Renderer mappings (#988)
* part.render(matrix, vertices, light, overlay, red, green, blue, alpha)

* Fixed bad names

* Determined by the call to part.render(matrix, vertices, light, overlay)
  which delegates to part.render(matrix, vertices, light, overlay, 1, 1, 1, 1)

* Now we extrapolate to everything that calls part.render(matrix, vertices, light, overlay)
  Meanhile VertexConsumerProvider is

* Now we extrapolate to everything that cals pars.render(matrix, vertices, light, overlay, red, green, blue, alpha)

* This is not a render method! It sets the yaw and pitch on the skull

* Now we extrapolate to things that call mode.render(matrix, vertices, light, overlay, red, green, blue, alpha)
  Not much to change there though

* These are known from EntityRenderDispatcher

* render calls renderLabelIfPresent

* Now we're looking at things which call EntityRenderDispatcher.render(entity, x, y, z, yaw, matrix, provider, light)

* In ClientPlayNetworkHandler.onItemPickupAnimation the second entity is gotten from packet.getCollectorEntityId and defaulted to the player if null. The first entity is an item entity or an experience orb entity

* Going back to EntityRenderDispatcher, we can see the code for rendering shadows was moved here from the renderer itself

if (this.gameOptions.entityShadows && this.renderShadows && entityRenderer14.shadowRadius > 0.0f && !entity.isInvisible()) {
    double double22 = this.getSquaredDistanceToCamera(entity.getX(), entity.getY(), entity.getZ());
    float float24 = (float)((1.0 - double22 / 256.0) * entityRenderer14.field_4672);
    if (float24 > 0.0f) {
       renderShadow(matrix, provider, entity, float24, tickDelta, this.world, entityRenderer14.shadowRadius);
    }
}

* The last parameter is shadow radius, but to be sure we check, nd indeed it is reduced when the rendered entity is a baby

    private static void renderShadow(MatrixStack matrix, VertexConsumerProvider provider, Entity entity, float float4, float tickDelta, WorldView world, float radius) {
        float float8 = radius;
        if (entity instanceof MobEntity) {
            if (((MobEntity)entity).isBaby()) {
                float8 *= 0.5f;
            }
        }

* float4 was a myster, but it's just passed down as-is and used to determine the opacity of the shadow!

float float16 = (float)((opacity - (y - pos.getY()) / 2.0) * 0.5 * world.getBrightness(pos));
if (float16 >= 0.0f) {

* Forgot this one

* This is all low-hanging fruit.

* EntityRenderDispatcher.shouldRender(entity, frustrum, x, y, z)
-> EntityRenderer.isVisible(entity, frustrum, x, y, z)
-> Entity.shouldRenderFrom(x, y, z)

    @Environment(EnvType.CLIENT)
    public boolean shouldRenderFrom(double x, double y, double z) {
        double double8 = this.getX() - x;
        double double10 = this.getY() - y;
        double double12 = this.getZ() - z;
        double double14 = double8 * double8 + double10 * double10 + double12 * double12;
        return this.shouldRenderAtDistance(double14);
    }

* More things we know

* This is set by calling entity.getLeaningPitch

* This is only overriden by CreeperEntityRenderer and returns a float computed from the fuse time.
The value is then passed to getOverlay where it's passed to OverlayTexture.getU(animationCounter).

This causes the creeper to flash white when active. The same method,
interestingly, will use the V to create the hurt/death overlay

OverlayTexture.packUv(
	OverlayTexture.getU(animationCounter),
	OverlayTexture.getV(entity.hurtTime > 0 || entity.deathTime > 0)
)

* The final patches

* xrayEnabled -> isGlowing

* Commit suggestions/name changes I missed during rebase

Co-Authored-By: Juuxel <6596629+Juuxel@users.noreply.github.com>

* Fix typos

* yaw -> tickDelta

Co-Authored-By: liach <7806504+liach@users.noreply.github.com>

* provider -> vertexConsumers

Co-Authored-By: liach <7806504+liach@users.noreply.github.com>

* matrix -> matrices

Co-Authored-By: liach <7806504+liach@users.noreply.github.com>

* Fixed some encorrect names

* entry -> matrices

* textureU/V -> u/v

* isBanner -> isBannerBlock

* frustrum -> frustum

Co-Authored-By: Gegy <gegy1000@gmail.com>

* Fix broken/changed mappings for 20w10a

* grammar

Co-Authored-By: liach <7806504+liach@users.noreply.github.com>

* Update mappings/net/minecraft/client/particle/ItemPickupParticle.mapping

Co-Authored-By: liach <7806504+liach@users.noreply.github.com>

Co-authored-by: Juuxel <6596629+Juuxel@users.noreply.github.com>
Co-authored-by: liach <7806504+liach@users.noreply.github.com>
Co-authored-by: Gegy <gegy1000@gmail.com>
2020-03-27 11:06:32 +00:00
..
AbstractZombieModel.mapping Merged #825 2019-09-12 14:36:00 +01:00
AnimalModel.mapping Mapped entity rendering methods/classes & options screens (#913) 2019-10-25 09:02:48 +01:00
ArmorStandArmorEntityModel.mapping ArmorStandEntityModel + CrepperEntityModel + some related mappings (#824) 2019-08-22 21:26:26 +01:00
ArmorStandEntityModel.mapping Model part mappings (#982) 2019-11-25 13:58:59 +00:00
BatEntityModel.mapping Merged #825 2019-09-12 14:36:00 +01:00
BeeEntityModel.mapping Model part mappings (#982) 2019-11-25 13:58:59 +00:00
BipedEntityModel.mapping Pick up rendering stuff and dragon stuff (#1163) 2020-03-11 15:09:33 +00:00
BlazeEntityModel.mapping Mapped entity rendering methods/classes & options screens (#913) 2019-10-25 09:02:48 +01:00
BoatEntityModel.mapping More rendering mappings (#986) 2019-12-02 13:47:40 +00:00
BookModel.mapping Renderer mappings (#988) 2020-03-27 11:06:32 +00:00
CatEntityModel.mapping 19w34a 2019-08-22 14:39:40 +01:00
ChickenEntityModel.mapping Model part mappings (#982) 2019-11-25 13:58:59 +00:00
CodEntityModel.mapping Model part mappings (#982) 2019-11-25 13:58:59 +00:00
CompositeEntityModel.mapping Mapped entity rendering methods/classes & options screens (#913) 2019-10-25 09:02:48 +01:00
CowEntityModel.mapping Merged #825 2019-09-12 14:36:00 +01:00
CreeperEntityModel.mapping Model part mappings (#982) 2019-11-25 13:58:59 +00:00
CrossbowPosing.mapping Plant block, smithing table container, data gen, dfu, dynamic seriali… (#1148) 2020-03-08 22:23:40 +00:00
DolphinEntityModel.mapping Model part mappings (#982) 2019-11-25 13:58:59 +00:00
DonkeyEntityModel.mapping Model part mappings (#982) 2019-11-25 13:58:59 +00:00
DragonHeadEntityModel.mapping Made some entity renderer and model fields and parameters consistent (#1176) 2020-03-13 13:54:42 +00:00
DrownedEntityModel.mapping 20w10a 2020-03-04 20:22:46 +00:00
ElytraEntityModel.mapping The Great Intermediary Update, Part 1 2019-06-28 23:55:20 +02:00
EndermanEntityModel.mapping The Great Intermediary Update, Part 1 2019-06-28 23:55:20 +02:00
EndermiteEntityModel.mapping The Great Intermediary Update, Part 1 2019-06-28 23:55:20 +02:00
EntityModel.mapping More rendering mappings (#986) 2019-12-02 13:47:40 +00:00
EvokerFangsEntityModel.mapping The Great Intermediary Update, Part 1 2019-06-28 23:55:20 +02:00
FoxEntityModel.mapping Model part mappings (#982) 2019-11-25 13:58:59 +00:00
GhastEntityModel.mapping The Great Intermediary Update, Part 1 2019-06-28 23:55:20 +02:00
GiantEntityModel.mapping Made some entity renderer and model fields and parameters consistent (#1176) 2020-03-13 13:54:42 +00:00
GuardianEntityModel.mapping Model part mappings (#982) 2019-11-25 13:58:59 +00:00
HoglinEntityModel.mapping Map new classes, staging (#1122) 2020-02-24 20:14:56 +00:00
HorseEntityModel.mapping Made some entity renderer and model fields and parameters consistent (#1176) 2020-03-13 13:54:42 +00:00
IllagerEntityModel.mapping Made some entity renderer and model fields and parameters consistent (#1176) 2020-03-13 13:54:42 +00:00
IronGolemEntityModel.mapping Model part mappings (#982) 2019-11-25 13:58:59 +00:00
LargePufferfishEntityModel.mapping The Great Intermediary Update, Part 1 2019-06-28 23:55:20 +02:00
LargeTropicalFishEntityModel.mapping Made some entity renderer and model fields and parameters consistent (#1176) 2020-03-13 13:54:42 +00:00
LeashKnotEntityModel.mapping Made some entity renderer and model fields and parameters consistent (#1176) 2020-03-13 13:54:42 +00:00
LlamaEntityModel.mapping Made some entity renderer and model fields and parameters consistent (#1176) 2020-03-13 13:54:42 +00:00
LlamaSpitEntityModel.mapping Made some entity renderer and model fields and parameters consistent (#1176) 2020-03-13 13:54:42 +00:00
MagmaCubeEntityModel.mapping Model part mappings (#982) 2019-11-25 13:58:59 +00:00
MediumPufferfishEntityModel.mapping The Great Intermediary Update, Part 1 2019-06-28 23:55:20 +02:00
MinecartEntityModel.mapping The Great Intermediary Update, Part 1 2019-06-28 23:55:20 +02:00
ModelWithArms.mapping Pick up rendering stuff and dragon stuff (#1163) 2020-03-11 15:09:33 +00:00
ModelWithHat.mapping The Great Intermediary Update, Part 1 2019-06-28 23:55:20 +02:00
ModelWithHead.mapping 19w39a 2019-09-27 17:23:24 +01:00
OcelotEntityModel.mapping Model part mappings (#982) 2019-11-25 13:58:59 +00:00
PandaEntityModel.mapping Made some entity renderer and model fields and parameters consistent (#1176) 2020-03-13 13:54:42 +00:00
ParrotEntityModel.mapping Pick up rendering stuff and dragon stuff (#1163) 2020-03-11 15:09:33 +00:00
PhantomEntityModel.mapping Model part mappings (#982) 2019-11-25 13:58:59 +00:00
PigEntityModel.mapping Made some entity renderer and model fields and parameters consistent (#1176) 2020-03-13 13:54:42 +00:00
PiglinEntityModel.mapping Map new classes, staging (#1122) 2020-02-24 20:14:56 +00:00
PlayerEntityModel.mapping Renderer mappings (#988) 2020-03-27 11:06:32 +00:00
PolarBearEntityModel.mapping The Great Intermediary Update, Part 1 2019-06-28 23:55:20 +02:00
QuadrupedEntityModel.mapping Rename the body parts to be more descriptive (#950) 2019-11-18 13:11:10 +00:00
RabbitEntityModel.mapping Model part mappings (#982) 2019-11-25 13:58:59 +00:00
RavagerEntityModel.mapping Model part mappings (#982) 2019-11-25 13:58:59 +00:00
SalmonEntityModel.mapping Model part mappings (#982) 2019-11-25 13:58:59 +00:00
SheepEntityModel.mapping The Great Intermediary Update, Part 1 2019-06-28 23:55:20 +02:00
SheepWoolEntityModel.mapping The Great Intermediary Update, Part 1 2019-06-28 23:55:20 +02:00
ShieldEntityModel.mapping 19w41a 2019-10-09 18:17:26 +01:00
ShulkerBulletEntityModel.mapping Made some entity renderer and model fields and parameters consistent (#1176) 2020-03-13 13:54:42 +00:00
ShulkerEntityModel.mapping Mapped entity rendering methods/classes & options screens (#913) 2019-10-25 09:02:48 +01:00
SilverfishEntityModel.mapping The Great Intermediary Update, Part 1 2019-06-28 23:55:20 +02:00
SkeletonEntityModel.mapping Rename the body parts to be more descriptive (#950) 2019-11-18 13:11:10 +00:00
SkullEntityModel.mapping Renderer mappings (#988) 2020-03-27 11:06:32 +00:00
SkullOverlayEntityModel.mapping Made some entity renderer and model fields and parameters consistent (#1176) 2020-03-13 13:54:42 +00:00
SlimeEntityModel.mapping Made some entity renderer and model fields and parameters consistent (#1176) 2020-03-13 13:54:42 +00:00
SmallPufferfishEntityModel.mapping The Great Intermediary Update, Part 1 2019-06-28 23:55:20 +02:00
SmallTropicalFishEntityModel.mapping Made some entity renderer and model fields and parameters consistent (#1176) 2020-03-13 13:54:42 +00:00
SnowmanEntityModel.mapping Pick up rendering stuff and dragon stuff (#1163) 2020-03-11 15:09:33 +00:00
SpiderEntityModel.mapping Model part mappings (#982) 2019-11-25 13:58:59 +00:00
SquidEntityModel.mapping Model part mappings (#982) 2019-11-25 13:58:59 +00:00
StriderEntityModel.mapping Strider entity mappings (#1225) 2020-03-26 14:09:47 +00:00
TintableAnimalModel.mapping Mapped entity rendering methods/classes & options screens (#913) 2019-10-25 09:02:48 +01:00
TintableCompositeModel.mapping Mapped entity rendering methods/classes & options screens (#913) 2019-10-25 09:02:48 +01:00
TridentEntityModel.mapping 19w41a 2019-10-09 18:17:26 +01:00
TurtleEntityModel.mapping Made some entity renderer and model fields and parameters consistent (#1176) 2020-03-13 13:54:42 +00:00
VexEntityModel.mapping Model part mappings (#982) 2019-11-25 13:58:59 +00:00
VillagerResemblingModel.mapping Model part mappings (#982) 2019-11-25 13:58:59 +00:00
WitchEntityModel.mapping Mapped entity rendering methods/classes & options screens (#913) 2019-10-25 09:02:48 +01:00
WitherEntityModel.mapping Made some entity renderer and model fields and parameters consistent (#1176) 2020-03-13 13:54:42 +00:00
WolfEntityModel.mapping Model part mappings (#982) 2019-11-25 13:58:59 +00:00
ZombieEntityModel.mapping Made some entity renderer and model fields and parameters consistent (#1176) 2020-03-13 13:54:42 +00:00
ZombieVillagerEntityModel.mapping Made some entity renderer and model fields and parameters consistent (#1176) 2020-03-13 13:54:42 +00:00