|
17 | 17 |
|
18 | 18 | package com.lambda.module.modules.render |
19 | 19 |
|
| 20 | +import com.lambda.Lambda.mc |
| 21 | +import com.lambda.context.SafeContext |
| 22 | +import com.lambda.event.events.MovementEvent |
| 23 | +import com.lambda.event.events.PlayerEvent |
| 24 | +import com.lambda.event.events.RenderEvent |
| 25 | +import com.lambda.event.events.TickEvent |
| 26 | +import com.lambda.event.listener.SafeListener.Companion.listen |
| 27 | +import com.lambda.graphics.buffer.vertex.attributes.VertexAttrib |
| 28 | +import com.lambda.graphics.buffer.vertex.attributes.VertexMode |
| 29 | +import com.lambda.graphics.gl.GlStateUtils.withBlendFunc |
| 30 | +import com.lambda.graphics.gl.GlStateUtils.withDepth |
| 31 | +import com.lambda.graphics.gl.Matrices |
| 32 | +import com.lambda.graphics.gl.Matrices.buildWorldProjection |
| 33 | +import com.lambda.graphics.gl.Matrices.withVertexTransform |
| 34 | +import com.lambda.graphics.pipeline.VertexBuilder |
| 35 | +import com.lambda.graphics.pipeline.VertexPipeline |
| 36 | +import com.lambda.graphics.shader.Shader.Companion.shader |
| 37 | +import com.lambda.interaction.request.rotating.Rotation |
| 38 | +import com.lambda.module.Module |
| 39 | +import com.lambda.module.modules.client.GuiSettings |
| 40 | +import com.lambda.module.modules.client.GuiSettings.colorSpeed |
| 41 | +import com.lambda.module.tag.ModuleTag |
| 42 | +import com.lambda.util.extension.partialTicks |
| 43 | +import com.lambda.util.math.DOWN |
| 44 | +import com.lambda.util.math.MathUtils.random |
| 45 | +import com.lambda.util.math.UP |
| 46 | +import com.lambda.util.math.lerp |
| 47 | +import com.lambda.util.math.multAlpha |
| 48 | +import com.lambda.util.math.plus |
| 49 | +import com.lambda.util.math.times |
| 50 | +import com.lambda.util.math.transform |
| 51 | +import com.lambda.util.player.MovementUtils.moveDelta |
| 52 | +import com.lambda.util.world.raycast.InteractionMask |
| 53 | +import com.mojang.blaze3d.opengl.GlConst.GL_ONE |
| 54 | +import com.mojang.blaze3d.opengl.GlConst.GL_SRC_ALPHA |
| 55 | +import net.minecraft.entity.Entity |
| 56 | +import net.minecraft.util.math.Vec3d |
| 57 | +import kotlin.math.sin |
| 58 | + |
20 | 59 | // FixMe: Do not call render stuff in the initialization block |
21 | | -/*object Particles : Module( |
| 60 | +object Particles : Module( |
22 | 61 | name = "Particles", |
23 | 62 | description = "Spawns fancy particles", |
24 | | - defaultTags = setOf(ModuleTag.RENDER) |
| 63 | + tag = ModuleTag.RENDER, |
25 | 64 | ) { |
26 | 65 | // ToDo: resort, cleanup settings |
27 | 66 | private val duration by setting("Duration", 5.0, 1.0..500.0, 1.0) |
@@ -52,12 +91,10 @@ package com.lambda.module.modules.render |
52 | 91 | particles.removeIf(Particle::update) |
53 | 92 | } |
54 | 93 |
|
55 | | - listen<RenderEvent.World> { |
| 94 | + listen<RenderEvent.Render> { |
56 | 95 | // Todo: interpolated tickbased upload? |
57 | 96 | val builder = pipeline.build() |
58 | | - particles.forEach { |
59 | | - it.build(builder) |
60 | | - } |
| 97 | + particles.forEach { it.build(builder) } |
61 | 98 |
|
62 | 99 | withBlendFunc(GL_SRC_ALPHA, GL_ONE) { |
63 | 100 | shader.use() |
@@ -182,4 +219,4 @@ package com.lambda.module.modules.render |
182 | 219 | } |
183 | 220 | } |
184 | 221 | } |
185 | | -}*/ |
| 222 | +} |
0 commit comments