• Ищем качественного (не новичок) разработчиков Xenforo для этого форума! В идеале, чтобы ты был фулл стек программистом. Если у тебя есть что показать, то свяжись с нами по контактным данным: https://t.me/DREDD

Визуальная часть Default Prediction Ender Pearl mcp base 1.16.5

Начинающий
Начинающий
Статус
Оффлайн
Регистрация
25 Янв 2024
Сообщения
114
Реакции
0
Выберите загрузчик игры
  1. Vanilla
  2. Прочие моды
Пожалуйста, авторизуйтесь для просмотра ссылки.


Код:
Expand Collapse Copy
@FunctionAnot(name = "Prediction", description = "Отображает предсказание траектории полёта эндер-жемчуга", category = Category.RENDER)
public class Prediction extends Function {

private static final Minecraft mc = Minecraft.getInstance();

public Prediction() {
}

[USER=1367676]@override[/USER]
protected void onEnable() {
}

[USER=1367676]@override[/USER]
protected void onDisable() {
}

[USER=1367676]@override[/USER]
public void onBindPress() {
}

[USER=1474073]@Subscribe[/USER]
public void onRenderWorldLast(RenderEvent event) {
if (mc.world == null || mc.player == null || !enabled) return;

MatrixStack matrixStack = event.getMatrixStack();
float partialTicks = event.getPartialTicks();

for (Entity entity : mc.world.getAllEntities()) {
if (!(entity instanceof EnderPearlEntity)) continue;

EnderPearlEntity pearl = (EnderPearlEntity) entity;
renderPearlTrajectory(matrixStack, pearl, partialTicks);
}
}

private Vector3d getNextMotion(ThrowableEntity throwable, Vector3d motion) {
motion = motion.scale(0.99);
if (!throwable.hasNoGravity()) {
motion = motion.subtract(0, 0.03f, 0);
}
return motion;
}

private void renderPearlTrajectory(MatrixStack matrixStack, EnderPearlEntity pearl, float partialTicks) {
Vector3d startPos = pearl.getPositionVec();
Vector3d velocity = pearl.getMotion();
Vector3d endPos = findLandingPosition(pearl, startPos, velocity);
Vector2f startScreen = ProjectionUtil.project((float)startPos.x, (float)startPos.y, (float)startPos.z);
Vector2f endScreen = ProjectionUtil.project((float)endPos.x, (float)endPos.y, (float)endPos.z);

RenderSystem.disableDepthTest();
RenderSystem.disableTexture();
RenderSystem.disableAlphaTest();
RenderSystem.enableBlend();
RenderSystem.defaultBlendFunc();
RenderSystem.color4f(4.0F, 0.0F, 0.0F, 1.0F);
RenderSystem.lineWidth(3.8F);

Tessellator tessellator = Tessellator.getInstance();
BufferBuilder bufferBuilder = tessellator.getBuffer();
bufferBuilder.begin(GL11.GL_LINES, DefaultVertexFormats.POSITION);
bufferBuilder.pos(startScreen.x, startScreen.y, 0).endVertex();
bufferBuilder.pos(endScreen.x, endScreen.y, 0).endVertex();
tessellator.draw();

RenderSystem.enableAlphaTest();
RenderSystem.enableTexture();
RenderSystem.enableDepthTest();

BlockPos landingBlock = new BlockPos(endPos);
ItemStack blockItemStack = new ItemStack(mc.world.getBlockState(landingBlock).getBlock());
ItemStack pearlItemStack = new ItemStack(Items.ENDER_PEARL);

int verticalDistance = (int)Math.abs(startPos.y - endPos.y);

RenderSystem.pushMatrix();
RenderSystem.enableBlend();
mc.getItemRenderer().renderItemIntoGUI(pearlItemStack, (int)(endScreen.x + 10), (int)(endScreen.y - 8));
RenderSystem.disableBlend();
RenderSystem.popMatrix();

String distanceText = verticalDistance + " Bloks";
IFont.drawWithShadowCenteredX(
IFont.MONTSERRAT_BOLD,
distanceText,
endScreen.x,
endScreen.y + 10,
new Color(128, 128, 128),
14,
matrixStack
);
}

private void renderLine(double x1, double y1, double z1, double x2, double y2, double z2, Color color) {
Vector2f start = ProjectionUtil.project((float)x1, (float)y1, (float)z1);
Vector2f end = ProjectionUtil.project((float)x2, (float)y2, (float)z2);

RenderSystem.disableDepthTest();
RenderSystem.disableTexture();
RenderSystem.disableAlphaTest();
RenderSystem.enableBlend();
RenderSystem.defaultBlendFunc();
RenderSystem.color4f(color.getRed() / 255f, color.getGreen() / 255f, color.getBlue() / 255f, color.getAlpha() / 255f);
RenderSystem.lineWidth(15.0F);

Tessellator tessellator = Tessellator.getInstance();
BufferBuilder bufferBuilder = tessellator.getBuffer();
bufferBuilder.begin(GL11.GL_LINES, DefaultVertexFormats.POSITION);
bufferBuilder.pos(start.x, start.y, 0).endVertex();
bufferBuilder.pos(end.x, end.y, 0).endVertex();
tessellator.draw();

RenderSystem.enableAlphaTest();
RenderSystem.enableTexture();
RenderSystem.enableDepthTest();
}

private Vector3d findLandingPosition(ThrowableEntity throwable, Vector3d startPos, Vector3d initialVelocity) {
Vector3d currentPos = startPos;
Vector3d currentVelocity = initialVelocity;
double gravity = 0.03999999910593033D;

while (true) {
currentVelocity = currentVelocity.subtract(0, gravity, 0);
currentPos = currentPos.add(currentVelocity);
currentPos = currentPos.add(currentVelocity);

if (mc.world.getBlockState(new BlockPos(currentPos)).getMaterial().isSolid()) {
return currentPos;
}

if (Math.abs(currentPos.y - startPos.y) > 50) {
return currentPos;
}
}
}
}
// created by privatebuy aka funtik
 
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Пожалуйста, авторизуйтесь для просмотра ссылки.


