-
-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #502 from akarahdev/master
Enderman Slayer Utilities
- Loading branch information
Showing
8 changed files
with
187 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
src/main/java/de/hysky/skyblocker/skyblock/end/BeaconHighlighter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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 final List<BlockPos> beaconPositions = new ArrayList<>(); | ||
|
||
/** | ||
* Initializes the beacon highlighting system. | ||
* {@link BeaconHighlighter#render(WorldRenderContext)} 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 | ||
)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters