Skip to content

Add fr_fr #204

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: dev
Choose a base branch
from
Open
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import dev.ftb.mods.ftblibrary.ui.GuiHelper;
import dev.ftb.mods.ftblibrary.ui.Theme;
import dev.ftb.mods.ftblibrary.ui.Widget;
import net.minecraft.client.Minecraft;
import org.lwjgl.opengl.GL11;

/**
* @author LatvianModder
Expand All @@ -25,6 +27,9 @@ public void draw(PoseStack matrixStack, Theme theme, int x, int y, int w, int h)

if (region.mapImageLoaded) {
RenderSystem.bindTexture(id);
int filter = w * Minecraft.getInstance().getWindow().getGuiScale() < 512D ? GL11.GL_LINEAR : GL11.GL_NEAREST;
RenderSystem.texParameter(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, filter);
RenderSystem.texParameter(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, filter);
GuiHelper.drawTexturedRect(matrixStack, x, y, w, h, Color4I.WHITE, 0F, 0F, 1F, 1F);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ public class ChunkUpdateTask implements MapTask, BiomeManager.NoiseBiomeSource {
public final long biomeZoomSeed;
public final int[] blocksToUpdate;
private final long taskStartTime;
private final int[] currentWaterY;

public ChunkUpdateTask(@Nullable MapManager m, Level w, ChunkAccess ca, ChunkPos p, @Nullable ChunkBiomeContainer b, long zs, int[] s) {
manager = m;
Expand All @@ -54,7 +53,6 @@ public ChunkUpdateTask(@Nullable MapManager m, Level w, ChunkAccess ca, ChunkPos
biomeZoomSeed = zs;
blocksToUpdate = s;
taskStartTime = System.currentTimeMillis();
currentWaterY = new int[]{HeightUtils.UNKNOWN};
}

@Override
Expand Down Expand Up @@ -110,9 +108,9 @@ public void runMapTask() throws Exception {
for (int wi : blocksToUpdate) {
int wx = wi % 16;
int wz = wi / 16;
blockPos.set(blockX + wx, chunkAccess.getHeight(Heightmap.Types.MOTION_BLOCKING, blockX + wx, blockZ + wz), blockZ + wz);
int height = Mth.clamp(HeightUtils.getHeight(level, chunkAccess, blockPos, currentWaterY).getY(), Short.MIN_VALUE, Short.MAX_VALUE);
blockPos.setY(height);
blockPos.set(blockX + wx, chunkAccess.getHeight(Heightmap.Types.MOTION_BLOCKING, blockX + wx, blockZ + wz) + 2, blockZ + wz);
int waterY = Mth.clamp(HeightUtils.getHeight(level, chunkAccess, blockPos), Short.MIN_VALUE, Short.MAX_VALUE);
int height = blockPos.getY();
BlockState state = chunkAccess.getBlockState(blockPos);

int ax = mapChunk.pos.x * 16 + wx;
Expand All @@ -123,10 +121,10 @@ public void runMapTask() throws Exception {
int blockIndex0 = data.getBlockIndex(index);
int height0 = data.height[index]; // Get old height

blockPos.setY(currentWaterY[0] == HeightUtils.UNKNOWN ? height : currentWaterY[0]);
blockPos.setY(waterY == HeightUtils.UNKNOWN ? height : waterY);

int waterLightAndBiome = (waterLightAndBiome0 & 0b111_11111111); // Clear water and light bits
waterLightAndBiome |= (currentWaterY[0] != HeightUtils.UNKNOWN) ? (1 << 15) : 0; // Water
waterLightAndBiome |= (waterY != HeightUtils.UNKNOWN) ? (1 << 15) : 0; // Water
waterLightAndBiome |= (level.getBrightness(LightLayer.BLOCK, blockPos) & 15) << 11; // Light

ResourceLocation id = FTBChunks.BLOCK_REGISTRY.getId(state.getBlock());
Expand Down Expand Up @@ -160,8 +158,6 @@ public void runMapTask() throws Exception {
data.setBlockIndex(index, blockIndex);
changed = true;
}

currentWaterY[0] = HeightUtils.UNKNOWN;
}

if (changed) {
Expand Down
19 changes: 10 additions & 9 deletions common/src/main/java/dev/ftb/mods/ftbchunks/data/HeightUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,17 @@ public static boolean skipBlock(BlockState state) {
return state.isAir() || FTBChunks.PROXY.skipBlock(state);
}

public static BlockPos.MutableBlockPos getHeight(Level level, @Nullable ChunkAccess chunkAccess, BlockPos.MutableBlockPos pos, int[] currentWaterY) {
public static int getHeight(Level level, @Nullable ChunkAccess chunkAccess, BlockPos.MutableBlockPos pos) {
if (chunkAccess == null) {
return pos;
return UNKNOWN;
}

int bottomY = 0;
int topY = pos.getY();
boolean hasCeiling = level.dimensionType().hasCeiling();
int currentWaterY = UNKNOWN;

outer:
for (int by = topY; by >= bottomY; by--) {
pos.setY(by);
BlockState state = chunkAccess.getBlockState(pos);
Expand All @@ -43,25 +45,24 @@ public static BlockPos.MutableBlockPos getHeight(Level level, @Nullable ChunkAcc
pos.setY(by);
state = chunkAccess.getBlockState(pos);

if (state.isAir()) {
break;
if (skipBlock(state)) {
continue outer;
}
}
}

boolean water = isWater(state);

if (water && currentWaterY[0] == UNKNOWN) {
currentWaterY[0] = by;
if (water && currentWaterY == UNKNOWN) {
currentWaterY = by;
}

if (!water && !skipBlock(state)) {
pos.setY(by);
return pos;
return currentWaterY;
}
}

pos.setY(UNKNOWN);
return pos;
return UNKNOWN;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,20 +74,19 @@ public void handle(NetworkManager.PacketContext context) {
return;
}

BlockPos.MutableBlockPos blockPos = new BlockPos.MutableBlockPos(x, topY, z);
int[] water = new int[]{HeightUtils.UNKNOWN};
y1 = HeightUtils.getHeight(level, chunkAccess, blockPos, water).getY();
BlockPos.MutableBlockPos blockPos = new BlockPos.MutableBlockPos(x, topY + 2, z);
int water = HeightUtils.getHeight(level, chunkAccess, blockPos);

if (y1 == HeightUtils.UNKNOWN) {
y1 = 70;
if (blockPos.getY() == HeightUtils.UNKNOWN) {
blockPos.setY(70);
} else if (water != HeightUtils.UNKNOWN) {
blockPos.setY(Math.max(blockPos.getY(), water));
}

if (water[0] != HeightUtils.UNKNOWN) {
y1 = Math.max(y1, water[0]);
}
y1 = blockPos.getY() + 1;
}

p.teleportTo(level, x + 0.5D, y1 + 2.1D, z + 0.5D, p.yRot, p.xRot);
p.teleportTo(level, x + 0.5D, y1 + 0.1D, z + 0.5D, p.yRot, p.xRot);
}
}
}
76 changes: 76 additions & 0 deletions common/src/main/resources/assets/ftbchunks/lang/fr_fr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
"ftbchunks": "FTB Chunks",
"ftbchunks.noise": "Brouillage",
"ftbchunks.shadows": "Ombres",
"ftbchunks.chunk_grid": "Quadrillage",
"ftbchunks.reduced_color_palette": "Plaette de couleurs réduite",
"ftbchunks.saturation": "Saturation",
"ftbchunks.debug_info": "Infos de débug",
"ftbchunks.claimed_chunks_on_map": "Montrer les chunks revendiqués sur la carte",
"ftbchunks.own_claimed_chunks_on_map": "Montrer vos chunks revendiqué sur la carte",
"ftbchunks.in_world_waypoints": "Montrer les balises",
"ftbchunks.death_waypoints": "Créer une balise lorsque vous mourrez",
"ftbchunks.map_mode": "Mode carte",
"ftbchunks.waypoint_fade_distance": "Distance d'affichage des balises",
"ftbchunks.biome_blend": "Mélange de biomes",
"ftbchunks.biome_blend.none": "Aucun (Plus rapide)",
"ftbchunks.biome_blend.blend_3x3": "Mélange 3x3",
"ftbchunks.biome_blend.blend_5x5": "Mélange 5x5",
"ftbchunks.biome_blend.blend_7x7": "Mélange 7x7",
"ftbchunks.biome_blend.blend_9x9": "Mélange 9x9",
"ftbchunks.biome_blend.blend_11x11": "Mélange 11x11",
"ftbchunks.biome_blend.blend_13x13": "Mélange 13x13",
"ftbchunks.biome_blend.blend_15x15": "Mélange 15x15 (Plus lent)",
"ftbchunks.water_height_factor": "Facteur de hauteur de l'eau",
"ftbchunks.only_surface_entities": "Seulement entités en surface",
"ftbchunks.experimental_performance_improvement": "Amélioration expérimentale de performance",
"ftbchunks.minimap": "Carte",
"ftbchunks.minimap.enabled": "Activée",
"ftbchunks.minimap.position": "Position",
"ftbchunks.minimap.position.bottom_left": "En bas à gauche",
"ftbchunks.minimap.position.left": "À gauche",
"ftbchunks.minimap.position.top_left": "En haut à gauche",
"ftbchunks.minimap.position.top_right": "En haut à droite",
"ftbchunks.minimap.position.right": "À droite",
"ftbchunks.minimap.position.bottom_right": "En bas à droite",
"ftbchunks.minimap.scale": "Échelle",
"ftbchunks.minimap.locked_north": "Verrouillé au nord",
"ftbchunks.minimap.waypoints": "Balises",
"ftbchunks.minimap.entities": "Entités",
"ftbchunks.minimap.entity_heads": "Tête des entités",
"ftbchunks.minimap.player_heads": "Tête des joueurs",
"ftbchunks.minimap.large_entities": "Grandes entités",
"ftbchunks.minimap.zoom": "Zoom",
"ftbchunks.minimap.xyz": "XYZ",
"ftbchunks.minimap.biome": "Biome",
"ftbchunks.minimap.blur_mode": "Mode flou",
"ftbchunks.minimap.blur_mode.auto": "Auto",
"ftbchunks.minimap.blur_mode.on": "Activé",
"ftbchunks.minimap.blur_mode.off": "Désactivé",
"ftbchunks.minimap.compass": "Boussole",
"ftbchunks.minimap.visibility": "Visibilité",
"ftbchunks.minimap.zone": "Zone",
"sidebar_button.ftbchunks.chunks": "Chunks",
"key.ftbchunks.map": "Ouvrir carte des Chunks",
"key.ftbchunks.minimap.zoomIn": "Zoom de la carte",
"key.ftbchunks.minimap.zoomOut": "Dézoom de la carte",
"wilderness": "Non revendiqué",
"ftbchunks.no_server_mod": "FTB Chunks requiert le mod sur le serveur !",
"ftbchunks.already_claimed": "Ce chunk est déjà revendiqué par %s.",
"ftbchunks.gui.claimed": "Revendiqué",
"ftbchunks.gui.force_loaded": "Chargé en permanence",
"ftbchunks.gui.allies": "Alliés",
"ftbchunks.gui.ally_whitelist": "Whitelist alliés",
"ftbchunks.gui.ally_blacklist": "Blacklist alliés",
"ftbchunks.gui.large_map": "Grande Carte",
"ftbchunks.gui.claimed_chunks": "Chunks revendiqués",
"ftbchunks.gui.waypoints": "Balises",
"ftbchunks.gui.add_waypoint": "Ajouter balise",
"ftbchunks.gui.settings": "Réglages",
"ftbchunks.gui.sync": "Partager carte avec vos alliés",
"ftbteamsconfig.ftbchunks.allow_fake_players": "Autoriser les faux joueurs",
"ftbteamsconfig.ftbchunks.block_edit_mode": "Mode éditeur de blocs",
"ftbteamsconfig.ftbchunks.block_interact_mode": "Mode interaction de blocs",
"ftbteamsconfig.ftbchunks.minimap_mode": "Mode carte",
"ftbteamsconfig.ftbchunks.location_mode": "Mode emplacement"
}