diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c0f47a0924..f13734bec3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,10 +10,7 @@ jobs: uses: actions/checkout@v4 - name: Setup Java - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: '21' + run: echo "JAVA_HOME=$JAVA_HOME_21_X64" >> "$GITHUB_ENV" - name: ModDevGradle Cache uses: actions/cache@v4 @@ -35,4 +32,5 @@ jobs: - uses: actions/upload-artifact@v4 with: + name: Artifacts path: build/libs/ diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1b159936d5..d55d8751b6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,10 +10,7 @@ jobs: uses: actions/checkout@v4 - name: Setup Java - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: '21' + run: echo "JAVA_HOME=$JAVA_HOME_21_X64" >> "$GITHUB_ENV" - name: Setup Gradle uses: gradle/actions/setup-gradle@v4 diff --git a/build.gradle b/build.gradle index 5f2a1a0cd8..dbbd7e6a13 100644 --- a/build.gradle +++ b/build.gradle @@ -233,6 +233,15 @@ tasks.named("sourcesJar") { ]) } +final slimJar = tasks.register("slimJar", Jar) { + archiveClassifier = "slim" + from sourceSets.main.output + manifest.attributes([ + "Git-Hash": gitHash + ]) +} +obfuscation.reobfuscate(slimJar, sourceSets.main) + var generateModMetadata = tasks.register("generateModMetadata", ProcessResources) { var replaceProperties = [ mod_version : mod_version, @@ -262,6 +271,10 @@ publishing { register('mavenJava', MavenPublication) { artifactId base.archivesName.get() from components.java + + artifact(tasks.jar) { + classifier = "all" + } } } repositories { @@ -284,7 +297,7 @@ publishing { } publishMods { - file = jar.archiveFile + file = reobfJar.archiveFile changelog = ChangelogText.getChangelogText(project).toString() type = STABLE displayName = "$mod_name $mod_version for mc$minecraft_version" diff --git a/changelog.md b/changelog.md index bab0e30c5c..68f3686c05 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,16 @@ +------------------------------------------------------ +Create 6.0.1 +------------------------------------------------------ + +#### Bug Fixes + +- Fixed crash when using factory gauges +- Fixed debug info command not translating the graphics mode text +- Fixed cardboard sword not being able to damage arthropod mobs other than the spider +- Fixed a crash that occurred when placing a stock link on a re-packager +- Fixed an issue where wearing diving boots and sprinting would force you into the swim position and then out of it + right away + ------------------------------------------------------ Create 6.0.0 ------------------------------------------------------ diff --git a/gradle.properties b/gradle.properties index 09b770ce17..5d16cdd978 100644 --- a/gradle.properties +++ b/gradle.properties @@ -23,8 +23,8 @@ registrate_version = MC1.21-1.3.0+62 # Dependency Versions flywheel_minecraft_version = 1.21.1 -flywheel_version = 1.0.0-9 -vanillin_version = 1.0.0-beta-9 +flywheel_version = 1.0.0-10 +vanillin_version = 1.0.0-beta-10 flywheel_version_range = [1.0.0,2.0) ponder_version = 1.0.39 jei_minecraft_version = 1.21.1 diff --git a/src/main/java/com/simibubi/create/content/contraptions/render/ContraptionVisual.java b/src/main/java/com/simibubi/create/content/contraptions/render/ContraptionVisual.java index a89239ae67..eae9912b35 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/render/ContraptionVisual.java +++ b/src/main/java/com/simibubi/create/content/contraptions/render/ContraptionVisual.java @@ -14,6 +14,8 @@ import com.simibubi.create.content.contraptions.behaviour.MovementContext; import com.simibubi.create.foundation.utility.worldWrappers.WrappedBlockAndTintGetter; import com.simibubi.create.foundation.virtualWorld.VirtualRenderWorld; +import net.minecraftforge.client.model.data.ModelData; + import dev.engine_room.flywheel.api.material.CardinalLightingMode; import dev.engine_room.flywheel.api.model.Model; import dev.engine_room.flywheel.api.task.Plan; @@ -132,7 +134,7 @@ public class ContraptionVisual extends Abst } @SuppressWarnings("unchecked") - protected void setupVisualizer(T be, float partialTicks) { + protected void setupVisualizer(T be, float partialTicks) { BlockEntityVisualizer visualizer = (BlockEntityVisualizer) VisualizerRegistry.getVisualizer(be.getType()); if (visualizer == null) { return; @@ -182,17 +184,17 @@ public class ContraptionVisual extends Abst @Override public Plan planTick() { return NestedPlan.of( - ForEachPlan.of(() -> actors, ActorVisual::tick), - tickableVisuals + ForEachPlan.of(() -> actors, ActorVisual::tick), + tickableVisuals ); } @Override public Plan planFrame() { return NestedPlan.of( - RunnablePlan.of(this::beginFrame), - ForEachPlan.of(() -> actors, ActorVisual::beginFrame), - dynamicVisuals + RunnablePlan.of(this::beginFrame), + ForEachPlan.of(() -> actors, ActorVisual::beginFrame), + dynamicVisuals ); } @@ -201,7 +203,7 @@ public class ContraptionVisual extends Abst setEmbeddingMatrices(partialTick); if (hasMovedSections()) { - sectionCollector.sections(collectLightSections()); + sectionCollector.sections(collectLightSections()); } if (hasMovedBlocks()) { @@ -282,13 +284,13 @@ public class ContraptionVisual extends Abst int maxY = maxLight(boundingBox.maxY); int maxZ = maxLight(boundingBox.maxZ); - return minBlock != BlockPos.asLong(minX, minY, minZ) || maxBlock != BlockPos.asLong(maxX, maxY, maxZ); + return minBlock != BlockPos.asLong(minX, minY, minZ) || maxBlock != BlockPos.asLong(maxX, maxY, maxZ); } protected boolean hasMovedSections() { var boundingBox = entity.getBoundingBox(); - var minSectionX = minLightSection(boundingBox.minX); + var minSectionX = minLightSection(boundingBox.minX); var minSectionY = minLightSection(boundingBox.minY); var minSectionZ = minLightSection(boundingBox.minZ); int maxSectionX = maxLightSection(boundingBox.maxX); diff --git a/src/main/java/com/simibubi/create/content/equipment/potatoCannon/AllPotatoProjectileBlockHitActions.java b/src/main/java/com/simibubi/create/content/equipment/potatoCannon/AllPotatoProjectileBlockHitActions.java index 7e993ac08a..ae6b24c198 100644 --- a/src/main/java/com/simibubi/create/content/equipment/potatoCannon/AllPotatoProjectileBlockHitActions.java +++ b/src/main/java/com/simibubi/create/content/equipment/potatoCannon/AllPotatoProjectileBlockHitActions.java @@ -22,12 +22,12 @@ import net.minecraft.world.phys.BlockHitResult; import net.neoforged.neoforge.common.SpecialPlantable; public class AllPotatoProjectileBlockHitActions { - + static { register("plant_crop", PlantCrop.CODEC); register("place_block_on_ground", PlaceBlockOnGround.CODEC); } - + public static void init() { } diff --git a/src/main/java/com/simibubi/create/content/equipment/tool/CardboardSwordItem.java b/src/main/java/com/simibubi/create/content/equipment/tool/CardboardSwordItem.java index e7a3dcc8b1..ced8ac89f9 100644 --- a/src/main/java/com/simibubi/create/content/equipment/tool/CardboardSwordItem.java +++ b/src/main/java/com/simibubi/create/content/equipment/tool/CardboardSwordItem.java @@ -8,9 +8,17 @@ import com.simibubi.create.AllItems; import com.simibubi.create.AllSoundEvents; import com.simibubi.create.foundation.item.render.SimpleCustomRenderer; -import net.createmod.catnip.platform.CatnipServices; -import net.minecraft.core.Holder; -import net.minecraft.server.level.ServerLevel; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.client.extensions.common.IClientItemExtensions; +import net.minecraftforge.event.entity.living.LivingAttackEvent; +import net.minecraftforge.event.entity.player.PlayerInteractEvent.LeftClickBlock; +import net.minecraftforge.event.entity.player.PlayerInteractEvent.LeftClickBlock.Action; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.fml.LogicalSide; +import net.minecraftforge.fml.common.Mod.EventBusSubscriber; +import net.minecraftforge.network.PacketDistributor; + import net.minecraft.server.level.ServerPlayer; import net.minecraft.util.Mth; import net.minecraft.world.InteractionHand; @@ -19,26 +27,17 @@ import net.minecraft.world.effect.MobEffects; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.MobCategory; +import net.minecraft.world.entity.MobType; import net.minecraft.world.entity.ai.attributes.Attributes; -import net.minecraft.world.entity.monster.Spider; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.ItemStack.TooltipPart; import net.minecraft.world.item.SwordItem; import net.minecraft.world.item.crafting.RecipeType; import net.minecraft.world.item.enchantment.Enchantment; import net.minecraft.world.item.enchantment.EnchantmentHelper; import net.minecraft.world.item.enchantment.Enchantments; -import net.neoforged.api.distmarker.Dist; -import net.neoforged.api.distmarker.OnlyIn; -import net.neoforged.bus.api.EventPriority; -import net.neoforged.bus.api.SubscribeEvent; -import net.neoforged.fml.LogicalSide; -import net.neoforged.fml.common.EventBusSubscriber; -import net.neoforged.neoforge.client.extensions.common.IClientItemExtensions; -import net.neoforged.neoforge.event.entity.player.AttackEntityEvent; -import net.neoforged.neoforge.event.entity.player.PlayerInteractEvent; - @EventBusSubscriber public class CardboardSwordItem extends SwordItem { @@ -73,7 +72,7 @@ public class CardboardSwordItem extends SwordItem { @SubscribeEvent(priority = EventPriority.HIGHEST) public static void cardboardSwordsCannotHurtYou(AttackEntityEvent event) { Player attacker = event.getEntity(); - if (!(event.getTarget() instanceof LivingEntity target) || target == null || target instanceof Spider) + if (!(event.getTarget() instanceof LivingEntity target) || target == null || target.getMobType() == MobType.ARTHROPOD) return; ItemStack stack = attacker.getItemInHand(InteractionHand.MAIN_HAND); if (!(AllItems.CARDBOARD_SWORD.isIn(stack))) diff --git a/src/main/java/com/simibubi/create/content/fluids/potion/PotionMixingRecipes.java b/src/main/java/com/simibubi/create/content/fluids/potion/PotionMixingRecipes.java index 3c153176d6..46643246c6 100644 --- a/src/main/java/com/simibubi/create/content/fluids/potion/PotionMixingRecipes.java +++ b/src/main/java/com/simibubi/create/content/fluids/potion/PotionMixingRecipes.java @@ -25,6 +25,7 @@ import net.minecraft.world.item.alchemy.Potion; import net.minecraft.world.item.alchemy.PotionBrewing; import net.minecraft.world.item.alchemy.PotionContents; import net.minecraft.world.item.crafting.Ingredient; + import net.minecraft.world.item.crafting.RecipeHolder; import net.minecraft.world.level.Level; diff --git a/src/main/java/com/simibubi/create/content/kinetics/clock/CuckooClockBlockEntity.java b/src/main/java/com/simibubi/create/content/kinetics/clock/CuckooClockBlockEntity.java index b48630422f..a88dcf50b3 100644 --- a/src/main/java/com/simibubi/create/content/kinetics/clock/CuckooClockBlockEntity.java +++ b/src/main/java/com/simibubi/create/content/kinetics/clock/CuckooClockBlockEntity.java @@ -8,10 +8,10 @@ import com.simibubi.create.foundation.blockEntity.behaviour.BlockEntityBehaviour import com.simibubi.create.foundation.damageTypes.CreateDamageSources; import net.createmod.catnip.animation.AnimationTickHolder; -import net.createmod.catnip.nbt.NBTHelper; -import net.createmod.catnip.math.VecHelper; import net.createmod.catnip.animation.LerpedFloat; import net.createmod.catnip.animation.LerpedFloat.Chaser; +import net.createmod.catnip.math.VecHelper; +import net.createmod.catnip.nbt.NBTHelper; import net.minecraft.core.BlockPos; import net.minecraft.core.HolderLookup; import net.minecraft.core.particles.ParticleTypes; diff --git a/src/main/java/com/simibubi/create/content/logistics/factoryBoard/FactoryPanelBehaviour.java b/src/main/java/com/simibubi/create/content/logistics/factoryBoard/FactoryPanelBehaviour.java index 432b077f97..d03780e48d 100644 --- a/src/main/java/com/simibubi/create/content/logistics/factoryBoard/FactoryPanelBehaviour.java +++ b/src/main/java/com/simibubi/create/content/logistics/factoryBoard/FactoryPanelBehaviour.java @@ -48,6 +48,11 @@ import com.simibubi.create.foundation.blockEntity.behaviour.ValueSettingsFormatt import com.simibubi.create.foundation.blockEntity.behaviour.filtering.FilteringBehaviour; import com.simibubi.create.foundation.utility.CreateLang; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.fml.DistExecutor; +import net.minecraftforge.network.NetworkHooks; + import net.createmod.catnip.animation.LerpedFloat; import net.createmod.catnip.animation.LerpedFloat.Chaser; import net.createmod.catnip.codecs.CatnipCodecUtils; @@ -734,13 +739,16 @@ public class FactoryPanelBehaviour extends FilteringBehaviour implements MenuPro } RequestPromiseQueue promises = Create.LOGISTICS.getQueuedPromises(network); + if (promises == null) + return 0; + if (forceClearPromises) { promises.forceClear(item); resetTimerSlightly(); } forceClearPromises = false; - return promises == null ? 0 : promises.getTotalPromisedAndRemoveExpired(item, getPromiseExpiryTimeInTicks()); + return promises.getTotalPromisedAndRemoveExpired(item, getPromiseExpiryTimeInTicks()); } public void resetTimer() { diff --git a/src/main/java/com/simibubi/create/content/logistics/factoryBoard/FactoryPanelScreen.java b/src/main/java/com/simibubi/create/content/logistics/factoryBoard/FactoryPanelScreen.java index 7177f10847..9498526817 100644 --- a/src/main/java/com/simibubi/create/content/logistics/factoryBoard/FactoryPanelScreen.java +++ b/src/main/java/com/simibubi/create/content/logistics/factoryBoard/FactoryPanelScreen.java @@ -46,6 +46,7 @@ import net.minecraft.world.item.crafting.CraftingRecipe; import net.minecraft.world.item.crafting.Ingredient; import net.minecraft.world.item.crafting.RecipeHolder; import net.minecraft.world.item.crafting.RecipeType; + import net.minecraft.world.item.crafting.ShapedRecipe; public class FactoryPanelScreen extends AbstractSimiScreen { diff --git a/src/main/java/com/simibubi/create/content/logistics/packager/PackagerBlock.java b/src/main/java/com/simibubi/create/content/logistics/packager/PackagerBlock.java index 5440053567..dc81552bd3 100644 --- a/src/main/java/com/simibubi/create/content/logistics/packager/PackagerBlock.java +++ b/src/main/java/com/simibubi/create/content/logistics/packager/PackagerBlock.java @@ -11,6 +11,11 @@ import com.simibubi.create.foundation.block.IBE; import com.simibubi.create.foundation.block.WrenchableDirectionalBlock; import com.simibubi.create.foundation.utility.CreateLang; +import net.minecraftforge.common.capabilities.Capability; +import net.minecraftforge.common.capabilities.ForgeCapabilities; +import net.minecraftforge.common.util.FakePlayer; +import net.minecraftforge.items.IItemHandler; + import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.world.InteractionHand; @@ -87,7 +92,7 @@ public class PackagerBlock extends WrenchableDirectionalBlock implements IBE { - boolean empty = pbe.inventory.getStackInSlot(0) - .isEmpty(); - if (pbe.animationTicks != 0) - empty = false; - return empty ? 0 : 15; - }) + boolean empty = pbe.inventory.getStackInSlot(0) + .isEmpty(); + if (pbe.animationTicks != 0) + empty = false; + return empty ? 0 : 15; + }) .orElse(0); } diff --git a/src/main/java/com/simibubi/create/content/logistics/packagerLink/GlobalLogisticsManager.java b/src/main/java/com/simibubi/create/content/logistics/packagerLink/GlobalLogisticsManager.java index 016f87f398..2198d16d97 100644 --- a/src/main/java/com/simibubi/create/content/logistics/packagerLink/GlobalLogisticsManager.java +++ b/src/main/java/com/simibubi/create/content/logistics/packagerLink/GlobalLogisticsManager.java @@ -4,6 +4,8 @@ import java.util.HashMap; import java.util.Map; import java.util.UUID; +import org.jetbrains.annotations.Nullable; + import net.minecraft.core.GlobalPos; import net.minecraft.server.MinecraftServer; import net.minecraft.world.entity.player.Player; @@ -38,12 +40,12 @@ public class GlobalLogisticsManager { LogisticsNetwork network = logisticsNetworks.get(networkId); return network == null || network.owner == null || network.owner.equals(player.getUUID()); } - + public boolean isLockable(UUID networkId) { LogisticsNetwork network = logisticsNetworks.get(networkId); return network != null; } - + public boolean isLocked(UUID networkId) { LogisticsNetwork network = logisticsNetworks.get(networkId); return network != null && network.locked; @@ -86,6 +88,7 @@ public class GlobalLogisticsManager { return logisticsNetwork.totalLinks.size() - logisticsNetwork.loadedLinks.size(); } + @Nullable public RequestPromiseQueue getQueuedPromises(UUID networkId) { return !logisticsNetworks.containsKey(networkId) ? null : logisticsNetworks.get(networkId).panelPromises; } diff --git a/src/main/java/com/simibubi/create/content/logistics/stockTicker/StockKeeperCategoryScreen.java b/src/main/java/com/simibubi/create/content/logistics/stockTicker/StockKeeperCategoryScreen.java index c7f4302400..ae75fb52ff 100644 --- a/src/main/java/com/simibubi/create/content/logistics/stockTicker/StockKeeperCategoryScreen.java +++ b/src/main/java/com/simibubi/create/content/logistics/stockTicker/StockKeeperCategoryScreen.java @@ -134,7 +134,6 @@ public class StockKeeperCategoryScreen extends AbstractSimiContainerScreen= blockEntity.categories.size()) continue; - + if (!entry.hidden) { hiddenCategories.add(indexOf); playUiSound(SoundEvents.ITEM_FRAME_ROTATE_ITEM, 1f, 1.5f); } - + else { hiddenCategories.remove(indexOf); playUiSound(SoundEvents.ITEM_FRAME_ROTATE_ITEM, 1f, 0.675f); } - + refreshSearchNextTick = true; moveToTopNextTick = false; return true; @@ -1157,6 +1157,7 @@ public class StockKeeperRequestScreen extends AbstractSimiContainerScreen hoveredSlot = getHoveredSlot((int) mouseX, (int) mouseY); boolean noHover = hoveredSlot == noneHovered; @@ -1333,7 +1334,7 @@ public class StockKeeperRequestScreen extends AbstractSimiContainerScreen bogey && !bogey.captureBlockEntityForTrain()) return null; // Bogeys are typically rendered by the carriage contraption, not the BE - + return super.readBlockEntity(level, info, tag); } diff --git a/src/main/java/com/simibubi/create/foundation/blockEntity/behaviour/ValueSettingsBehaviour.java b/src/main/java/com/simibubi/create/foundation/blockEntity/behaviour/ValueSettingsBehaviour.java index 98c0fc83f9..979944fc57 100644 --- a/src/main/java/com/simibubi/create/foundation/blockEntity/behaviour/ValueSettingsBehaviour.java +++ b/src/main/java/com/simibubi/create/foundation/blockEntity/behaviour/ValueSettingsBehaviour.java @@ -88,13 +88,13 @@ public interface ValueSettingsBehaviour extends ClipboardCloneable { default boolean bypassesInput(ItemStack mainhandItem) { return false; } - + default boolean mayInteract(Player player) { return true; } - + default int netId() { return 0; } - + } diff --git a/src/main/java/com/simibubi/create/foundation/mixin/client/HeavyBootsOnPlayerMixin.java b/src/main/java/com/simibubi/create/foundation/mixin/client/HeavyBootsOnPlayerMixin.java index d4f3ebb022..a20daa98a1 100644 --- a/src/main/java/com/simibubi/create/foundation/mixin/client/HeavyBootsOnPlayerMixin.java +++ b/src/main/java/com/simibubi/create/foundation/mixin/client/HeavyBootsOnPlayerMixin.java @@ -2,13 +2,15 @@ package com.simibubi.create.foundation.mixin.client; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; -import com.llamalad7.mixinextras.injector.ModifyReturnValue; import com.mojang.authlib.GameProfile; import net.minecraft.client.multiplayer.ClientLevel; import net.minecraft.client.player.AbstractClientPlayer; import net.minecraft.client.player.LocalPlayer; +import net.minecraft.nbt.CompoundTag; @Mixin(LocalPlayer.class) public abstract class HeavyBootsOnPlayerMixin extends AbstractClientPlayer { @@ -16,8 +18,10 @@ public abstract class HeavyBootsOnPlayerMixin extends AbstractClientPlayer { super(level, profile); } - @ModifyReturnValue(method = "isUnderWater()Z", at = @At("RETURN")) - private boolean create$noSwimmingWithHeavyBootsOn(boolean original) { - return getPersistentData().contains("HeavyBoots") || original; + @Inject(method = "isUnderWater()Z", at = @At("HEAD"), cancellable = true) + public void create$noSwimmingWithHeavyBootsOn(CallbackInfoReturnable cir) { + CompoundTag persistentData = getPersistentData(); + if (persistentData.contains("HeavyBoots")) + cir.setReturnValue(false); } } diff --git a/src/main/java/com/simibubi/create/infrastructure/debugInfo/DebugInformation.java b/src/main/java/com/simibubi/create/infrastructure/debugInfo/DebugInformation.java index 52f86cd97d..5582b64fcc 100644 --- a/src/main/java/com/simibubi/create/infrastructure/debugInfo/DebugInformation.java +++ b/src/main/java/com/simibubi/create/infrastructure/debugInfo/DebugInformation.java @@ -17,6 +17,11 @@ import com.simibubi.create.infrastructure.debugInfo.element.DebugInfoSection; import com.simibubi.create.infrastructure.debugInfo.element.InfoElement; import com.simibubi.create.infrastructure.debugInfo.element.InfoEntry; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.fml.DistExecutor; +import net.minecraftforge.fml.ModList; +import net.minecraftforge.forgespi.language.IModInfo; + import dev.engine_room.flywheel.api.Flywheel; import dev.engine_room.flywheel.api.backend.Backend; import dev.engine_room.flywheel.api.backend.BackendManager; @@ -68,45 +73,45 @@ public class DebugInformation { static { DebugInfoSection.builder(Create.NAME) - .put("Mod Version", CreateBuildInfo.VERSION) - .put("NeoForge Version", getVersionOfMod("neoforge")) - .put("Minecraft Version", SharedConstants.getCurrentVersion().getName()) - .buildTo(DebugInformation::registerBothInfo); + .put("Mod Version", CreateBuildInfo.VERSION) + .put("NeoForge Version", getVersionOfMod("neoforge")) + .put("Minecraft Version", SharedConstants.getCurrentVersion().getName()) + .buildTo(DebugInformation::registerBothInfo); CatnipServices.PLATFORM.executeOnClientOnly(() -> () -> { DebugInfoSection.builder("Graphics") - .put("Flywheel Version", ModList.get() - .getModContainerById(Flywheel.ID) - .map(c -> c.getModInfo() - .getVersion() - .toString()) - .orElse("None")) - .put("Flywheel Backend", () -> Backend.REGISTRY.getIdOrThrow(BackendManager.currentBackend()).toString()) - .put("OpenGL Renderer", GlUtil::getRenderer) - .put("OpenGL Version", GlUtil::getOpenGLVersion) - .put("Graphics Mode", () -> Minecraft.getInstance().options.graphicsMode().get().getKey()) - .buildTo(DebugInformation::registerClientInfo); + .put("Flywheel Version", ModList.get() + .getModContainerById(Flywheel.ID) + .map(c -> c.getModInfo() + .getVersion() + .toString()) + .orElse("None")) + .put("Flywheel Backend", () -> Backend.REGISTRY.getIdOrThrow(BackendManager.currentBackend()).toString()) + .put("OpenGL Renderer", GlUtil::getRenderer) + .put("OpenGL Version", GlUtil::getOpenGLVersion) + .put("Graphics Mode", () -> I18n.get(Minecraft.getInstance().options.graphicsMode().get().getKey())) + .buildTo(DebugInformation::registerClientInfo); }); DebugInfoSection.builder("System Information") - .put("Operating System", SystemReportAccessor.getOPERATING_SYSTEM()) - .put("Java Version", SystemReportAccessor.getJAVA_VERSION()) - .put("JVM Flags", getMcSystemInfo("JVM Flags")) - .put("Memory", () -> getMcSystemInfo("Memory")) - .put("Total Memory", getTotalRam()) - .put("CPU", getCpuInfo()) - .putAll(listAllGraphicsCards()) - .buildTo(DebugInformation::registerBothInfo); + .put("Operating System", SystemReportAccessor.getOPERATING_SYSTEM()) + .put("Java Version", SystemReportAccessor.getJAVA_VERSION()) + .put("JVM Flags", getMcSystemInfo("JVM Flags")) + .put("Memory", () -> getMcSystemInfo("Memory")) + .put("Total Memory", getTotalRam()) + .put("CPU", getCpuInfo()) + .putAll(listAllGraphicsCards()) + .buildTo(DebugInformation::registerBothInfo); DebugInfoSection.builder("Other Mods") - .putAll(listAllOtherMods()) - .buildTo(DebugInformation::registerBothInfo); + .putAll(listAllOtherMods()) + .buildTo(DebugInformation::registerBothInfo); } public static String getVersionOfMod(String id) { return ModList.get().getModContainerById(id) - .map(mod -> mod.getModInfo().getVersion().toString()) - .orElse("None"); + .map(mod -> mod.getModInfo().getVersion().toString()) + .orElse("None"); } public static Collection listAllOtherMods() {