Код:
Expand Collapse Copy
@FunctionAnot(name = "Prediction", description = "Отображает предсказание траектории полёта эндер-жемчуга", category = Category.RENDER)
public class Prediction extends Function {

private static final Minecraft mc = Minecraft.getInstance();

public Prediction() {
}

[USER=1367676]@override[/USER]
protected void onEnable() {
}

[USER=1367676]@override[/USER]
protected void onDisable() {
}

[USER=1367676]@override[/USER]
public void onBindPress() {
}

[USER=1474073]@Subscribe[/USER]
public void onRenderWorldLast(RenderEvent event) {
if (mc.world == null || mc.player == null || !enabled) return;

MatrixStack matrixStack = event.getMatrixStack();
float partialTicks = event.getPartialTicks();

for (Entity entity : mc.world.getAllEntities()) {
if (!(entity instanceof EnderPearlEntity)) continue;

EnderPearlEntity pearl = (EnderPearlEntity) entity;
renderPearlTrajectory(matrixStack, pearl, partialTicks);
}
}

private Vector3d getNextMotion(ThrowableEntity throwable, Vector3d motion) {
motion = motion.scale(0.99);
if (!throwable.hasNoGravity()) {
motion = motion.subtract(0, 0.03f, 0);
}
return motion;
}

private void renderPearlTrajectory(MatrixStack matrixStack, EnderPearlEntity pearl, float partialTicks) {
Vector3d startPos = pearl.getPositionVec();
Vector3d velocity = pearl.getMotion();
Vector3d endPos = findLandingPosition(pearl, startPos, velocity);
Vector2f startScreen = ProjectionUtil.project((float)startPos.x, (float)startPos.y, (float)startPos.z);
Vector2f endScreen = ProjectionUtil.project((float)endPos.x, (float)endPos.y, (float)endPos.z);

RenderSystem.disableDepthTest();
RenderSystem.disableTexture();
RenderSystem.disableAlphaTest();
RenderSystem.enableBlend();
RenderSystem.defaultBlendFunc();
RenderSystem.color4f(4.0F, 0.0F, 0.0F, 1.0F);
RenderSystem.lineWidth(3.8F);

Tessellator tessellator = Tessellator.getInstance();
BufferBuilder bufferBuilder = tessellator.getBuffer();
bufferBuilder.begin(GL11.GL_LINES, DefaultVertexFormats.POSITION);
bufferBuilder.pos(startScreen.x, startScreen.y, 0).endVertex();
bufferBuilder.pos(endScreen.x, endScreen.y, 0).endVertex();
tessellator.draw();

RenderSystem.enableAlphaTest();
RenderSystem.enableTexture();
RenderSystem.enableDepthTest();

BlockPos landingBlock = new BlockPos(endPos);
ItemStack blockItemStack = new ItemStack(mc.world.getBlockState(landingBlock).getBlock());
ItemStack pearlItemStack = new ItemStack(Items.ENDER_PEARL);

int verticalDistance = (int)Math.abs(startPos.y - endPos.y);

RenderSystem.pushMatrix();
RenderSystem.enableBlend();
mc.getItemRenderer().renderItemIntoGUI(pearlItemStack, (int)(endScreen.x + 10), (int)(endScreen.y - 8));
RenderSystem.disableBlend();
RenderSystem.popMatrix();

String distanceText = verticalDistance + " Bloks";
IFont.drawWithShadowCenteredX(
IFont.MONTSERRAT_BOLD,
distanceText,
endScreen.x,
endScreen.y + 10,
new Color(128, 128, 128),
14,
matrixStack
);
}

private void renderLine(double x1, double y1, double z1, double x2, double y2, double z2, Color color) {
Vector2f start = ProjectionUtil.project((float)x1, (float)y1, (float)z1);
Vector2f end = ProjectionUtil.project((float)x2, (float)y2, (float)z2);

RenderSystem.disableDepthTest();
RenderSystem.disableTexture();
RenderSystem.disableAlphaTest();
RenderSystem.enableBlend();
RenderSystem.defaultBlendFunc();
RenderSystem.color4f(color.getRed() / 255f, color.getGreen() / 255f, color.getBlue() / 255f, color.getAlpha() / 255f);
RenderSystem.lineWidth(15.0F);

Tessellator tessellator = Tessellator.getInstance();
BufferBuilder bufferBuilder = tessellator.getBuffer();
bufferBuilder.begin(GL11.GL_LINES, DefaultVertexFormats.POSITION);
bufferBuilder.pos(start.x, start.y, 0).endVertex();
bufferBuilder.pos(end.x, end.y, 0).endVertex();
tessellator.draw();

RenderSystem.enableAlphaTest();
RenderSystem.enableTexture();
RenderSystem.enableDepthTest();
}

private Vector3d findLandingPosition(ThrowableEntity throwable, Vector3d startPos, Vector3d initialVelocity) {
Vector3d currentPos = startPos;
Vector3d currentVelocity = initialVelocity;
double gravity = 0.03999999910593033D;

while (true) {
currentVelocity = currentVelocity.subtract(0, gravity, 0);
currentPos = currentPos.add(currentVelocity);
currentPos = currentPos.add(currentVelocity);

if (mc.world.getBlockState(new BlockPos(currentPos)).getMaterial().isSolid()) {
return currentPos;
}

if (Math.abs(currentPos.y - startPos.y) > 50) {
return currentPos;
}
}
}
}
// created by privatebuy aka funtik
1000444946.png

