Skip to content

Commit

Permalink
Use root locale for case conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
hlysine committed Jul 26, 2024
1 parent 72241c0 commit d2a3fc8
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import net.minecraft.world.level.block.state.properties.IntegerProperty;
import org.jetbrains.annotations.NotNull;

import java.util.Locale;

import static com.copycatsplus.copycats.foundation.copycat.CopycatBaseBlock.BASE_TYPE_COUNT;

public class CCBlockStateProperties {
Expand All @@ -27,7 +29,7 @@ public Side getOpposite() {

@Override
public @NotNull String getSerializedName() {
return name().toLowerCase();
return name().toLowerCase(Locale.ROOT);
}
}

Expand All @@ -40,7 +42,7 @@ public enum VerticalStairShape implements StringRepresentable {

@Override
public @NotNull String getSerializedName() {
return name().toLowerCase();
return name().toLowerCase(Locale.ROOT);
}

public boolean isOuter() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import net.minecraft.util.StringRepresentable;
import org.jetbrains.annotations.NotNull;

import java.util.Locale;

public enum FeatureCategory implements StringRepresentable {
SLOPES("All copycats with a sloped surface"),
MULTISTATES("All copycats that support multiple materials in a single block"),
Expand All @@ -24,7 +26,7 @@ public String getDescription() {

@Override
public @NotNull String getSerializedName() {
return this.name().toLowerCase();
return this.name().toLowerCase(Locale.ROOT);
}

public static FeatureCategory byName(String name) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ private static Direction propertyToDirection(String property) {
}

public static String directionToProperty(Direction direction) {
return direction.getName().toLowerCase();
return direction.getName().toLowerCase(Locale.ROOT);
}

private BlockState mapDirections(BlockState pState, Function<Direction, Direction> pDirectionalFunction) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;

import static com.copycatsplus.copycats.foundation.copycat.model.assembly.CopycatRenderContext.*;
Expand All @@ -33,7 +34,7 @@ public void emitCopycatQuads(String key, BlockState state, CopycatRenderContext
sides.put(direction, state.getValue(byDirection(direction)));
}

Direction direction = Direction.byName(key.toLowerCase());
Direction direction = Direction.byName(key.toLowerCase(Locale.ROOT));

if (!sides.get(direction))
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import org.jetbrains.annotations.Nullable;

import javax.annotation.ParametersAreNonnullByDefault;
import java.util.Locale;
import java.util.Set;

@ParametersAreNonnullByDefault
Expand Down Expand Up @@ -180,7 +181,7 @@ public enum Part implements StringRepresentable {

@Override
public String getSerializedName() {
return name().toLowerCase();
return name().toLowerCase(Locale.ROOT);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import org.jetbrains.annotations.NotNull;

import java.util.List;
import java.util.Locale;
import java.util.function.Function;
import java.util.function.Supplier;

Expand All @@ -32,7 +33,7 @@ public enum CopycatCharacteristics implements StringRepresentable {

@Override
public @NotNull String getSerializedName() {
return name().toLowerCase();
return name().toLowerCase(Locale.ROOT);
}

public String getTitleKey() {
Expand Down

0 comments on commit d2a3fc8

Please sign in to comment.