Skip to content

Commit

Permalink
Fix some bad formatting and remove english translation key from the r…
Browse files Browse the repository at this point in the history
…ussian translation file
  • Loading branch information
Sollace committed Dec 11, 2022
1 parent 8058906 commit 93c916e
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 26 deletions.
7 changes: 3 additions & 4 deletions src/main/java/com/tamaized/voidfog/FogParticleSpawner.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ public void update(World world, Entity entity, Voidable dimension) {
float entityDelta = Math.max(0, Math.min(1, (1 - (entityAltitude - fadeEnd) / fadeOffset)));

for (int pass = 0; (pass < VoidFog.config.voidParticleDensity * entityDelta); pass++) {
if(entityAltitude <= fadeStart) {
if (entityAltitude <= fadeStart) {
BlockPos pos = randomPos(rand).subtract(randomPos(rand)).add(playerPos);
BlockState state = world.getBlockState(pos);

if (state.isAir() && world.getFluidState(pos).isEmpty() && pos.getY() - world.getBottomY() <= fadeStart) {
if (rand.nextInt(8 * ((!VoidFog.config.scaleWithDifficulty) ? 1 : (world.getDifficulty().getId() + 1))) <= fadeStart) {
boolean nearBedrock = dimension.isNearBedrock(pos, world);
Expand All @@ -46,8 +46,7 @@ public void update(World world, Entity entity, Voidable dimension) {
0);
}
}
}
else break;
} else break;
}
}
}
Expand Down
10 changes: 4 additions & 6 deletions src/main/java/com/tamaized/voidfog/FogRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,22 +46,20 @@ public void render(Camera camera, FogType type, float viewDistance, boolean thi

distance = MathHelper.lerp(delta / (distance > lastFogDistance ? 20 : 2), lastFogDistance, distance);
lastFogDistance = distance;

float entityAltitude = (float)getAltitude(voidable, world, entity);
int fadeStart = VoidFog.config.maxFogHeight;
float fadeOffset = VoidFog.config.fadeStartOffset;
float fadeEnd = fadeStart - fadeOffset;
float entityDelta = Math.max(0, Math.min(1, (1 - (entityAltitude - fadeEnd) / fadeOffset)));

if((entityAltitude <= fadeEnd) || (VoidFog.config.prettyFog)) {
if (entityAltitude <= fadeEnd || VoidFog.config.prettyFog) {
RenderSystem.setShaderFogStart(getFogStart(distance, type, world, thickFog));
RenderSystem.setShaderFogEnd(getFogEnd(distance, type, world, thickFog));
}
else if((entityAltitude <= fadeStart) && (!VoidFog.config.prettyFog)) {
} else if (entityAltitude <= fadeStart && !VoidFog.config.prettyFog) {
RenderSystem.setShaderFogStart(MathHelper.lerp(entityDelta, RenderSystem.getShaderFogStart(), getFogStart(distance, type, world, thickFog)));
RenderSystem.setShaderFogEnd(MathHelper.lerp(entityDelta, RenderSystem.getShaderFogEnd(), getFogEnd(distance, type, world, thickFog)));
}
else {
} else {
RenderSystem.setShaderFogStart(RenderSystem.getShaderFogStart());
RenderSystem.setShaderFogEnd(RenderSystem.getShaderFogEnd());
}
Expand Down
30 changes: 15 additions & 15 deletions src/main/java/com/tamaized/voidfog/VoidFog.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,25 +29,25 @@ public void onInitializeClient() {
}

private void onTick(MinecraftClient client) {
if (!client.isPaused() && client.world != null && client.getCameraEntity() != null) {
if (config.enabled) {
Voidable dimension = Voidable.of(client.world);
if (!config.enabled || client.isPaused() || client.world == null || client.getCameraEntity() == null) {
return;
}

Voidable dimension = Voidable.of(client.world);

Entity entity = client.getCameraEntity();
if (entity.hasVehicle()) {
entity = entity.getRootVehicle();
}
Entity entity = client.getCameraEntity();
if (entity.hasVehicle()) {
entity = entity.getRootVehicle();
}

if (!dimension.hasDepthFog(entity, client.world)) {
return;
}
if (!dimension.hasDepthFog(entity, client.world)) {
return;
}

PARTICLE_SPAWNER.update(client.world, entity, dimension);
PARTICLE_SPAWNER.update(client.world, entity, dimension);

if (config.imABigBoi) {
INSANITY.update(client.world, entity, dimension);
}
}
if (config.imABigBoi) {
INSANITY.update(client.world, entity, dimension);
}
}
}
1 change: 0 additions & 1 deletion src/main/resources/assets/voidfog/lang/ru_ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"menu.voidfog.title": "Параметры тумана пустоты",
"menu.voidfog.enabled": "Включить туман",
"menu.voidfog.creative": "Отключить в креативе",
"menu.voidfog.scale": "Scale With Difficulty",
"menu.voidfog.torches": "Спрятаться в освещенных местах",
"menu.voidfog.particles.min": "Без частиц",
"menu.voidfog.particles.max": "ВСЕ частицы",
Expand Down

0 comments on commit 93c916e

Please sign in to comment.