Blok???
Пожалуйста, авторизуйтесь для просмотра ссылки.


Код:
Expand Collapse Copy
private static final Minecraft mc = Minecraft.getInstance()
IMinecraft просто существует
 
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Код:
Expand Collapse Copy
[USER=1367676]@override[/USER]
protected void onEnable() {
}

[USER=1367676]@override[/USER]
protected void onDisable() {
}

[USER=1367676]@override[/USER]
public void onBindPress() {
}
Тут по любому было "Добавьте вашу логику включения"
 
Пожалуйста, авторизуйтесь для просмотра ссылки.


Код:
Expand Collapse Copy
@FunctionAnot(name = "Prediction", description = "Отображает предсказание траектории полёта эндер-жемчуга", category = Category.RENDER)
public class Prediction extends Function {

private static final Minecraft mc = Minecraft.getInstance();

public Prediction() {
}

[USER=1367676]@override[/USER]
protected void onEnable() {
}

[USER=1367676]@override[/USER]
protected void onDisable() {
}

[USER=1367676]@override[/USER]
public void onBindPress() {
}

[USER=1474073]@Subscribe[/USER]
public void onRenderWorldLast(RenderEvent event) {
if (mc.world == null || mc.player == null || !enabled) return;

MatrixStack matrixStack = event.getMatrixStack();
float partialTicks = event.getPartialTicks();

for (Entity entity : mc.world.getAllEntities()) {
if (!(entity instanceof EnderPearlEntity)) continue;

EnderPearlEntity pearl = (EnderPearlEntity) entity;
renderPearlTrajectory(matrixStack, pearl, partialTicks);
}
}

private Vector3d getNextMotion(ThrowableEntity throwable, Vector3d motion) {
motion = motion.scale(0.99);
if (!throwable.hasNoGravity()) {
motion = motion.subtract(0, 0.03f, 0);
}
return motion;
}

private void renderPearlTrajectory(MatrixStack matrixStack, EnderPearlEntity pearl, float partialTicks) {
Vector3d startPos = pearl.getPositionVec();
Vector3d velocity = pearl.getMotion();
Vector3d endPos = findLandingPosition(pearl, startPos, velocity);
Vector2f startScreen = ProjectionUtil.project((float)startPos.x, (float)startPos.y, (float)startPos.z);
Vector2f endScreen = ProjectionUtil.project((float)endPos.x, (float)endPos.y, (float)endPos.z);

RenderSystem.disableDepthTest();
RenderSystem.disableTexture();
RenderSystem.disableAlphaTest();
RenderSystem.enableBlend();
RenderSystem.defaultBlendFunc();
RenderSystem.color4f(4.0F, 0.0F, 0.0F, 1.0F);
RenderSystem.lineWidth(3.8F);

Tessellator tessellator = Tessellator.getInstance();
BufferBuilder bufferBuilder = tessellator.getBuffer();
bufferBuilder.begin(GL11.GL_LINES, DefaultVertexFormats.POSITION);
bufferBuilder.pos(startScreen.x, startScreen.y, 0).endVertex();
bufferBuilder.pos(endScreen.x, endScreen.y, 0).endVertex();
tessellator.draw();

RenderSystem.enableAlphaTest();
RenderSystem.enableTexture();
RenderSystem.enableDepthTest();

BlockPos landingBlock = new BlockPos(endPos);
ItemStack blockItemStack = new ItemStack(mc.world.getBlockState(landingBlock).getBlock());
ItemStack pearlItemStack = new ItemStack(Items.ENDER_PEARL);

int verticalDistance = (int)Math.abs(startPos.y - endPos.y);

RenderSystem.pushMatrix();
RenderSystem.enableBlend();
mc.getItemRenderer().renderItemIntoGUI(pearlItemStack, (int)(endScreen.x + 10), (int)(endScreen.y - 8));
RenderSystem.disableBlend();
RenderSystem.popMatrix();

String distanceText = verticalDistance + " Bloks";
IFont.drawWithShadowCenteredX(
IFont.MONTSERRAT_BOLD,
distanceText,
endScreen.x,
endScreen.y + 10,
new Color(128, 128, 128),
14,
matrixStack
);
}

private void renderLine(double x1, double y1, double z1, double x2, double y2, double z2, Color color) {
Vector2f start = ProjectionUtil.project((float)x1, (float)y1, (float)z1);
Vector2f end = ProjectionUtil.project((float)x2, (float)y2, (float)z2);

RenderSystem.disableDepthTest();
RenderSystem.disableTexture();
RenderSystem.disableAlphaTest();
RenderSystem.enableBlend();
RenderSystem.defaultBlendFunc();
RenderSystem.color4f(color.getRed() / 255f, color.getGreen() / 255f, color.getBlue() / 255f, color.getAlpha() / 255f);
RenderSystem.lineWidth(15.0F);

Tessellator tessellator = Tessellator.getInstance();
BufferBuilder bufferBuilder = tessellator.getBuffer();
bufferBuilder.begin(GL11.GL_LINES, DefaultVertexFormats.POSITION);
bufferBuilder.pos(start.x, start.y, 0).endVertex();
bufferBuilder.pos(end.x, end.y, 0).endVertex();
tessellator.draw();

RenderSystem.enableAlphaTest();
RenderSystem.enableTexture();
RenderSystem.enableDepthTest();
}

private Vector3d findLandingPosition(ThrowableEntity throwable, Vector3d startPos, Vector3d initialVelocity) {
Vector3d currentPos = startPos;
Vector3d currentVelocity = initialVelocity;
double gravity = 0.03999999910593033D;

while (true) {
currentVelocity = currentVelocity.subtract(0, gravity, 0);
currentPos = currentPos.add(currentVelocity);
currentPos = currentPos.add(currentVelocity);

if (mc.world.getBlockState(new BlockPos(currentPos)).getMaterial().isSolid()) {
return currentPos;
}

if (Math.abs(currentPos.y - startPos.y) > 50) {
return currentPos;
}
}
}
}
// created by privatebuy aka funtik
Залупа ??
 
