blob: 65e9e639ed07f16dc6a43e38145ca0557547777e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
package de.hysky.skyblocker.skyblock.end;
import de.hysky.skyblocker.config.SkyblockerConfigManager;
import de.hysky.skyblocker.utils.Utils;
import de.hysky.skyblocker.utils.render.RenderHelper;
import net.fabricmc.fabric.api.client.rendering.v1.WorldRenderContext;
import net.fabricmc.fabric.api.client.rendering.v1.WorldRenderEvents;
import net.minecraft.util.math.BlockPos;
import java.util.ArrayList;
import java.util.List;
public class BeaconHighlighter {
public static List<BlockPos> beaconPositions = new ArrayList<>();
/**
* Initializes the beacon highlighting system.
* `BeaconHighlighter::render` is called after translucent rendering.
*/
public static void init() {
WorldRenderEvents.AFTER_TRANSLUCENT.register(BeaconHighlighter::render);
}
/**
* Renders the beacon glow around it. It is rendered in a red color with 50% opacity, and
* is visible through walls.
*
* @param context An instance of WorldRenderContext for the RenderHelper to use
*/
public static void render(WorldRenderContext context) {
if (Utils.isInTheEnd() && SkyblockerConfigManager.get().slayer.endermanSlayer.highlightBeacons)
beaconPositions.forEach((position) -> RenderHelper.renderFilled(
context,
position,
new float[]{1.0f, 0.0f, 0.0f},
0.5f,
false
));
}
}
|