Skip to content

Commit ac2fcd4

Browse files
committed
fix skies
- fix crosshair
1 parent 0461d7e commit ac2fcd4

File tree

6 files changed

+43
-32
lines changed

6 files changed

+43
-32
lines changed

src/main/java/io/github/axolotlclient/config/AxolotlClientConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public class AxolotlClientConfig {
3636
public final BooleanOption nightMode = new BooleanOption("nightMode", false);
3737

3838
public final BooleanOption enableCustomOutlines = new BooleanOption("enabled", false);
39-
public final ColorOption outlineColor = new ColorOption("color", Color.parse("#04000000"));
39+
public final ColorOption outlineColor = new ColorOption("color", Color.parse("#66000000"));
4040
public final BooleanOption outlineChroma = new BooleanOption("chroma", false);
4141
public final DoubleOption outlineWidth = new DoubleOption("outlineWidth", 1, 1, 10);
4242

src/main/java/io/github/axolotlclient/config/options/EnumOption.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,13 @@ protected CommandResponse onCommandExecution(String arg) {
9696
return new CommandResponse(true, "Successfully set "+getName()+" to "+get()+"!");
9797
}
9898

99+
for (int i=0;i<values.length;i++){
100+
if(arg.equalsIgnoreCase(values[i])){
101+
this.i=i;
102+
return new CommandResponse(true, "Successfully set "+getName()+" to "+get()+" (Index: "+i+")!");
103+
}
104+
}
105+
99106
try {
100107
int value = Integer.parseInt(arg);
101108
if(value>values.length-1 || value < 0){

src/main/java/io/github/axolotlclient/mixin/MixinWorldRenderer.java

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ public void renderCustomSky(MatrixStack matrixStack, float tickDelta, CallbackIn
9494
Matrix4f matrix4f = matrixStack.peek().getModel();
9595
bufferBuilder.begin(6, VertexFormats.POSITION_COLOR);
9696
bufferBuilder.vertex(matrix4f, 0.0F, 100.0F, 0.0F).color(k, l, m, fs[3]).next();
97-
int n = 16;
9897

9998
for(int o = 0; o <= 16; ++o) {
10099
float p = (float)o * (float) (Math.PI * 2) / 16.0F;
@@ -118,30 +117,32 @@ public void renderCustomSky(MatrixStack matrixStack, float tickDelta, CallbackIn
118117
matrixStack.multiply(Vector3f.POSITIVE_X.getDegreesQuaternion(this.world.getSkyAngle(tickDelta) * 360.0F));
119118
Matrix4f matrix4f2 = matrixStack.peek().getModel();
120119
float l = 30.0F;
121-
MinecraftClient.getInstance().getTextureManager().bindTexture(SUN);
122-
bufferBuilder.begin(7, VertexFormats.POSITION_TEXTURE);
123-
bufferBuilder.vertex(matrix4f2, -l, 100.0F, -l).texture(0.0F, 0.0F).next();
124-
bufferBuilder.vertex(matrix4f2, l, 100.0F, -l).texture(1.0F, 0.0F).next();
125-
bufferBuilder.vertex(matrix4f2, l, 100.0F, l).texture(1.0F, 1.0F).next();
126-
bufferBuilder.vertex(matrix4f2, -l, 100.0F, l).texture(0.0F, 1.0F).next();
127-
bufferBuilder.end();
128-
BufferRenderer.draw(bufferBuilder);
129-
l = 20.0F;
130-
MinecraftClient.getInstance().getTextureManager().bindTexture(MOON_PHASES);
131-
int s = this.world.getMoonPhase();
132-
int t = s % 4;
133-
int n = s / 4 % 2;
134-
float u = (float)(t) / 4.0F;
135-
float p = (float)(n) / 2.0F;
136-
float q = (float)(t + 1) / 4.0F;
137-
float r = (float)(n + 1) / 2.0F;
138-
bufferBuilder.begin(7, VertexFormats.POSITION_TEXTURE);
139-
bufferBuilder.vertex(matrix4f2, -l, -100.0F, l).texture(q, r).next();
140-
bufferBuilder.vertex(matrix4f2, l, -100.0F, l).texture(u, r).next();
141-
bufferBuilder.vertex(matrix4f2, l, -100.0F, -l).texture(u, p).next();
142-
bufferBuilder.vertex(matrix4f2, -l, -100.0F, -l).texture(q, p).next();
143-
bufferBuilder.end();
144-
BufferRenderer.draw(bufferBuilder);
120+
if(AxolotlClient.CONFIG.showSunMoon.get()) {
121+
MinecraftClient.getInstance().getTextureManager().bindTexture(SUN);
122+
bufferBuilder.begin(7, VertexFormats.POSITION_TEXTURE);
123+
bufferBuilder.vertex(matrix4f2, -l, 100.0F, -l).texture(0.0F, 0.0F).next();
124+
bufferBuilder.vertex(matrix4f2, l, 100.0F, -l).texture(1.0F, 0.0F).next();
125+
bufferBuilder.vertex(matrix4f2, l, 100.0F, l).texture(1.0F, 1.0F).next();
126+
bufferBuilder.vertex(matrix4f2, -l, 100.0F, l).texture(0.0F, 1.0F).next();
127+
bufferBuilder.end();
128+
BufferRenderer.draw(bufferBuilder);
129+
l = 20.0F;
130+
MinecraftClient.getInstance().getTextureManager().bindTexture(MOON_PHASES);
131+
int s = this.world.getMoonPhase();
132+
int t = s % 4;
133+
int n = s / 4 % 2;
134+
float u = (float) (t) / 4.0F;
135+
float p = (float) (n) / 2.0F;
136+
float q = (float) (t + 1) / 4.0F;
137+
float r = (float) (n + 1) / 2.0F;
138+
bufferBuilder.begin(7, VertexFormats.POSITION_TEXTURE);
139+
bufferBuilder.vertex(matrix4f2, -l, -100.0F, l).texture(q, r).next();
140+
bufferBuilder.vertex(matrix4f2, l, -100.0F, l).texture(u, r).next();
141+
bufferBuilder.vertex(matrix4f2, l, -100.0F, -l).texture(u, p).next();
142+
bufferBuilder.vertex(matrix4f2, -l, -100.0F, -l).texture(q, p).next();
143+
bufferBuilder.end();
144+
BufferRenderer.draw(bufferBuilder);
145+
}
145146
RenderSystem.disableTexture();
146147
float v = this.world.method_23787(tickDelta) * j;
147148
if (v > 0.0F) {

src/main/java/io/github/axolotlclient/modules/hud/gui/hud/CrosshairHud.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public void render(MatrixStack matrices) {
7979
fillRect(matrices, new Rectangle(pos.x + (width / 2), pos.y + (height / 2) - 1, 5, 1), color);
8080
fillRect(matrices, new Rectangle(pos.x + (width / 2) - 1, pos.y + (height / 2) - 6, 1, 6), color);
8181
fillRect(matrices, new Rectangle(pos.x + (width / 2) - 1, pos.y + (height / 2), 1, 5), color);
82-
} else if (Objects.equals(type.get(), CrosshairOption.DIRECTION.toString())) {
82+
} /*else if (Objects.equals(type.get(), CrosshairOption.DIRECTION.toString())) {
8383
Camera camera = this.client.gameRenderer.getCamera();
8484
MatrixStack matrixStack = new MatrixStack();
8585
matrixStack.push();
@@ -91,7 +91,7 @@ public void render(MatrixStack matrices) {
9191
RenderSystem.renderCrosshair(10);
9292
matrixStack.pop();
9393
//RenderSystem.applyModelViewMatrix();
94-
} else if (Objects.equals(type.get(), CrosshairOption.TEXTURE.toString())) {
94+
}*/ else if (Objects.equals(type.get(), CrosshairOption.TEXTURE.toString())) {
9595
MinecraftClient.getInstance().getTextureManager().bindTexture(DrawableHelper.GUI_ICONS_TEXTURE);
9696

9797
// Draw crosshair
@@ -123,7 +123,7 @@ public void render(MatrixStack matrices) {
123123
}
124124
}
125125
}
126-
if (this.client.options.attackIndicator == AttackIndicator.CROSSHAIR) {
126+
if (!type.get().equalsIgnoreCase(CrosshairOption.TEXTURE.toString()) && this.client.options.attackIndicator == AttackIndicator.CROSSHAIR) {
127127
float progress = this.client.player.getAttackCooldownProgress(0.0F);
128128
if (progress != 1.0F) {
129129
fill(matrices.peek().getModel(), pos.x + (width / 2F) - 6, pos.y + (height / 2F) + 9, 11, 1,
@@ -218,7 +218,7 @@ public enum CrosshairOption{
218218
CROSS,
219219
DOT,
220220
TEXTURE,
221-
DIRECTION
221+
//DIRECTION
222222
}
223223

224224
}

src/main/java/io/github/axolotlclient/modules/sky/FSBSkyboxInstance.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ public void renderSkybox(MatrixStack matrices) {
8686
bufferBuilder.vertex(matrix4f, -100, -100, 100).texture(0F, 1F).color(1F, 1F, 1F, alpha).next();
8787
bufferBuilder.vertex(matrix4f, 100, -100, 100).texture(1F, 1F).color(1F, 1F, 1F, alpha).next();
8888
bufferBuilder.vertex(matrix4f, 100, -100, -100).texture(1F, 0F).color(1F, 1F, 1F, alpha).next();
89+
bufferBuilder.end();
8990
BufferRenderer.draw(bufferBuilder);
9091

9192
matrices.pop();

src/main/java/io/github/axolotlclient/modules/sky/MCPSkyboxInstance.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import com.mojang.blaze3d.platform.GlStateManager;
55
import com.mojang.blaze3d.systems.RenderSystem;
66
import net.minecraft.client.render.BufferBuilder;
7+
import net.minecraft.client.render.BufferRenderer;
78
import net.minecraft.client.render.Tessellator;
89
import net.minecraft.client.render.VertexFormats;
910
import net.minecraft.client.util.math.MatrixStack;
@@ -80,13 +81,14 @@ public void renderSkybox(MatrixStack matrices) {
8081
}
8182

8283
Matrix4f matrix4f = matrices.peek().getModel();
83-
bufferBuilder.begin(7, VertexFormats.POSITION_COLOR_TEXTURE);
84+
bufferBuilder.begin(7, VertexFormats.POSITION_TEXTURE_COLOR);
8485
bufferBuilder.vertex(matrix4f, -100, -100, -100).texture(u, v).color(1F, 1F, 1F, alpha).next();
8586
bufferBuilder.vertex(matrix4f, -100, -100, 100).texture(u, v+0.5F).color(1F, 1F, 1F, alpha).next();
8687
bufferBuilder.vertex(matrix4f, 100, -100, 100).texture(u+1/3F, v+0.5F).color(1F, 1F, 1F, alpha).next();
8788
bufferBuilder.vertex(matrix4f, 100, -100, -100).texture(u+1/3F, v).color(1F, 1F, 1F, alpha).next();
8889

89-
tessellator.draw();
90+
bufferBuilder.end();
91+
BufferRenderer.draw(bufferBuilder);
9092
matrices.pop();
9193
}
9294
}

0 commit comments

Comments
 (0)