Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/generated/resources/assets/gtceu/lang/en_ud.json
Original file line number Diff line number Diff line change
Expand Up @@ -1749,6 +1749,8 @@
"config.gtceu.option.batchDuration": "uoıʇɐɹnᗡɥɔʇɐq",
"config.gtceu.option.bedrockOreDistance": "ǝɔuɐʇsıᗡǝɹOʞɔoɹpǝq",
"config.gtceu.option.bedrockOreDropTagPrefix": "xıɟǝɹԀbɐ⟘doɹᗡǝɹOʞɔoɹpǝq",
"config.gtceu.option.blockFovChange": "ǝbuɐɥƆʌoℲʞɔoןq",
"config.gtceu.option.blockSpeedChange": "ǝbuɐɥƆpǝǝdSʞɔoןq",
"config.gtceu.option.borderColor": "ɹoןoƆɹǝpɹoq",
"config.gtceu.option.bronzeBoilerHeatSpeed": "pǝǝdSʇɐǝHɹǝןıoᗺǝzuoɹq",
"config.gtceu.option.bronzeBoilerMaxTemperature": "ǝɹnʇɐɹǝdɯǝ⟘xɐWɹǝןıoᗺǝzuoɹq",
Expand Down
2 changes: 2 additions & 0 deletions src/generated/resources/assets/gtceu/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -1749,6 +1749,8 @@
"config.gtceu.option.batchDuration": "batchDuration",
"config.gtceu.option.bedrockOreDistance": "bedrockOreDistance",
"config.gtceu.option.bedrockOreDropTagPrefix": "bedrockOreDropTagPrefix",
"config.gtceu.option.blockFovChange": "blockFovChange",
"config.gtceu.option.blockSpeedChange": "blockSpeedChange",
"config.gtceu.option.borderColor": "borderColor",
"config.gtceu.option.bronzeBoilerHeatSpeed": "bronzeBoilerHeatSpeed",
"config.gtceu.option.bronzeBoilerMaxTemperature": "bronzeBoilerMaxTemperature",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import com.gregtechceu.gtceu.client.renderer.MultiblockInWorldPreviewRenderer;
import com.gregtechceu.gtceu.client.renderer.cover.FacadeCoverRenderer;
import com.gregtechceu.gtceu.client.util.TooltipHelper;
import com.gregtechceu.gtceu.config.ConfigHolder;
import com.gregtechceu.gtceu.core.mixins.client.AbstractClientPlayerAccessor;
import com.gregtechceu.gtceu.core.mixins.client.PlayerSkinAccessor;
import com.gregtechceu.gtceu.data.command.GTClientCommands;
Expand Down Expand Up @@ -117,18 +118,22 @@ private static double getValueWithoutWalkingBoost(AttributeInstance attrib) {
Map<AttributeModifier.Operation, List<AttributeModifier>> mods = attrib.getModifiers().stream()
.collect(Collectors.groupingBy(t -> t.operation()));

for (AttributeModifier mod : mods.get(AttributeModifier.Operation.ADD_VALUE)) {
base += mod.amount();
if (mods.get(AttributeModifier.Operation.ADD_VALUE) != null) {
for (AttributeModifier mod : mods.get(AttributeModifier.Operation.ADD_VALUE)) {
base += mod.amount();
}
}

double applied = base;
for (AttributeModifier mod : mods.get(AttributeModifier.Operation.ADD_MULTIPLIED_BASE)) {
if (mod.id() == BlockAttributes.BLOCK_SPEED_BOOST) continue;
if (mod.id() == BlockAttributes.BLOCK_SPEED_BOOST || !ConfigHolder.INSTANCE.client.blockFovChange) continue;
applied += base * mod.amount();
}

for (AttributeModifier mod : mods.get(AttributeModifier.Operation.ADD_MULTIPLIED_TOTAL)) {
applied *= 1 + mod.amount();
if (mods.get(AttributeModifier.Operation.ADD_MULTIPLIED_TOTAL) != null) {
for (AttributeModifier mod : mods.get(AttributeModifier.Operation.ADD_MULTIPLIED_TOTAL)) {
applied *= 1 + mod.amount();
}
}

return attrib.getAttribute().value().sanitizeValue(applied);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -745,6 +745,9 @@ public static class GameplayConfigs {
@Configurable.Comment({ "How much environmental hazards decay per chunk, per tick.",
"Default: 0.001" })
public float environmentalHazardDecayRate = 0.001f;
@Configurable
@Configurable.Comment({ "Whether or not speed-modifying blocks should change player's speed." })
public boolean blockSpeedChange = true;
}

public static class ClientConfigs {
Expand Down Expand Up @@ -796,6 +799,9 @@ public static class ClientConfigs {
public RendererConfigs renderer = new RendererConfigs();
@Configurable
public TankItemFluidPreview tankItemFluidPreview = new TankItemFluidPreview();
@Configurable
@Configurable.Comment({ "Whether or not speed-modifying blocks should change player's FOV." })
public boolean blockFovChange = true;

public int getDefaultPaintingColor() {
// OR with full alpha to differentiate from a machine that's painted white (map color 0xffffff)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,8 @@ public static void breakSpeed(PlayerEvent.BreakSpeed event) {
public static void playerTickEvent(PlayerTickEvent.Pre event) {
Player player = event.getEntity();
if (!player.level().isClientSide) {
if (!ConfigHolder.INSTANCE.gameplay.blockSpeedChange) return;

var speedAttrib = player.getAttribute(Attributes.MOVEMENT_SPEED);
if (speedAttrib == null) return;
var speedMod = speedAttrib.getModifier(BlockAttributes.BLOCK_SPEED_BOOST);
Expand Down
Loading