Merge pull request #2776 from thecakeisalie25/master
Add "RenderGoalAsBox" Setting
This commit is contained in:
commit
fcb3747690
@ -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
|
||||
*/
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user