Showing with 17,900 additions and 324 deletions.
  1. +1 −1 README.md
  2. +1 −1 common/src/main/java/me/cominixo/betterf3/config/gui/modules/AddModuleScreen.java
  3. +20 −4 common/src/main/java/me/cominixo/betterf3/mixin/DebugMixin.java
  4. +3 −1 common/src/main/java/me/cominixo/betterf3/mixin/autof3/AutomaticDebugMixin.java
  5. +25 −1 common/src/main/java/me/cominixo/betterf3/modules/BaseModule.java
  6. +66 −57 common/src/main/java/me/cominixo/betterf3/modules/LocationModule.java
  7. +34 −32 common/src/main/java/me/cominixo/betterf3/modules/MiscRightModule.java
  8. +48 −6 common/src/main/java/me/cominixo/betterf3/modules/SystemModule.java
  9. +2 −2 common/src/main/java/me/cominixo/betterf3/modules/TargetModule.java
  10. +20 −0 common/src/main/java/me/cominixo/betterf3/utils/Utils.java
  11. +218 −0 common/src/main/resources/assets/betterf3/lang/af_za.json
  12. +218 −0 common/src/main/resources/assets/betterf3/lang/ar_sa.json
  13. +218 −0 common/src/main/resources/assets/betterf3/lang/ast_es.json
  14. +218 −0 common/src/main/resources/assets/betterf3/lang/az_az.json
  15. +218 −0 common/src/main/resources/assets/betterf3/lang/ba_ru.json
  16. +218 −0 common/src/main/resources/assets/betterf3/lang/be_by.json
  17. +218 −0 common/src/main/resources/assets/betterf3/lang/bg.json
  18. +218 −0 common/src/main/resources/assets/betterf3/lang/bn.json
  19. +218 −0 common/src/main/resources/assets/betterf3/lang/br.json
  20. +218 −0 common/src/main/resources/assets/betterf3/lang/bs.json
  21. +218 −0 common/src/main/resources/assets/betterf3/lang/ca_es.json
  22. +218 −0 common/src/main/resources/assets/betterf3/lang/cs_cz.json
  23. +218 −0 common/src/main/resources/assets/betterf3/lang/cy_gb.json
  24. +218 −0 common/src/main/resources/assets/betterf3/lang/da_dk.json
  25. +1 −0 common/src/main/resources/assets/betterf3/lang/de_at.json
  26. +1 −0 common/src/main/resources/assets/betterf3/lang/de_ch.json
  27. +1 −0 common/src/main/resources/assets/betterf3/lang/de_de.json
  28. +218 −0 common/src/main/resources/assets/betterf3/lang/el_gr.json
  29. +218 −0 common/src/main/resources/assets/betterf3/lang/en_au.json
  30. +218 −0 common/src/main/resources/assets/betterf3/lang/en_ca.json
  31. +218 −0 common/src/main/resources/assets/betterf3/lang/en_gb.json
  32. +218 −0 common/src/main/resources/assets/betterf3/lang/en_nz.json
  33. +218 −0 common/src/main/resources/assets/betterf3/lang/en_pt.json
  34. +1 −0 common/src/main/resources/assets/betterf3/lang/en_ud.json
  35. +1 −0 common/src/main/resources/assets/betterf3/lang/en_us.json
  36. +218 −0 common/src/main/resources/assets/betterf3/lang/eo_uy.json
  37. +1 −0 common/src/main/resources/assets/betterf3/lang/es_ar.json
  38. +1 −0 common/src/main/resources/assets/betterf3/lang/es_cl.json
  39. +1 −0 common/src/main/resources/assets/betterf3/lang/es_ec.json
  40. +1 −0 common/src/main/resources/assets/betterf3/lang/es_es.json
  41. +1 −0 common/src/main/resources/assets/betterf3/lang/es_mx.json
  42. +1 −0 common/src/main/resources/assets/betterf3/lang/es_uy.json
  43. +1 −0 common/src/main/resources/assets/betterf3/lang/es_ve.json
  44. +218 −0 common/src/main/resources/assets/betterf3/lang/et_ee.json
  45. +218 −0 common/src/main/resources/assets/betterf3/lang/eu_es.json
  46. +218 −0 common/src/main/resources/assets/betterf3/lang/fa_ir.json
  47. +1 −0 common/src/main/resources/assets/betterf3/lang/fi_fi.json
  48. +218 −0 common/src/main/resources/assets/betterf3/lang/fil_ph.json
  49. +218 −0 common/src/main/resources/assets/betterf3/lang/fo_fo.json
  50. +1 −0 common/src/main/resources/assets/betterf3/lang/fr_ca.json
  51. +1 −0 common/src/main/resources/assets/betterf3/lang/fr_fr.json
  52. +218 −0 common/src/main/resources/assets/betterf3/lang/fra_de.json
  53. +218 −0 common/src/main/resources/assets/betterf3/lang/fur.json
  54. +218 −0 common/src/main/resources/assets/betterf3/lang/fy_nl.json
  55. +218 −0 common/src/main/resources/assets/betterf3/lang/ga_ie.json
  56. +218 −0 common/src/main/resources/assets/betterf3/lang/gd_gb.json
  57. +218 −0 common/src/main/resources/assets/betterf3/lang/gl_es.json
  58. +218 −0 common/src/main/resources/assets/betterf3/lang/haw_us.json
  59. +1 −0 common/src/main/resources/assets/betterf3/lang/he_il.json
  60. +218 −0 common/src/main/resources/assets/betterf3/lang/hi_in.json
  61. +218 −0 common/src/main/resources/assets/betterf3/lang/hu_hu.json
  62. +218 −0 common/src/main/resources/assets/betterf3/lang/hy_am.json
  63. +218 −0 common/src/main/resources/assets/betterf3/lang/id_id.json
  64. +218 −0 common/src/main/resources/assets/betterf3/lang/ig_ng.json
  65. +218 −0 common/src/main/resources/assets/betterf3/lang/io_en.json
  66. +218 −0 common/src/main/resources/assets/betterf3/lang/is_is.json
  67. +1 −0 common/src/main/resources/assets/betterf3/lang/it_it.json
  68. +8 −7 common/src/main/resources/assets/betterf3/lang/ja_jp.json
  69. +218 −0 common/src/main/resources/assets/betterf3/lang/jbo_en.json
  70. +218 −0 common/src/main/resources/assets/betterf3/lang/ka_ge.json
  71. +218 −0 common/src/main/resources/assets/betterf3/lang/kk_kz.json
  72. +218 −0 common/src/main/resources/assets/betterf3/lang/kn_in.json
  73. +80 −79 common/src/main/resources/assets/betterf3/lang/ko_kr.json
  74. +218 −0 common/src/main/resources/assets/betterf3/lang/ku.json
  75. +218 −0 common/src/main/resources/assets/betterf3/lang/la_la.json
  76. +218 −0 common/src/main/resources/assets/betterf3/lang/lb_lu.json
  77. +218 −0 common/src/main/resources/assets/betterf3/lang/li_li.json
  78. +218 −0 common/src/main/resources/assets/betterf3/lang/lol_us.json
  79. +218 −0 common/src/main/resources/assets/betterf3/lang/lt_lt.json
  80. +218 −0 common/src/main/resources/assets/betterf3/lang/lv_lv.json
  81. +218 −0 common/src/main/resources/assets/betterf3/lang/mk_mk.json
  82. +218 −0 common/src/main/resources/assets/betterf3/lang/mn_mn.json
  83. +218 −0 common/src/main/resources/assets/betterf3/lang/ms_my.json
  84. +218 −0 common/src/main/resources/assets/betterf3/lang/mt_mt.json
  85. +218 −0 common/src/main/resources/assets/betterf3/lang/nds_de.json
  86. +218 −0 common/src/main/resources/assets/betterf3/lang/nl_be.json
  87. +218 −0 common/src/main/resources/assets/betterf3/lang/nl_nl.json
  88. +218 −0 common/src/main/resources/assets/betterf3/lang/nn_no.json
  89. +218 −0 common/src/main/resources/assets/betterf3/lang/no_no.json
  90. +218 −0 common/src/main/resources/assets/betterf3/lang/oc_fr.json
  91. +1 −0 common/src/main/resources/assets/betterf3/lang/pl_pl.json
  92. +1 −0 common/src/main/resources/assets/betterf3/lang/pt_br.json
  93. +218 −0 common/src/main/resources/assets/betterf3/lang/pt_pt.json
  94. +218 −0 common/src/main/resources/assets/betterf3/lang/qya_aa.json
  95. +218 −0 common/src/main/resources/assets/betterf3/lang/ro_ro.json
  96. +24 −23 common/src/main/resources/assets/betterf3/lang/ru_ru.json
  97. +218 −0 common/src/main/resources/assets/betterf3/lang/se_no.json
  98. +218 −0 common/src/main/resources/assets/betterf3/lang/sk_sk.json
  99. +218 −0 common/src/main/resources/assets/betterf3/lang/sl_si.json
  100. +218 −0 common/src/main/resources/assets/betterf3/lang/so_so.json
  101. +218 −0 common/src/main/resources/assets/betterf3/lang/sq_al.json
  102. +1 −0 common/src/main/resources/assets/betterf3/lang/sr_sp.json
  103. +218 −0 common/src/main/resources/assets/betterf3/lang/sv_se.json
  104. +218 −0 common/src/main/resources/assets/betterf3/lang/ta_in.json
  105. +218 −0 common/src/main/resources/assets/betterf3/lang/th_th.json
  106. +218 −0 common/src/main/resources/assets/betterf3/lang/tl_ph.json
  107. +218 −0 common/src/main/resources/assets/betterf3/lang/tlh_aa.json
  108. +34 −33 common/src/main/resources/assets/betterf3/lang/tr_tr.json
  109. +1 −0 common/src/main/resources/assets/betterf3/lang/tt_ru.json
  110. +7 −6 common/src/main/resources/assets/betterf3/lang/uk_ua.json
  111. +218 −0 common/src/main/resources/assets/betterf3/lang/val_es.json
  112. +218 −0 common/src/main/resources/assets/betterf3/lang/vec_it.json
  113. +218 −0 common/src/main/resources/assets/betterf3/lang/vi_vn.json
  114. +218 −0 common/src/main/resources/assets/betterf3/lang/yi_de.json
  115. +218 −0 common/src/main/resources/assets/betterf3/lang/yo_ng.json
  116. +1 −0 common/src/main/resources/assets/betterf3/lang/zh_cn.json
  117. +218 −0 common/src/main/resources/assets/betterf3/lang/zh_hk.json
  118. +1 −0 common/src/main/resources/assets/betterf3/lang/zh_tw.json
  119. +2 −0 common/src/main/resources/betterf3.accesswidener
  120. +15 −0 docs/changelogs/4.0.0.md
  121. +2 −2 fabric/build.gradle
  122. +8 −0 fabric/src/main/java/me/cominixo/betterf3/BetterF3Fabric.java
  123. +2 −0 fabric/src/main/resources/betterf3.accesswidener
  124. +3 −2 forge/build.gradle
  125. +7 −0 forge/src/main/java/me/treyruffy/betterf3/BetterF3Forge.java
  126. +22 −0 forge/src/main/java/me/treyruffy/betterf3/mixin/ForgeGuiMixin.java
  127. +2 −0 forge/src/main/resources/META-INF/accesstransformer.cfg
  128. +1 −3 gradle.properties
  129. +0 −64 update.json
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div style="text-align: center;"><h1 >BetterF3</h1>
<br />

