use of net.minecraft.client.render.entity.EntityRenderDispatcher in project meteor-client by MeteorDevelopment.
the class EntityTooltipComponent method renderEntity.
protected void renderEntity(MatrixStack matrices, int x, int y) {
if (mc.player == null)
return;
float size = 24;
if (Math.max(entity.getWidth(), entity.getHeight()) > 1.0) {
size /= Math.max(entity.getWidth(), entity.getHeight());
}
DiffuseLighting.disableGuiDepthLighting();
matrices.push();
int yOffset = 16;
if (entity instanceof SquidEntity) {
size = 16;
yOffset = 2;
}
matrices.translate(x + 10, y + yOffset, 1050);
matrices.scale(1f, 1f, -1);
matrices.translate(0, 0, 1000);
matrices.scale(size, size, size);
Quaternion quaternion = Vec3f.POSITIVE_Z.getDegreesQuaternion(180.f);
Quaternion quaternion2 = Vec3f.POSITIVE_X.getDegreesQuaternion(-10.f);
quaternion.hamiltonProduct(quaternion2);
matrices.multiply(quaternion);
setupAngles();
EntityRenderDispatcher entityRenderDispatcher = mc.getEntityRenderDispatcher();
quaternion2.conjugate();
entityRenderDispatcher.setRotation(quaternion2);
entityRenderDispatcher.setRenderShadows(false);
VertexConsumerProvider.Immediate immediate = mc.getBufferBuilders().getEntityVertexConsumers();
entity.age = mc.player.age;
entity.setCustomNameVisible(false);
entityRenderDispatcher.render(entity, 0, 0, 0, 0.f, 1.f, matrices, immediate, 15728880);
immediate.draw();
entityRenderDispatcher.setRenderShadows(true);
matrices.pop();
DiffuseLighting.enableGuiDepthLighting();
}
use of net.minecraft.client.render.entity.EntityRenderDispatcher in project ImmersivePortalsMod by qouteall.
the class MyGameRenderer method renderPlayerItself.
private void renderPlayerItself(Vec3d playerPos, Vec3d playerLastTickPos, float patialTicks) {
EntityRenderDispatcher entityRenderDispatcher = ((IEWorldRenderer) mc.worldRenderer).getEntityRenderDispatcher();
PlayerListEntry playerListEntry = CHelper.getClientPlayerListEntry();
GameMode originalGameMode = MyRenderHelper.originalGameMode;
Entity player = mc.cameraEntity;
assert player != null;
Vec3d oldPos = player.getPos();
Vec3d oldLastTickPos = McHelper.lastTickPosOf(player);
GameMode oldGameMode = playerListEntry.getGameMode();
Helper.setPosAndLastTickPos(player, playerPos, playerLastTickPos);
((IEPlayerListEntry) playerListEntry).setGameMode(originalGameMode);
entityRenderDispatcher.render(player, patialTicks, false);
Helper.setPosAndLastTickPos(player, oldPos, oldLastTickPos);
((IEPlayerListEntry) playerListEntry).setGameMode(oldGameMode);
}
use of net.minecraft.client.render.entity.EntityRenderDispatcher in project isometric-renders by gliscowo.
the class IsometricRenderScreen method drawContent.
@Override
protected void drawContent(MatrixStack matrices) {
float scale = renderScale * height / 515f;
RenderSystem.pushMatrix();
RenderSystem.translatef(115, (float) Math.round(renderHeight * 1f + (height - 515f) / 10f), 1500);
RenderSystem.scalef(1, 1, -1);
MatrixStack matrixStack = new MatrixStack();
matrixStack.translate(0, 0, 1000);
matrixStack.scale(scale, scale, 1);
Quaternion flip = Vector3f.POSITIVE_Z.getDegreesQuaternion(180);
flip.hamiltonProduct(Vector3f.POSITIVE_X.getDegreesQuaternion(-angle));
Quaternion rotation = Vector3f.POSITIVE_Y.getDegreesQuaternion(RuntimeConfig.rotation);
matrixStack.multiply(flip);
matrixStack.multiply(rotation);
EntityRenderDispatcher entityRenderDispatcher = MinecraftClient.getInstance().getEntityRenderDispatcher();
entityRenderDispatcher.setRenderShadows(false);
VertexConsumerProvider.Immediate immediate = MinecraftClient.getInstance().getBufferBuilders().getEntityVertexConsumers();
renderCallback.render(matrixStack, immediate, playAnimations ? ((MinecraftClientAccessor) client).getRenderTickCounter().tickDelta : 0);
immediate.draw();
entityRenderDispatcher.setRenderShadows(true);
RenderSystem.popMatrix();
}
use of net.minecraft.client.render.entity.EntityRenderDispatcher in project Client by MatHax.
the class EntityTooltipComponent method renderEntity.
protected void renderEntity(MatrixStack matrices, int x, int y) {
if (mc.player == null)
return;
float size = 24;
if (Math.max(entity.getWidth(), entity.getHeight()) > 1.0)
size /= Math.max(entity.getWidth(), entity.getHeight());
DiffuseLighting.disableGuiDepthLighting();
matrices.push();
int yOffset = 16;
if (entity instanceof SquidEntity) {
size = 16;
yOffset = 2;
}
matrices.translate(x + 10, y + yOffset, 1050);
matrices.scale(1f, 1f, -1);
matrices.translate(0, 0, 1000);
matrices.scale(size, size, size);
Quaternion quaternion = Vec3f.POSITIVE_Z.getDegreesQuaternion(180.f);
Quaternion quaternion2 = Vec3f.POSITIVE_X.getDegreesQuaternion(-10.f);
quaternion.hamiltonProduct(quaternion2);
matrices.multiply(quaternion);
setupAngles();
EntityRenderDispatcher entityRenderDispatcher = mc.getEntityRenderDispatcher();
quaternion2.conjugate();
entityRenderDispatcher.setRotation(quaternion2);
entityRenderDispatcher.setRenderShadows(false);
VertexConsumerProvider.Immediate immediate = mc.getBufferBuilders().getEntityVertexConsumers();
entity.age = mc.player.age;
entity.setCustomNameVisible(false);
entityRenderDispatcher.render(entity, 0, 0, 0, 0.f, 1.f, matrices, immediate, 15728880);
immediate.draw();
entityRenderDispatcher.setRenderShadows(true);
matrices.pop();
DiffuseLighting.enableGuiDepthLighting();
}
use of net.minecraft.client.render.entity.EntityRenderDispatcher in project LittleMaidReBirth-Fabric by SistrScarlet.
the class IFFType method render.
@Environment(EnvType.CLIENT)
public void render(MatrixStack matrices, int x, int y, int mouseX, int mouseY) {
TextRenderer textRenderer = MinecraftClient.getInstance().textRenderer;
textRenderer.drawWithShadow(matrices, new TranslatableText(entityType.getTranslationKey()), (float) x + 60, (float) y - textRenderer.fontHeight, 0xFFFFFFFF);
if (renderClashed || !(entity instanceof LivingEntity))
return;
try {
InventoryScreen.drawEntity(x, y, 15, mouseX, mouseY, (LivingEntity) entity);
} catch (Exception e) {
LOGGER.warn("描画処理がクラッシュしました。" + entityType + ":" + entity);
e.printStackTrace();
renderClashed = true;
// 行われない終了処理を行う
// ちょっと強引
VertexConsumerProvider.Immediate immediate = MinecraftClient.getInstance().getBufferBuilders().getEntityVertexConsumers();
immediate.draw();
EntityRenderDispatcher entityRenderDispatcher = MinecraftClient.getInstance().getEntityRenderDispatcher();
entityRenderDispatcher.setRenderShadows(true);
RenderSystem.popMatrix();
}
}
Aggregations