Пожалуйста, авторизуйтесь для просмотра ссылки.


Код:
Expand Collapse Copy
@FunctionAnot(name = "Prediction", description = "Отображает предсказание траектории полёта эндер-жемчуга", category = Category.RENDER)
public class Prediction extends Function {

private static final Minecraft mc = Minecraft.getInstance();

public Prediction() {
}

[USER=1367676]@override[/USER]
protected void onEnable() {
}

[USER=1367676]@override[/USER]
protected void onDisable() {
}

[USER=1367676]@override[/USER]
public void onBindPress() {
}

[USER=1474073]@Subscribe[/USER]
public void onRenderWorldLast(RenderEvent event) {
if (mc.world == null || mc.player == null || !enabled) return;

MatrixStack matrixStack = event.getMatrixStack();
float partialTicks = event.getPartialTicks();

for (Entity entity : mc.world.getAllEntities()) {
if (!(entity instanceof EnderPearlEntity)) continue;

EnderPearlEntity pearl = (EnderPearlEntity) entity;
renderPearlTrajectory(matrixStack, pearl, partialTicks);
}
}

private Vector3d getNextMotion(ThrowableEntity throwable, Vector3d motion) {
motion = motion.scale(0.99);
if (!throwable.hasNoGravity()) {
motion = motion.subtract(0, 0.03f, 0);
}
return motion;
}

private void renderPearlTrajectory(MatrixStack matrixStack, EnderPearlEntity pearl, float partialTicks) {
Vector3d startPos = pearl.getPositionVec();
Vector3d velocity = pearl.getMotion();
Vector3d endPos = findLandingPosition(pearl, startPos, velocity);
Vector2f startScreen = ProjectionUtil.project((float)startPos.x, (float)startPos.y, (float)startPos.z);
Vector2f endScreen = ProjectionUtil.project((float)endPos.x, (float)endPos.y, (float)endPos.z);

RenderSystem.disableDepthTest();
RenderSystem.disableTexture();
RenderSystem.disableAlphaTest();
RenderSystem.enableBlend();
RenderSystem.defaultBlendFunc();
RenderSystem.color4f(4.0F, 0.0F, 0.0F, 1.0F);
RenderSystem.lineWidth(3.8F);

Tessellator tessellator = Tessellator.getInstance();
BufferBuilder bufferBuilder = tessellator.getBuffer();
bufferBuilder.begin(GL11.GL_LINES, DefaultVertexFormats.POSITION);
bufferBuilder.pos(startScreen.x, startScreen.y, 0).endVertex();
bufferBuilder.pos(endScreen.x, endScreen.y, 0).endVertex();
tessellator.draw();

RenderSystem.enableAlphaTest();
RenderSystem.enableTexture();
RenderSystem.enableDepthTest();

BlockPos landingBlock = new BlockPos(endPos);
ItemStack blockItemStack = new ItemStack(mc.world.getBlockState(landingBlock).getBlock());
ItemStack pearlItemStack = new ItemStack(Items.ENDER_PEARL);

int verticalDistance = (int)Math.abs(startPos.y - endPos.y);

RenderSystem.pushMatrix();
RenderSystem.enableBlend();
mc.getItemRenderer().renderItemIntoGUI(pearlItemStack, (int)(endScreen.x + 10), (int)(endScreen.y - 8));
RenderSystem.disableBlend();
RenderSystem.popMatrix();

String distanceText = verticalDistance + " Bloks";
IFont.drawWithShadowCenteredX(
IFont.MONTSERRAT_BOLD,
distanceText,
endScreen.x,
endScreen.y + 10,
new Color(128, 128, 128),
14,
matrixStack
);
}

private void renderLine(double x1, double y1, double z1, double x2, double y2, double z2, Color color) {
Vector2f start = ProjectionUtil.project((float)x1, (float)y1, (float)z1);
Vector2f end = ProjectionUtil.project((float)x2, (float)y2, (float)z2);

RenderSystem.disableDepthTest();
RenderSystem.disableTexture();
RenderSystem.disableAlphaTest();
RenderSystem.enableBlend();
RenderSystem.defaultBlendFunc();
RenderSystem.color4f(color.getRed() / 255f, color.getGreen() / 255f, color.getBlue() / 255f, color.getAlpha() / 255f);
RenderSystem.lineWidth(15.0F);

Tessellator tessellator = Tessellator.getInstance();
BufferBuilder bufferBuilder = tessellator.getBuffer();
bufferBuilder.begin(GL11.GL_LINES, DefaultVertexFormats.POSITION);
bufferBuilder.pos(start.x, start.y, 0).endVertex();
bufferBuilder.pos(end.x, end.y, 0).endVertex();
tessellator.draw();

RenderSystem.enableAlphaTest();
RenderSystem.enableTexture();
RenderSystem.enableDepthTest();
}

private Vector3d findLandingPosition(ThrowableEntity throwable, Vector3d startPos, Vector3d initialVelocity) {
Vector3d currentPos = startPos;
Vector3d currentVelocity = initialVelocity;
double gravity = 0.03999999910593033D;

while (true) {
currentVelocity = currentVelocity.subtract(0, gravity, 0);
currentPos = currentPos.add(currentVelocity);
currentPos = currentPos.add(currentVelocity);

if (mc.world.getBlockState(new BlockPos(currentPos)).getMaterial().isSolid()) {
return currentPos;
}

if (Math.abs(currentPos.y - startPos.y) > 50) {
return currentPos;
}
}
}
}
// created by privatebuy aka funtik
фу нахуй
 
мне интересно когда чатгпт уже обучится базе экспенсива.......
 
мне интересно когда чатгпт уже обучится базе экспенсива.......
ну если ты не можешь различить експу от моей базы то жаль тебя мега крякер
Я КРЯКНУЛ РЕЛЕЙК,ЭКСЕЛЕНТ,НУРИК,ДЕЛЬТУ,СВОЙ ЧЛЕН,ARBUZ
НУ НЕ Я ЭТО НЕ КРЯКАЛ ЭТО ВСЕ ПАСТЫ
мне интересно когда чатгпт уже обучится базе экспенсива.......
1742936988258.png
 
Последнее редактирование:
ну если ты не можешь различить експу от моей базы то жаль тебя мега крякер
Я КРЯКНУЛ РЕЛЕЙК,ЭКСЕЛЕНТ,НУРИК,ДЕЛЬТУ,СВОЙ ЧЛЕН,ARBUZ
НУ НЕ Я ЭТО НЕ КРЯКАЛ ЭТО ВСЕ ПАСТЫ

Посмотреть вложение 302108
Так ты чо крендель, помнишь новость в новостных каналах когда писали про кряк дельты и экселлента - это мы там сабку просили и скрин в итоге кидали крякнутый
ну если ты не можешь различить експу от моей базы то жаль тебя мега крякер
А насчет этого говна - я не ебу как ваш экспенсив выглядит, исходя из того что ты с помощью чата гпт с трудом насрал - ты гпт кодер
1742972814018.png