[![Version](https://img.shields.io/badge/dynamic/json?color=ed37aa&label=Version&query=%24%5B%27promos%27%5D%5B%271.19-latest%27%5D&url=https%3A%2F%2Fraw.githubusercontent.com%2Fcominixo%2FBetterF3%2Farchitectury%2F1.19%2Fupdate.json?cacheSeconds=2592000)](https://www.curseforge.com/minecraft/mc-mods/betterf3/files)
[![Version](https://img.shields.io/badge/dynamic/json?color=ed37aa&label=Version&query=%24%5B%27promos%27%5D%5B%271.19.2-latest%27%5D&url=https%3A%2F%2Fapi.modrinth.com%2Fupdates%2Fbetterf3%2Fforge%5Fupdates.json?cacheSeconds=2592000)](https://www.curseforge.com/minecraft/mc-mods/betterf3/files)
[![Minecraft Versions](https://img.shields.io/badge/Minecraft-1.16.2--1.19+-9450cc)](http://files.minecraftforge.net/)
[![License: MIT](https://img.shields.io/badge/License-MIT-2230f2.svg)](https://github.com/cominixo/BetterF3/blob/architectury/1.19/LICENSE.txt)
<br/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public static ConfigBuilder configBuilder(final ModulesScreen parent) {
"config.betterf3.add_button.module_name"),
DropdownMenuBuilder.TopCellElementBuilder.of(new EmptyModule(true),
BaseModule::module,
object -> Text.translatable(object.toString()))).setSelections(BaseModule.allModules)
object -> Text.translatable(object.toString()))).setSelections(BaseModule.distinctModules())
.setSaveConsumer((BaseModule newValue) -> {
try {
parent.modulesListWidget.addModule(newValue.getClass().getDeclaredConstructor().newInstance());
Expand Down
24 changes: 20 additions & 4 deletions common/src/main/java/me/cominixo/betterf3/mixin/DebugMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

import static me.cominixo.betterf3.utils.Utils.START_X_POS;
Expand Down Expand Up @@ -206,16 +207,16 @@ public VertexConsumerProvider.Immediate immediate(final PositionEnum pos, final
windowWidth += xPos;
}

x1 = 1 + windowWidth;
x2 = windowWidth + width;
x1 = windowWidth - 1;
x2 = windowWidth + width + 1;
} else {
windowWidth = 2;

if (GeneralOptions.enableAnimations) {
windowWidth -= xPos;
}
x1 = windowWidth - 1;
x2 = width + 3 + windowWidth;
x2 = width + 1 + windowWidth;
}
y1 = y - 1;
y2 = y + height - 1;
Expand Down Expand Up @@ -284,6 +285,18 @@ public void renderLeftText(final MatrixStack matrixStack, final CallbackInfo ci)
ci.cancel();
}

/**
* Disables the unneeded math for allocation rate.
*
* @param instance the allocation rate calculator
* @param allocatedBytes the allocated bytes
* @return nothing
*/
@Redirect(method = "getRightText", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/hud/DebugHud$AllocationRateCalculator;get(J)J"))
public long allocationRateCalculatorGet(final DebugHud.AllocationRateCalculator instance, final long allocatedBytes) {
return 0;
}

/**
* Ensures that the TPS graph works.
*
Expand All @@ -292,8 +305,11 @@ public void renderLeftText(final MatrixStack matrixStack, final CallbackInfo ci)
*/
@Inject(method = "render", at = @At(value = "HEAD"))
public void renderBefore(final MatrixStack matrices, final CallbackInfo ci) {
if (GeneralOptions.disableMod) {
return;
}
matrices.push();
if (this.client.options.debugTpsEnabled) {
if (this.client.options.debugTpsEnabled && this.client.world != null) {
final int scaledWidth = this.client.getWindow().getScaledWidth();
this.drawMetricsData(matrices, this.client.getMetricsData(), 0, scaledWidth / 2, true);
final IntegratedServer integratedServer = this.client.getServer();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@
public class AutomaticDebugMixin {

@Redirect(method = "clear", at = @At(value = "FIELD", target = "Lnet/minecraft/client/option/GameOptions;debugEnabled:Z", opcode = Opcodes.PUTFIELD))
private void removeDebugCrosshair(final GameOptions instance, final boolean value) {
private void automaticF3(final GameOptions instance, final boolean value) {
if (!GeneralOptions.disableMod) {
if (GeneralOptions.autoF3) {
instance.debugEnabled = true;
instance.debugProfilerEnabled = false;
instance.debugTpsEnabled = false;
return;
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package me.cominixo.betterf3.modules;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Optional;
import java.util.TreeSet;
import me.cominixo.betterf3.utils.DebugLine;
import me.cominixo.betterf3.utils.DebugLineList;
import me.cominixo.betterf3.utils.PositionEnum;
Expand All @@ -14,7 +16,7 @@
/**
* The Base module.
*/
public abstract class BaseModule {
public abstract class BaseModule implements Comparable<BaseModule> {

/**
* The color of the tag.
Expand Down Expand Up @@ -204,4 +206,26 @@ public void enabled(final boolean enabled) {
* @param client the Minecraft client
*/
public abstract void update(MinecraftClient client);

/**
* Gets a set of the modules.
*
* @return distinct modules
*/
public static TreeSet<BaseModule> distinctModules() {
final HashSet<String> distinctModules = new HashSet<>(allModules.stream().map(BaseModule::toString).distinct().toList());
final TreeSet<BaseModule> distinctModulesObjects = new TreeSet<>();
for (final BaseModule module : allModules) {
if (distinctModules.contains(module.toString())) {
distinctModulesObjects.add(module);
distinctModules.remove(module.toString());
}
}
return distinctModulesObjects;
}

@Override
public int compareTo(final BaseModule o) {
return this.toString().compareTo(o.toString());
}
}
123 changes: 66 additions & 57 deletions common/src/main/java/me/cominixo/betterf3/modules/LocationModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import me.cominixo.betterf3.utils.DebugLine;
import me.cominixo.betterf3.utils.Utils;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.hud.DebugHud;
import net.minecraft.client.resource.language.I18n;
import net.minecraft.entity.Entity;
import net.minecraft.server.integrated.IntegratedServer;
Expand All @@ -26,7 +27,7 @@
import net.minecraft.world.chunk.ChunkStatus;
import net.minecraft.world.chunk.WorldChunk;
import net.minecraft.world.chunk.light.LightingProvider;
import org.apache.commons.lang3.StringUtils;
import org.jetbrains.annotations.Nullable;

/**
* The Location module.
Expand Down Expand Up @@ -57,6 +58,9 @@ public LocationModule() {
lines.add(new DebugLine("slime_chunk"));
}

@Nullable
private CompletableFuture<WorldChunk> chunkFuture;

/**
* Updates the Location module.
*
Expand Down Expand Up @@ -84,84 +88,89 @@ public void update(final MinecraftClient client) {
lines.get(7).value(client.world.getRegistryManager().get(Registry.BIOME_KEY).getId(client.world.getBiome(blockPos).value()));

serverWorld = integratedServer != null ? integratedServer.getWorld(client.world.getRegistryKey()) : client.world;
if (client.world.isChunkLoaded(blockPos.getX(), blockPos.getZ())) {
final WorldChunk clientChunk = client.world.getChunk(chunkPos.x, chunkPos.z);
if (clientChunk.isEmpty()) {
chunkLightString = I18n.translate("text.betterf3.line.waiting_chunk");
} else if (serverWorld != null) {
final WorldChunk clientChunk = client.world.getChunk(chunkPos.x, chunkPos.z);
if (clientChunk.isEmpty()) {
chunkLightString = I18n.translate("text.betterf3.line.waiting_chunk");
} else if (serverWorld != null) {

// Client Chunk Lights
final int totalLight = client.world.getChunkManager().getLightingProvider().getLight(blockPos, 0);
final int skyLight = client.world.getLightLevel(LightType.SKY, blockPos);
final int blockLight = client.world.getLightLevel(LightType.BLOCK, blockPos);
chunkLightString = I18n.translate("format.betterf3.chunklight", totalLight, skyLight, blockLight);
// Client Chunk Lights
final int totalLight = client.world.getChunkManager().getLightingProvider().getLight(blockPos, 0);
final int skyLight = client.world.getLightLevel(LightType.SKY, blockPos);
final int blockLight = client.world.getLightLevel(LightType.BLOCK, blockPos);
chunkLightString = I18n.translate("format.betterf3.chunklight", totalLight, skyLight, blockLight);

// Server Chunk Lights
final LightingProvider lightingProvider = serverWorld.getChunkManager().getLightingProvider();
// Server Chunk Lights
final LightingProvider lightingProvider = serverWorld.getChunkManager().getLightingProvider();

final int skyLightServer = lightingProvider.get(LightType.SKY).getLightLevel(blockPos);
final int blockLightServer = lightingProvider.get(LightType.BLOCK).getLightLevel(blockPos);
final int skyLightServer = lightingProvider.get(LightType.SKY).getLightLevel(blockPos);
final int blockLightServer = lightingProvider.get(LightType.BLOCK).getLightLevel(blockPos);

chunkLightServerString = I18n.translate("format.betterf3.chunklight_server", skyLightServer, blockLightServer);
chunkLightServerString = I18n.translate("format.betterf3.chunklight_server", skyLightServer, blockLightServer);

// Heightmap stuff (Find the highest block)
final Heightmap.Type[] heightmapTypes = Heightmap.Type.values();
// Heightmap stuff (Find the highest block)
final Heightmap.Type[] heightmapTypes = Heightmap.Type.values();

WorldChunk serverChunk;
WorldChunk serverChunk;

if (serverWorld instanceof ServerWorld) {
final CompletableFuture<WorldChunk> chunkCompletableFuture = ((ServerWorld) serverWorld).getChunkManager().getChunkFutureSyncOnMainThread(blockPos.getX(), blockPos.getZ(), ChunkStatus.FULL, false).thenApply(either -> either.map(chunk -> (WorldChunk) chunk, unloaded -> null));
if (serverWorld instanceof ServerWorld) {
if (this.chunkFuture == null) {
this.chunkFuture =
((ServerWorld) serverWorld).getChunkManager().getChunkFutureSyncOnMainThread(chunkPos.x, chunkPos.z, ChunkStatus.FULL, false).thenApply((either) -> either.map((chunk) -> (WorldChunk) chunk, (chunk) -> null));
}

serverChunk = chunkCompletableFuture.getNow(null);
} else {
serverChunk = clientChunk;
if (this.chunkFuture == null) {
this.chunkFuture = CompletableFuture.completedFuture(clientChunk);
}

for (final Heightmap.Type type : heightmapTypes) {
serverChunk = this.chunkFuture.getNow(null);
} else {
serverChunk = clientChunk;
}

// Client
if (type.shouldSendToClient()) {
final String typeString = StringUtils.capitalize(type.getName().replace("_", " "));
final int blockY = clientChunk.sampleHeightmap(type, blockPos.getX(), blockPos.getZ());
if (blockY > -1) {
highestBlock.append(" ").append(typeString).append(": ").append(blockY);
}
for (final Heightmap.Type type : heightmapTypes) {

// Client
if (type.shouldSendToClient()) {
final String typeString = DebugHud.HEIGHT_MAP_TYPES.get(type);
final int blockY = clientChunk.sampleHeightmap(type, blockPos.getX(), blockPos.getZ());
if (blockY > -1) {
highestBlock.append(" ").append(typeString).append(": ").append(blockY);
}
}

// Server
if (type.isStoredServerSide() && serverWorld instanceof ServerWorld) {
if (serverChunk == null) {
serverChunk = clientChunk;
}
// Server
if (type.isStoredServerSide() && serverWorld instanceof ServerWorld) {
if (serverChunk == null) {
serverChunk = clientChunk;
}

final String typeString = Utils.enumToString(type);
final String typeString = DebugHud.HEIGHT_MAP_TYPES.get(type);

final int blockY = serverChunk.sampleHeightmap(type, blockPos.getX(), blockPos.getZ());
if (blockY > -1) {
highestBlockServer.append(" ").append(typeString).append(": ").append(blockY);
}
final int blockY = serverChunk.sampleHeightmap(type, blockPos.getX(), blockPos.getZ());
if (blockY > -1) {
highestBlockServer.append(" ").append(typeString).append(": ").append(blockY);
}
}
}

// Local Difficulty
if (blockPos.getY() >= 0 && blockPos.getY() < 256) {
final float moonSize;
final long inhabitedTime;
// Local Difficulty
if (blockPos.getY() >= 0 && blockPos.getY() < 256) {
final float moonSize;
final long inhabitedTime;

moonSize = serverWorld.getMoonSize();
moonSize = serverWorld.getMoonSize();

inhabitedTime = Objects.requireNonNullElse(serverChunk, clientChunk).getInhabitedTime();
inhabitedTime = Objects.requireNonNullElse(serverChunk, clientChunk).getInhabitedTime();

final LocalDifficulty localDifficulty = new LocalDifficulty(serverWorld.getDifficulty(), serverWorld.getTimeOfDay(), inhabitedTime, moonSize);
localDifficultyString = String.format("%.2f " + I18n.translate("text.betterf3.line.clamped") + ": %.2f", localDifficulty.getLocalDifficulty(), localDifficulty.getClampedLocalDifficulty());
}
final LocalDifficulty localDifficulty = new LocalDifficulty(serverWorld.getDifficulty(), serverWorld.getTimeOfDay(), inhabitedTime, moonSize);
localDifficultyString = String.format("%.2f " + I18n.translate("text.betterf3.line.clamped") + ": %.2f", localDifficulty.getLocalDifficulty(), localDifficulty.getClampedLocalDifficulty());
}

if (integratedServer != null) {
final Random slimeChunk = ChunkRandom.getSlimeRandom(chunkPos.x, chunkPos.z, ((StructureWorldAccess) serverWorld).getSeed(), 0x3ad8025fL);
slimeChunkString = String.format("%s", I18n.translate((slimeChunk.nextInt(10) == 0 ) ? "text.betterf3.line.slime_chunk.true" : "text.betterf3.line.slime_chunk.false"));
} else {
slimeChunkString = String.format("%s", I18n.translate("text.betterf3.line.slime_chunk.unknown"));
}
if (integratedServer != null) {
final Random slimeChunk = ChunkRandom.getSlimeRandom(chunkPos.x, chunkPos.z, ((StructureWorldAccess) serverWorld).getSeed(), 0x3ad8025fL);
slimeChunkString = String.format("%s", I18n.translate((slimeChunk.nextInt(10) == 0 ) ? "text.betterf3.line.slime_chunk.true" : "text.betterf3.line.slime_chunk.false"));
} else {
slimeChunkString = String.format("%s", I18n.translate("text.betterf3.line.slime_chunk.unknown"));
}
}
}
Expand Down
Loading