@Override
public void onDisable() {
super.onDisable();
circles.clear();
}
@EventTarget
public void jump(PlayerJumpEvent evt) {
ClientPlayerEntity t = mc.player;
if (mc.player.isOnGround()) {
if (circles.size() > 20) circles.remove(0);
// if (sendNotification)
// NotificationManager.sendNotification(new Notification("Spawned Circle | Size : " + circles.size(), NotificationType.INFO));
this.circles.add(new Circle(new Vector3d(t.getPosX(), t.getPosY(), t.getPosZ()), (long) (10000.0f), this.circles.size()));
}
};
@EventTarget
public void tick(EventTick evt) {
circles.removeIf(c -> c.timer.hasReached((int)c.time));
};
public static MatrixStack matrixFrom(MatrixStack matrices, ActiveRenderInfo camera) {
matrices.rotate(Vector3f.XP.rotationDegrees(camera.getPitch()));
matrices.rotate(Vector3f.YP.rotationDegrees(camera.getYaw() + 180.0F));
return matrices;
}
@EventTarget
public void render(EventRender3D evt) {
MatrixStack ms = matrixFrom(evt.getMatrixStack(),mc.gameRenderer.getActiveRenderInfo());
double ix = -((mc.getRenderManager().info.getProjectedView().getX()));
double iy = -((mc.getRenderManager().info.getProjectedView().getY()));
double iz = -((mc.getRenderManager().info.getProjectedView().getZ()));
Collections.reverse(circles);
for (Circle c : circles) {
double x = c.positionVector.x - c.factor / 2;
double y = c.positionVector.y;
double z = c.positionVector.z - c.factor / 2;
c.factor = 2;
c.alpha = 100;
Tessellator tessellator = Tessellator.getInstance();
BufferBuilder bufferbuilder = tessellator.getBuffer();
ms.push();
ms.translate(ix, iy, iz);
ms.translate(x, y, z);
ms.rotate(new Quaternion(new Vector3f(1, 0, 0), 90, true));
enableBlend();
disableAlphaTest();
depthMask(false);
GL11.glAlphaFunc(GL11.GL_GREATER, 0.02f);
GL11.glDisable(GL11.GL_POINT_SMOOTH);
int bs = 2;
int bs2 = 0;
bs = bs * 4;
float b = 0.5f;
int finalBs = bs;
String path = "/assets/rich/icons/target.png";
boolean renderColor = false;
enableBlend();
RenderSystem.blendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO);
RenderSystem.enableDepthTest();
mc.getTextureManager().bindTexture(new ResourceLocation("rich/icons/target.png"));
bufferbuilder.begin(GL_QUADS, POSITION_TEX_COLOR);
bufferbuilder.pos(ms.getLast().getMatrix(), 0, 0, 0).tex(0, 0).color(
255,255,255, 255
).endVertex();
bufferbuilder.pos(ms.getLast().getMatrix(),0, c.factor, 0).tex(0, 1).color(
255,255,255, 255).endVertex();
bufferbuilder.pos(ms.getLast().getMatrix(),c.factor, c.factor, 0).tex(1, 1).color(
255,255,255, 255).endVertex();
bufferbuilder.pos(ms.getLast().getMatrix(),c.factor, 0, 0).tex(1, 0).color(
255,255,255, 255).endVertex();
tessellator.draw();
enableAlphaTest();
disableBlend();
depthMask(true);
ms.pop();
}
Collections.reverse(circles);
};
//xui ego znaet
public class Circle {
public Vector3d positionVector;
public long time;
public TimerUtil timer;
public int index;
public float alpha = 255, factor = 0;
public boolean reached = false;
public Circle(Vector3d pos, long time, int index) {
this.positionVector = pos;
this.time = time;
this.index = index;
this.timer = new TimerUtil();
}
}