Чисто эта строка подверждает что ты гпт еблан, У тебя блять регистрация листенера евентов происходит при включении модуля твоего, и дополнительная проверка на enabled - смысла не имеет ибо ты бтв метод не вызываешь
 
Пожалуйста, авторизуйтесь для просмотра ссылки.


Код:
Expand Collapse Copy
@FunctionAnot(name = "Prediction", description = "Отображает предсказание траектории полёта эндер-жемчуга", category = Category.RENDER)
public class Prediction extends Function {

private static final Minecraft mc = Minecraft.getInstance();

public Prediction() {
}

[USER=1367676]@override[/USER]
protected void onEnable() {
}

[USER=1367676]@override[/USER]
protected void onDisable() {
}

[USER=1367676]@override[/USER]
public void onBindPress() {
}

[USER=1474073]@Subscribe[/USER]
public void onRenderWorldLast(RenderEvent event) {
if (mc.world == null || mc.player == null || !enabled) return;

MatrixStack matrixStack = event.getMatrixStack();
float partialTicks = event.getPartialTicks();

for (Entity entity : mc.world.getAllEntities()) {
if (!(entity instanceof EnderPearlEntity)) continue;

EnderPearlEntity pearl = (EnderPearlEntity) entity;
renderPearlTrajectory(matrixStack, pearl, partialTicks);
}
}

private Vector3d getNextMotion(ThrowableEntity throwable, Vector3d motion) {
motion = motion.scale(0.99);
if (!throwable.hasNoGravity()) {
motion = motion.subtract(0, 0.03f, 0);
}
return motion;
}

private void renderPearlTrajectory(MatrixStack matrixStack, EnderPearlEntity pearl, float partialTicks) {
Vector3d startPos = pearl.getPositionVec();
Vector3d velocity = pearl.getMotion();
Vector3d endPos = findLandingPosition(pearl, startPos, velocity);
Vector2f startScreen = ProjectionUtil.project((float)startPos.x, (float)startPos.y, (float)startPos.z);
Vector2f endScreen = ProjectionUtil.project((float)endPos.x, (float)endPos.y, (float)endPos.z);

RenderSystem.disableDepthTest();
RenderSystem.disableTexture();
RenderSystem.disableAlphaTest();
RenderSystem.enableBlend();
RenderSystem.defaultBlendFunc();
RenderSystem.color4f(4.0F, 0.0F, 0.0F, 1.0F);
RenderSystem.lineWidth(3.8F);

Tessellator tessellator = Tessellator.getInstance();
BufferBuilder bufferBuilder = tessellator.getBuffer();
bufferBuilder.begin(GL11.GL_LINES, DefaultVertexFormats.POSITION);
bufferBuilder.pos(startScreen.x, startScreen.y, 0).endVertex();
bufferBuilder.pos(endScreen.x, endScreen.y, 0).endVertex();
tessellator.draw();

RenderSystem.enableAlphaTest();
RenderSystem.enableTexture();
RenderSystem.enableDepthTest();

BlockPos landingBlock = new BlockPos(endPos);
ItemStack blockItemStack = new ItemStack(mc.world.getBlockState(landingBlock).getBlock());
ItemStack pearlItemStack = new ItemStack(Items.ENDER_PEARL);

int verticalDistance = (int)Math.abs(startPos.y - endPos.y);

RenderSystem.pushMatrix();
RenderSystem.enableBlend();
mc.getItemRenderer().renderItemIntoGUI(pearlItemStack, (int)(endScreen.x + 10), (int)(endScreen.y - 8));
RenderSystem.disableBlend();
RenderSystem.popMatrix();

String distanceText = verticalDistance + " Bloks";
IFont.drawWithShadowCenteredX(
IFont.MONTSERRAT_BOLD,
distanceText,
endScreen.x,
endScreen.y + 10,
new Color(128, 128, 128),
14,
matrixStack
);
}

private void renderLine(double x1, double y1, double z1, double x2, double y2, double z2, Color color) {
Vector2f start = ProjectionUtil.project((float)x1, (float)y1, (float)z1);
Vector2f end = ProjectionUtil.project((float)x2, (float)y2, (float)z2);

RenderSystem.disableDepthTest();
RenderSystem.disableTexture();
RenderSystem.disableAlphaTest();
RenderSystem.enableBlend();
RenderSystem.defaultBlendFunc();
RenderSystem.color4f(color.getRed() / 255f, color.getGreen() / 255f, color.getBlue() / 255f, color.getAlpha() / 255f);
RenderSystem.lineWidth(15.0F);

Tessellator tessellator = Tessellator.getInstance();
BufferBuilder bufferBuilder = tessellator.getBuffer();
bufferBuilder.begin(GL11.GL_LINES, DefaultVertexFormats.POSITION);
bufferBuilder.pos(start.x, start.y, 0).endVertex();
bufferBuilder.pos(end.x, end.y, 0).endVertex();
tessellator.draw();

RenderSystem.enableAlphaTest();
RenderSystem.enableTexture();
RenderSystem.enableDepthTest();
}

private Vector3d findLandingPosition(ThrowableEntity throwable, Vector3d startPos, Vector3d initialVelocity) {
Vector3d currentPos = startPos;
Vector3d currentVelocity = initialVelocity;
double gravity = 0.03999999910593033D;

while (true) {
currentVelocity = currentVelocity.subtract(0, gravity, 0);
currentPos = currentPos.add(currentVelocity);
currentPos = currentPos.add(currentVelocity);

if (mc.world.getBlockState(new BlockPos(currentPos)).getMaterial().isSolid()) {
return currentPos;
}

if (Math.abs(currentPos.y - startPos.y) > 50) {
return currentPos;
}
}
}
}
// created by privatebuy aka funtik
ой фу блять, всё криво та ещё Bloks добило это пиздец... /del
 
