Commit Graph

42 Commits

Author SHA1 Message Date
LambdAurora a0ec4231f8
Entity and entity models documentations (#2431)
* Map some axolotl stuff and start work on entity and entity models documentation.

* Improve entity models documentation.

* Update mappings/net/minecraft/client/model/Model.mapping

Co-authored-by: liach <7806504+liach@users.noreply.github.com>

* More entity model documentation.

* Axolotl brain and tasks.

* Update mappings/net/minecraft/client/render/entity/model/CatEntityModel.mapping

Co-authored-by: liach <7806504+liach@users.noreply.github.com>

Co-authored-by: liach <7806504+liach@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2021-05-29 11:52:11 +01:00
modmuss50 c91f482141 20w45a 2020-11-04 20:44:22 +00:00
­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
Runemoro 966033b532 More rendering mappings (#986)
* More rendering mappings

* Even more rendering mappings

* Update mappings/net/minecraft/client/render/OverlayTexture.mapping

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

* Update mappings/net/minecraft/client/render/OverlayTexture.mapping

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

* Fix HashStrategy removed in last PR

* Fixes by liach
2019-12-02 13:47:40 +00:00
modmuss50 9fb64b9b26 1.15-pre1 2019-11-21 19:13:18 +00:00
modmuss50 ab5cfb2bf9 Fix 2019-10-30 16:56:29 +00:00
liach 6fa1e34c83 19w42a rendering and layers etc (#917)
* 19w42a rendering and layers etc

Signed-off-by: liach <liach@users.noreply.github.com>

* Stage changes

Signed-off-by: liach <liach@users.noreply.github.com>

* stuff stuff stuff

Signed-off-by: liach <liach@users.noreply.github.com>

* fixed color

Signed-off-by: liach <liach@users.noreply.github.com>

* Banner Pattern "Patterns"

Patterns name see https://minecraft.gamepedia.com/Banner#Block_entity

* Some more changes

Signed-off-by: liach <liach@users.noreply.github.com>

* Add 2 mappings

Signed-off-by: liach <liach@users.noreply.github.com>
2019-10-30 16:15:03 +00:00
Siphalor 194e42daff Mapped entity rendering methods/classes & options screens (#913)
* Mapped entity rendering methods and classes & options screens

* Fixed Knit's issues and implemented liach's suggestions

* Removed strange leftover obf stubs (I blame Knit)

* Mapped some more stuff from AnimalModel

* Adapt some stuff from Runemoro

* Some more Runemoro

* Another two fixes

* Unmap unobfuscated mapping

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

* Shorten dragon

by liach

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

* Shorten biped model

by liach

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

* Shorten another biped model

Co-Authored-By: liach <7806504+liach@users.noreply.github.com>
2019-10-25 09:02:48 +01:00
modmuss50 841e352c61 19w41a 2019-10-09 18:17:26 +01:00
Runemoro 04ad11fed6 Rendering mappings (#897)
* Rendering mappings

* Remove duplicate class

* Suggestions by liach and juuxel

* Unmap inferred field and move to better package
2019-10-09 17:43:46 +01:00
modmuss50 2565f0b45b 19w38a 2019-09-18 16:17:05 +01:00
Adrian Siekierka 1a6f261a2e The Great Intermediary Update, Part 1 2019-06-28 23:55:20 +02:00
modmuss50 b27778997a 1.14.3-pre3 2019-06-19 18:48:53 +01:00
modmuss50 8554a5ae8c 1.14.3-pre2 2019-06-07 12:45:25 +01:00
Adrian Siekierka bdbf125b33 1.14.3-pre1 2019-06-03 18:48:18 +02:00
modmuss50 fa072139bf 1.14.1 Pre-Release 1 2019-05-07 17:05:49 +01:00
modmuss50 de13dda07c 1.14 Pre-Release 5 2019-04-18 22:01:39 +01:00
modmuss50 782b07c692 1.14 Pre-Release 4 2019-04-17 17:41:25 +01:00
Adrian Siekierka 13943c582b update to 1.14 Pre-Release 3 2019-04-16 17:51:03 +02:00
modmuss50 2fd19127ea 1.14 Pre-Release 2 2019-04-12 15:38:24 +01:00
modmuss50 b13686aed0 1.14 Pre-Release 1 2019-04-10 16:36:17 +01:00
modmuss50 0e8b18ad3f 19w14b 2019-04-05 17:03:47 +01:00
modmuss50 845be1d2ec 19w14a 2019-04-03 17:16:41 +01:00
modmuss50 53620837bf 19w13a 2019-03-27 18:35:10 +00:00
modmuss50 b9285540bc 19w12a 2019-03-20 17:56:26 +00:00
modmuss50 e3d24ae102 19w11b 2019-03-14 15:39:51 +00:00
Adrian Siekierka 333e59da73 19w11a 2019-03-14 13:57:09 +01:00
Adrian Siekierka c25fcbb177 19w08b 2019-02-21 19:19:18 +01:00
Adrian Siekierka 66156a5471 update to 19w08a 2019-02-20 21:49:23 +01:00
modmuss50 8a2af8044e 19w07a 2019-02-13 17:35:08 +00:00
Adrian Siekierka e2a1bba0b6 19w06a 2019-02-06 21:22:24 +01:00
Adrian Siekierka 1bfe80a06a update to 19w05a 2019-01-30 18:48:39 +01:00
Adrian Siekierka 995df6291a update to 19w04a/Enigma 0.13.x 2019-01-24 20:10:22 +01:00
modmuss50 347fd572c2 19w03a 2019-01-16 18:24:40 +00:00
Adrian Siekierka bf62f29ddf update to 19w02a 2019-01-09 18:20:38 +01:00
sekwah41 f4ec5b2b56 Added mappings for the Model class and fixed name for old Model class (#335)
* Added mappings for the model class and fixed name for the other one

The class before called model had the swing value and was not the true base model class. Not sure what to call it but for now I'm just calling it entity model because SwingingModel seems a bit silly though it would represent this new class from 1.14 better
2018-12-19 13:26:06 +01:00
Adrian Siekierka e9ccf701a7 port to 18w50a 2018-12-12 18:12:26 +01:00
Adrian Siekierka 245ce1dd92 update to 18w49a 2018-12-05 15:13:16 +01:00
Adrian Siekierka 50764e1853 update to 18w48a 2018-11-29 21:10:38 +01:00
Jamie Mansfield dab4cc0f7a Improve renderer mappings (#215)
* Improve renderer mappings

*Dispatcher, DefaultEntityRenderer:
- See https://notch.tumblr.com/post/581187056/evolution-of-the-entityrenderdispatcher

Cube, Polygon:
- See the very old (RubyDung) versions pre-obfuscation
- Cube is used in the Bedrock entity model JSONs, see https://minecraft.gamepedia.com/Tutorials/Changing_Minecraft_entity_models

* Correct Polygon mapping

* Cube -> Cuboid; CubeBox -> Box

* Remaining minor things

* EntityModel -> Model

* ChunkRenderDispatcher

* Fix Polygon package
2018-11-29 21:07:08 +01:00
asiekierka 8f48f7afb6 map most of resource stuff, other refactoring in rendering 2016-08-24 13:57:31 +02:00
asiekierka ed5bca2a0b misc improvements 2016-08-21 13:11:10 +02:00