Merge pull request #2776 from thecakeisalie25/master

Add "RenderGoalAsBox" Setting
This commit is contained in:
Leijurv 2021-05-26 11:30:51 -07:00 committed by GitHub
commit fcb3747690
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 4 deletions

View File

@ -595,6 +595,12 @@ public final class Settings {
*/
public final Setting<Boolean> renderGoal = new Setting<>(true);
/**
* Render the goal as a sick animated thingy instead of just a box
* (also controls animation of GoalXZ if {@link #renderGoalXZBeacon} is enabled)
*/
public final Setting<Boolean> renderGoalAnimated = new Setting<>(true);
/**
* Render selection boxes
*/

View File

@ -207,8 +207,14 @@ public final class PathRenderer implements IRenderer {
double minX, maxX;
double minZ, maxZ;
double minY, maxY;
double y1, y2;
double y = MathHelper.cos((float) (((float) ((System.nanoTime() / 100000L) % 20000L)) / 20000F * Math.PI * 2));
double y, y1, y2;
if (!settings.renderGoalAnimated.value) {
// y = 1 causes rendering issues when the player is at the same y as the top of a block for some reason
y = 0.999F;
}
else {
y = MathHelper.cos((float) (((float) ((System.nanoTime() / 100000L) % 20000L)) / 20000F * Math.PI * 2));
}
if (goal instanceof IGoalRenderPos) {
BlockPos goalPos = ((IGoalRenderPos) goal).getGoalPos();
minX = goalPos.getX() + 0.002 - renderPosX;
@ -243,9 +249,9 @@ public final class PathRenderer implements IRenderer {
goalPos.getX() - renderPosX,
-renderPosY,
goalPos.getZ() - renderPosZ,
partialTicks,
settings.renderGoalAnimated.value ? partialTicks : 0,
1.0,
player.world.getTotalWorldTime(),
settings.renderGoalAnimated.value ? player.world.getTotalWorldTime() : 0,
0,
256,
color.getColorComponents(null)