Пожалуйста, авторизуйтесь для просмотра ссылки.


Код:
Expand Collapse Copy
@FunctionAnot(name = "Prediction", description = "Отображает предсказание траектории полёта эндер-жемчуга", category = Category.RENDER)
public class Prediction extends Function {

private static final Minecraft mc = Minecraft.getInstance();

public Prediction() {
}

[USER=1367676]@override[/USER]
protected void onEnable() {
}

[USER=1367676]@override[/USER]
protected void onDisable() {
}

[USER=1367676]@override[/USER]
public void onBindPress() {
}

[USER=1474073]@Subscribe[/USER]
public void onRenderWorldLast(RenderEvent event) {
if (mc.world == null || mc.player == null || !enabled) return;

MatrixStack matrixStack = event.getMatrixStack();
float partialTicks = event.getPartialTicks();

for (Entity entity : mc.world.getAllEntities()) {
if (!(entity instanceof EnderPearlEntity)) continue;

EnderPearlEntity pearl = (EnderPearlEntity) entity;
renderPearlTrajectory(matrixStack, pearl, partialTicks);
}
}

private Vector3d getNextMotion(ThrowableEntity throwable, Vector3d motion) {
motion = motion.scale(0.99);
if (!throwable.hasNoGravity()) {
motion = motion.subtract(0, 0.03f, 0);
}
return motion;
}

private void renderPearlTrajectory(MatrixStack matrixStack, EnderPearlEntity pearl, float partialTicks) {
Vector3d startPos = pearl.getPositionVec();
Vector3d velocity = pearl.getMotion();
Vector3d endPos = findLandingPosition(pearl, startPos, velocity);
Vector2f startScreen = ProjectionUtil.project((float)startPos.x, (float)startPos.y, (float)startPos.z);
Vector2f endScreen = ProjectionUtil.project((float)endPos.x, (float)endPos.y, (float)endPos.z);

RenderSystem.disableDepthTest();
RenderSystem.disableTexture();
RenderSystem.disableAlphaTest();
RenderSystem.enableBlend();
RenderSystem.defaultBlendFunc();
RenderSystem.color4f(4.0F, 0.0F, 0.0F, 1.0F);
RenderSystem.lineWidth(3.8F);

Tessellator tessellator = Tessellator.getInstance();
BufferBuilder bufferBuilder = tessellator.getBuffer();
bufferBuilder.begin(GL11.GL_LINES, DefaultVertexFormats.POSITION);
bufferBuilder.pos(startScreen.x, startScreen.y, 0).endVertex();
bufferBuilder.pos(endScreen.x, endScreen.y, 0).endVertex();
tessellator.draw();

RenderSystem.enableAlphaTest();
RenderSystem.enableTexture();
RenderSystem.enableDepthTest();

BlockPos landingBlock = new BlockPos(endPos);
ItemStack blockItemStack = new ItemStack(mc.world.getBlockState(landingBlock).getBlock());
ItemStack pearlItemStack = new ItemStack(Items.ENDER_PEARL);

int verticalDistance = (int)Math.abs(startPos.y - endPos.y);

RenderSystem.pushMatrix();
RenderSystem.enableBlend();
mc.getItemRenderer().renderItemIntoGUI(pearlItemStack, (int)(endScreen.x + 10), (int)(endScreen.y - 8));
RenderSystem.disableBlend();
RenderSystem.popMatrix();

String distanceText = verticalDistance + " Bloks";
IFont.drawWithShadowCenteredX(
IFont.MONTSERRAT_BOLD,
distanceText,
endScreen.x,
endScreen.y + 10,
new Color(128, 128, 128),
14,
matrixStack
);
}

private void renderLine(double x1, double y1, double z1, double x2, double y2, double z2, Color color) {
Vector2f start = ProjectionUtil.project((float)x1, (float)y1, (float)z1);
Vector2f end = ProjectionUtil.project((float)x2, (float)y2, (float)z2);

RenderSystem.disableDepthTest();
RenderSystem.disableTexture();
RenderSystem.disableAlphaTest();
RenderSystem.enableBlend();
RenderSystem.defaultBlendFunc();
RenderSystem.color4f(color.getRed() / 255f, color.getGreen() / 255f, color.getBlue() / 255f, color.getAlpha() / 255f);
RenderSystem.lineWidth(15.0F);

Tessellator tessellator = Tessellator.getInstance();
BufferBuilder bufferBuilder = tessellator.getBuffer();
bufferBuilder.begin(GL11.GL_LINES, DefaultVertexFormats.POSITION);
bufferBuilder.pos(start.x, start.y, 0).endVertex();
bufferBuilder.pos(end.x, end.y, 0).endVertex();
tessellator.draw();

RenderSystem.enableAlphaTest();
RenderSystem.enableTexture();
RenderSystem.enableDepthTest();
}

private Vector3d findLandingPosition(ThrowableEntity throwable, Vector3d startPos, Vector3d initialVelocity) {
Vector3d currentPos = startPos;
Vector3d currentVelocity = initialVelocity;
double gravity = 0.03999999910593033D;

while (true) {
currentVelocity = currentVelocity.subtract(0, gravity, 0);
currentPos = currentPos.add(currentVelocity);
currentPos = currentPos.add(currentVelocity);

if (mc.world.getBlockState(new BlockPos(currentPos)).getMaterial().isSolid()) {
return currentPos;
}

if (Math.abs(currentPos.y - startPos.y) > 50) {
return currentPos;
}
}
}
}
// created by privatebuy aka funtik
чо так криво
 
кто нибудь может предикшион модом дать пожалуйста,я в кодах ничего не понимаю
 
Назад
Сверху Снизу