Glow, fixes
This commit is contained in:
parent
4578130799
commit
c0c34035f4
6 changed files with 46 additions and 20 deletions
|
@ -19,72 +19,86 @@ public class ModelEntityDragonfly extends EntityModel<EntityDragonfly> {
|
|||
private final ModelPart legs_2;
|
||||
|
||||
public ModelEntityDragonfly() {
|
||||
//textureWidth = 64;
|
||||
//textureHeight = 64;
|
||||
|
||||
textureWidth = 16;
|
||||
textureHeight = 16;
|
||||
textureWidth = 64;
|
||||
textureHeight = 64;
|
||||
|
||||
model = new ModelPart(this);
|
||||
model.setPivot(2.0F, 21.5F, -4.0F);
|
||||
model.setTextureOffset(0, 0).addCuboid(-4.0F, -4.0F, 0.0F, 4.0F, 4.0F, 9.0F, 0.0F, false);
|
||||
model.setTextureOffset(0, 0).addCuboid(-4.0F, -4.0F, 0.0F, 4.0F, 4.0F, 9.0F, 0.0F);
|
||||
|
||||
head = new ModelPart(this);
|
||||
head.setPivot(-2.0F, -2.0F, 0.0F);
|
||||
model.addChild(head);
|
||||
setRotationAngle(head, 0.3491F, 0.0F, 0.0F);
|
||||
head.setTextureOffset(0, 0).addCuboid(-1.5F, -1.5F, -2.5F, 3.0F, 3.0F, 3.0F, 0.0F, false);
|
||||
head.setTextureOffset(17, 0).addCuboid(-1.5F, -1.5F, -2.5F, 3.0F, 3.0F, 3.0F, 0.0F);
|
||||
|
||||
tail = new ModelPart(this);
|
||||
tail.setPivot(-2.0F, -2.0F, 9.0F);
|
||||
model.addChild(tail);
|
||||
tail.setTextureOffset(0, 0).addCuboid(-1.5F, -1.5F, 0.0F, 3.0F, 3.0F, 7.0F, 0.0F, false);
|
||||
tail.setTextureOffset(26, 0).addCuboid(-1.5F, -1.5F, 0.0F, 3.0F, 3.0F, 7.0F, 0.0F);
|
||||
|
||||
tail_2 = new ModelPart(this);
|
||||
tail_2.setPivot(0.0F, 0.0F, 7.0F);
|
||||
tail.addChild(tail_2);
|
||||
tail_2.setTextureOffset(0, 0).addCuboid(-1.0F, -1.0F, 0.0F, 2.0F, 2.0F, 10.0F, 0.0F, false);
|
||||
tail_2.setTextureOffset(36, 0).addCuboid(-1.0F, -1.0F, 0.0F, 2.0F, 2.0F, 10.0F, 0.0F);
|
||||
|
||||
wing_1 = new ModelPart(this);
|
||||
wing_1.setPivot(-2.0F, -4.0F, 4.0F);
|
||||
model.addChild(wing_1);
|
||||
setRotationAngle(wing_1, 0.0F, 0.0F, 0.3491F);
|
||||
wing_1.setTextureOffset(0, 0).addCuboid(-15.0F, 0.0F, -3.0F, 15.0F, 0.0F, 4.0F, 0.0F, false);
|
||||
wing_1.setTextureOffset(0, 13).addCuboid(-15.0F, 0.0F, -3.0F, 15.0F, 0.0F, 4.0F, 0.0F);
|
||||
|
||||
wing_2 = new ModelPart(this);
|
||||
wing_2.setPivot(-2.0F, -4.0F, 4.0F);
|
||||
model.addChild(wing_2);
|
||||
setRotationAngle(wing_2, 0.0F, 0.0F, 2.7925F);
|
||||
wing_2.setTextureOffset(0, 0).addCuboid(-15.0F, 0.0F, -3.0F, 15.0F, 0.0F, 4.0F, 0.0F, false);
|
||||
wing_2.setTextureOffset(0, 13).addCuboid(-15.0F, 0.0F, -3.0F, 15.0F, 0.0F, 4.0F, 0.0F);
|
||||
|
||||
wing_3 = new ModelPart(this);
|
||||
wing_3.setPivot(-2.0F, -4.0F, 8.0F);
|
||||
model.addChild(wing_3);
|
||||
setRotationAngle(wing_3, 0.0F, 0.0F, 0.3491F);
|
||||
wing_3.setTextureOffset(0, 0).addCuboid(-12.0F, 0.0F, -2.5F, 12.0F, 0.0F, 3.0F, 0.0F, false);
|
||||
wing_3.setTextureOffset(4, 17).addCuboid(-12.0F, 0.0F, -2.5F, 12.0F, 0.0F, 3.0F, 0.0F);
|
||||
|
||||
wing_4 = new ModelPart(this);
|
||||
wing_4.setPivot(-2.0F, -4.0F, 8.0F);
|
||||
model.addChild(wing_4);
|
||||
setRotationAngle(wing_4, 0.0F, 0.0F, 2.7925F);
|
||||
wing_4.setTextureOffset(0, 0).addCuboid(-12.0F, 0.0F, -2.5F, 12.0F, 0.0F, 3.0F, 0.0F, false);
|
||||
wing_4.setTextureOffset(4, 17).addCuboid(-12.0F, 0.0F, -2.5F, 12.0F, 0.0F, 3.0F, 0.0F);
|
||||
|
||||
legs_1 = new ModelPart(this);
|
||||
legs_1.setPivot(-1.0F, 0.0F, 1.0F);
|
||||
model.addChild(legs_1);
|
||||
setRotationAngle(legs_1, 0.0F, 0.0F, -0.5236F);
|
||||
legs_1.setTextureOffset(0, 0).addCuboid(0.0F, 0.0F, 0.0F, 0.0F, 3.0F, 6.0F, 0.0F, false);
|
||||
legs_1.setTextureOffset(50, 1).addCuboid(0.0F, 0.0F, 0.0F, 0.0F, 3.0F, 6.0F, 0.0F);
|
||||
|
||||
legs_2 = new ModelPart(this);
|
||||
legs_2.setPivot(-3.0F, 0.0F, 1.0F);
|
||||
model.addChild(legs_2);
|
||||
setRotationAngle(legs_2, 0.0F, 0.0F, 0.5236F);
|
||||
legs_2.setTextureOffset(0, 0).addCuboid(0.0F, 0.0F, 0.0F, 0.0F, 3.0F, 6.0F, 0.0F, false);
|
||||
legs_2.setTextureOffset(50, 1).addCuboid(0.0F, 0.0F, 0.0F, 0.0F, 3.0F, 6.0F, 0.0F);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setAngles(EntityDragonfly entity, float limbAngle, float limbDistance, float animationProgress, float headYaw, float headPitch) {}
|
||||
public void setAngles(EntityDragonfly entity, float limbAngle, float limbDistance, float animationProgress, float headYaw, float headPitch) {
|
||||
float progress = animationProgress * 2F;
|
||||
|
||||
float sin = (float) Math.sin(progress);
|
||||
float cos = (float) Math.cos(progress);
|
||||
|
||||
wing_1.roll = 0.3491F + sin * 0.3491F;
|
||||
wing_2.roll = 2.7925F - sin * 0.3491F;
|
||||
|
||||
wing_3.roll = 0.3491F + cos * 0.3491F;
|
||||
wing_4.roll = 2.7925F - cos * 0.3491F;
|
||||
|
||||
progress = animationProgress * 0.05F;
|
||||
|
||||
head.pitch = 0.3491F + (float) Math.sin(progress * 0.7F) * 0.1F;
|
||||
tail.pitch = (float) Math.cos(progress) * 0.05F - 0.05F;
|
||||
tail_2.pitch = -tail.pitch * 1.5F;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(MatrixStack matrices, VertexConsumer vertices, int light, int overlay, float red, float green, float blue, float alpha) {
|
||||
|
|
|
@ -1,19 +1,30 @@
|
|||
package ru.betterend.entity.render;
|
||||
|
||||
import net.minecraft.client.render.RenderLayer;
|
||||
import net.minecraft.client.render.entity.EntityRenderDispatcher;
|
||||
import net.minecraft.client.render.entity.MobEntityRenderer;
|
||||
import net.minecraft.client.render.entity.feature.EyesFeatureRenderer;
|
||||
import net.minecraft.util.Identifier;
|
||||
import ru.betterend.BetterEnd;
|
||||
import ru.betterend.entity.EntityDragonfly;
|
||||
import ru.betterend.entity.model.ModelEntityDragonfly;
|
||||
|
||||
public class RendererEntityDragonfly extends MobEntityRenderer<EntityDragonfly, ModelEntityDragonfly> {
|
||||
|
||||
private static final Identifier TEXTURE = BetterEnd.makeID("textures/entity/dragonfly.png");
|
||||
private static final RenderLayer GLOW = RenderLayer.getEyes(BetterEnd.makeID("textures/entity/dragonfly_glow.png"));
|
||||
|
||||
public RendererEntityDragonfly(EntityRenderDispatcher entityRenderDispatcher) {
|
||||
super(entityRenderDispatcher, new ModelEntityDragonfly(), 0.5f);
|
||||
this.addFeature(new EyesFeatureRenderer<EntityDragonfly, ModelEntityDragonfly>(this) {
|
||||
@Override
|
||||
public RenderLayer getEyesTexture() {
|
||||
return GLOW;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public Identifier getTexture(EntityDragonfly entity) {
|
||||
return new Identifier("textures/block/stone.png");
|
||||
return TEXTURE;
|
||||
}
|
||||
}
|
|
@ -14,7 +14,7 @@ import ru.betterend.BetterEnd;
|
|||
import ru.betterend.entity.EntityDragonfly;
|
||||
|
||||
public class EntityRegistry {
|
||||
public static final EntityType<EntityDragonfly> DRAGONFLY = register("dragonfly", SpawnGroup.CREATURE, 0.5F, 0.25F, EntityDragonfly::new, EntityDragonfly.createMobAttributes());
|
||||
public static final EntityType<EntityDragonfly> DRAGONFLY = register("dragonfly", SpawnGroup.CREATURE, 0.6F, 0.5F, EntityDragonfly::new, EntityDragonfly.createMobAttributes());
|
||||
|
||||
public static void register() {}
|
||||
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 3.4 KiB |
Binary file not shown.
After Width: | Height: | Size: 2.3 KiB |
Loading…
Add table
Add a link
Reference in a new issue