From 16324e1eacab32211a7c10985aa9620e7391b67a Mon Sep 17 00:00:00 2001 From: Jonathan Coates Date: Wed, 19 Feb 2025 21:07:12 +0000 Subject: [PATCH 1/6] Flesh out detail provider/registry docs --- .pre-commit-config.yaml | 2 +- .../api/detail/DetailProvider.java | 1 + .../api/detail/DetailRegistry.java | 1 + .../api/detail/VanillaDetailRegistries.java | 3 ++ .../api/detail/package-info.java | 48 ++++++++++++++++++ .../client/model/LecternPocketModel.java | 1 + .../com/example/examplemod/ExampleMod.java | 11 +++++ .../examplemod/ExamplePocketPeripheral.java | 49 +++++++++++++++++++ 8 files changed, 115 insertions(+), 1 deletion(-) create mode 100644 projects/common-api/src/main/java/dan200/computercraft/api/detail/package-info.java create mode 100644 projects/common/src/examples/java/com/example/examplemod/ExamplePocketPeripheral.java diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e76ef7433..76e73fc5f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,7 +6,7 @@ # See https://pre-commit.com/hooks.html for more hooks repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v5.0.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer diff --git a/projects/common-api/src/main/java/dan200/computercraft/api/detail/DetailProvider.java b/projects/common-api/src/main/java/dan200/computercraft/api/detail/DetailProvider.java index 879ed77eb..5923271ad 100644 --- a/projects/common-api/src/main/java/dan200/computercraft/api/detail/DetailProvider.java +++ b/projects/common-api/src/main/java/dan200/computercraft/api/detail/DetailProvider.java @@ -14,6 +14,7 @@ import java.util.Map; * * @param The type of object that this provider can provide details for. * @see DetailRegistry + * @see dan200.computercraft.api.detail An overview of the detail system. */ @FunctionalInterface public interface DetailProvider { diff --git a/projects/common-api/src/main/java/dan200/computercraft/api/detail/DetailRegistry.java b/projects/common-api/src/main/java/dan200/computercraft/api/detail/DetailRegistry.java index 4f21ff81f..342150515 100644 --- a/projects/common-api/src/main/java/dan200/computercraft/api/detail/DetailRegistry.java +++ b/projects/common-api/src/main/java/dan200/computercraft/api/detail/DetailRegistry.java @@ -17,6 +17,7 @@ import java.util.Map; * also in this package. * * @param The type of object that this registry provides details for. + * @see dan200.computercraft.api.detail An overview of the detail system. */ @ApiStatus.NonExtendable public interface DetailRegistry { diff --git a/projects/common-api/src/main/java/dan200/computercraft/api/detail/VanillaDetailRegistries.java b/projects/common-api/src/main/java/dan200/computercraft/api/detail/VanillaDetailRegistries.java index 409bca0f0..a7b462e1a 100644 --- a/projects/common-api/src/main/java/dan200/computercraft/api/detail/VanillaDetailRegistries.java +++ b/projects/common-api/src/main/java/dan200/computercraft/api/detail/VanillaDetailRegistries.java @@ -17,6 +17,9 @@ public class VanillaDetailRegistries { *

* This instance's {@link DetailRegistry#getBasicDetails(Object)} is thread safe (assuming the stack is immutable) * and may be called from the computer thread. + *

+ * This does not have special handling for {@linkplain ItemStack#isEmpty() empty item stacks}, and so the returned + * details will be an empty stack of air. Callers should generally check for empty stacks before calling this. */ public static final DetailRegistry ITEM_STACK = ComputerCraftAPIService.get().getItemStackDetailRegistry(); diff --git a/projects/common-api/src/main/java/dan200/computercraft/api/detail/package-info.java b/projects/common-api/src/main/java/dan200/computercraft/api/detail/package-info.java new file mode 100644 index 000000000..a562797dc --- /dev/null +++ b/projects/common-api/src/main/java/dan200/computercraft/api/detail/package-info.java @@ -0,0 +1,48 @@ +// SPDX-FileCopyrightText: 2025 The CC: Tweaked Developers +// +// SPDX-License-Identifier: MPL-2.0 + +/** + * The detail system provides a standard way for mods to return descriptions of common game objects, such as blocks or + * items, as well as registering additional detail to be included in those descriptions. + *

+ * For instance, the built-in {@code turtle.getItemDetail()} method uses + * {@linkplain dan200.computercraft.api.detail.VanillaDetailRegistries#ITEM_STACK in order to provide information about} + * the selected item: + * + *

{@code
+ * local item = turtle.getItemDetail(nil, true)
+ * --[[
+ * item = {
+ *   name = "minecraft:wheat",
+ *   displayName = "Wheat",
+ *   count = 1,
+ *   maxCount = 64,
+ *   tags = {},
+ * }
+ * ]]
+ * }
+ * + *

Built-in detail providers

+ * While you can define your own detail providers (perhaps for types from your own mod), CC comes with several built-in + * detail registries for vanilla and mod-loader objects: + * + *
    + *
  • {@link dan200.computercraft.api.detail.VanillaDetailRegistries}, for vanilla objects
  • + *
  • {@code dan200.computercraft.api.detail.ForgeDetailRegistries} for Forge-specific objects
  • + *
  • {@code dan200.computercraft.api.detail.FabricDetailRegistries} for Fabric-specific objects
  • + *
+ * + *

Example: Returning details from methods

+ * Here we define a {@code getHeldItem()} method for pocket computers which finds the currently held item of the player + * and returns it to the user using {@link dan200.computercraft.api.detail.VanillaDetailRegistries#ITEM_STACK} and + * {@link dan200.computercraft.api.detail.DetailRegistry#getDetails(java.lang.Object)}. + * + * {@snippet class=com.example.examplemod.ExamplePocketPeripheral region=details} + * + *

Example: Registering custom detail registries

+ * Here we define a new detail provider for items that includes the nutrition and saturation values in the returned object. + * + * {@snippet class=com.example.examplemod.ExampleMod region=details} + */ +package dan200.computercraft.api.detail; diff --git a/projects/common/src/client/java/dan200/computercraft/client/model/LecternPocketModel.java b/projects/common/src/client/java/dan200/computercraft/client/model/LecternPocketModel.java index a31b109a6..0b81bc291 100644 --- a/projects/common/src/client/java/dan200/computercraft/client/model/LecternPocketModel.java +++ b/projects/common/src/client/java/dan200/computercraft/client/model/LecternPocketModel.java @@ -22,6 +22,7 @@ import net.minecraft.client.resources.model.Material; import net.minecraft.resources.ResourceLocation; import net.minecraft.util.FastColor; import net.minecraft.world.inventory.InventoryMenu; +import net.minecraft.world.item.ItemStack; /** * A model for {@linkplain PocketComputerItem pocket computers} placed on a lectern. diff --git a/projects/common/src/examples/java/com/example/examplemod/ExampleMod.java b/projects/common/src/examples/java/com/example/examplemod/ExampleMod.java index df15779a2..cdffd4b7c 100644 --- a/projects/common/src/examples/java/com/example/examplemod/ExampleMod.java +++ b/projects/common/src/examples/java/com/example/examplemod/ExampleMod.java @@ -3,6 +3,7 @@ package com.example.examplemod; import com.example.examplemod.data.TurtleDataProvider; import com.example.examplemod.peripheral.FurnacePeripheral; import dan200.computercraft.api.ComputerCraftAPI; +import dan200.computercraft.api.detail.VanillaDetailRegistries; import dan200.computercraft.api.turtle.TurtleUpgradeSerialiser; /** @@ -34,6 +35,16 @@ public final class ExampleMod { ComputerCraftAPI.registerGenericSource(new FurnacePeripheral()); // @end region=generic_source + // @start region=details + VanillaDetailRegistries.ITEM_STACK.addProvider((out, stack) -> { + var food = stack.getItem().getFoodProperties(); + if (food == null) return; + + out.put("saturation", food.getSaturationModifier()); + out.put("nutrition", food.getNutrition()); + }); + // @end region=details + ExampleAPI.register(); } } diff --git a/projects/common/src/examples/java/com/example/examplemod/ExamplePocketPeripheral.java b/projects/common/src/examples/java/com/example/examplemod/ExamplePocketPeripheral.java new file mode 100644 index 000000000..bf9a19aa4 --- /dev/null +++ b/projects/common/src/examples/java/com/example/examplemod/ExamplePocketPeripheral.java @@ -0,0 +1,49 @@ +package com.example.examplemod; + +import dan200.computercraft.api.detail.DetailRegistry; +import dan200.computercraft.api.detail.VanillaDetailRegistries; +import dan200.computercraft.api.lua.LuaFunction; +import dan200.computercraft.api.peripheral.IPeripheral; +import dan200.computercraft.api.pocket.IPocketAccess; +import net.minecraft.world.InteractionHand; +import net.minecraft.world.entity.LivingEntity; +import org.jspecify.annotations.Nullable; + +import java.util.Map; + +/** + * An example peripheral for pocket computers. This currently doesn't have an associated upgrade — it mostly exists to + * demonstrate other functionality. + */ +public class ExamplePocketPeripheral implements IPeripheral { + private final IPocketAccess pocket; + + public ExamplePocketPeripheral(IPocketAccess pocket) { + this.pocket = pocket; + } + + @Override + public String getType() { + return "example"; + } + + /** + * An example of using {@linkplain DetailRegistry detail registries} to get the current player's held item. + * + * @return The item details, or {@code null} if the player is not holding an item. + */ + // @start region=details + @LuaFunction(mainThread = true) + public final @Nullable Map getHeldItem() { + if (!(pocket.getEntity() instanceof LivingEntity entity)) return null; + + var heldItem = entity.getItemInHand(InteractionHand.MAIN_HAND); + return heldItem.isEmpty() ? null : VanillaDetailRegistries.ITEM_STACK.getDetails(heldItem); + } + // @end region=details + + @Override + public boolean equals(@Nullable IPeripheral other) { + return other instanceof ExamplePocketPeripheral o && pocket == o.pocket; + } +} From 6660966320b3a5258eb186adde1875f81f50e69e Mon Sep 17 00:00:00 2001 From: ellellie Date: Sun, 2 Mar 2025 08:56:43 +1300 Subject: [PATCH 2/6] Update Create dependency to 6.0.0 (#2117) --- gradle/libs.versions.toml | 2 +- projects/common/build.gradle.kts | 1 - .../shared/integration/ExternalModTags.java | 4 +-- .../shared/integration/CreateIntegration.java | 0 projects/forge/build.gradle.kts | 2 +- .../shared/integration/CreateIntegration.java | 34 +++++++++++++++++++ 6 files changed, 38 insertions(+), 5 deletions(-) rename projects/{common => fabric}/src/main/java/dan200/computercraft/shared/integration/CreateIntegration.java (100%) create mode 100644 projects/forge/src/main/java/dan200/computercraft/shared/integration/CreateIntegration.java diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index c64a3af7a..6c3e81ff7 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -46,7 +46,7 @@ oculus = "1.2.5" rei = "12.0.626" rubidium = "0.6.1" sodium = "mc1.20-0.4.10" -create-forge = "0.5.1.f-33" +create-forge = "6.0.0-9" create-fabric = "0.5.1-f-build.1467+mc1.20.1" # Testing diff --git a/projects/common/build.gradle.kts b/projects/common/build.gradle.kts index 20e74493d..0c1a2c7ae 100644 --- a/projects/common/build.gradle.kts +++ b/projects/common/build.gradle.kts @@ -37,7 +37,6 @@ dependencies { clientApi(clientClasses(project(":common-api"))) compileOnly(libs.bundles.externalMods.common) - compileOnly(variantOf(libs.create.forge) { classifier("slim") }) { isTransitive = false } clientCompileOnly(variantOf(libs.emi) { classifier("api") }) annotationProcessorEverywhere(libs.autoService) diff --git a/projects/common/src/main/java/dan200/computercraft/shared/integration/ExternalModTags.java b/projects/common/src/main/java/dan200/computercraft/shared/integration/ExternalModTags.java index cf8aaba93..3908d010c 100644 --- a/projects/common/src/main/java/dan200/computercraft/shared/integration/ExternalModTags.java +++ b/projects/common/src/main/java/dan200/computercraft/shared/integration/ExternalModTags.java @@ -27,9 +27,9 @@ public final class ExternalModTags { /** * Create's "brittle" tag, used to determine if this block needs to be moved before its neighbours. * - * @see com.simibubi.create.content.contraptions.BlockMovementChecks#isBrittle(BlockState) + * @see com.simibubi.create.api.contraption.BlockMovementChecks#isBrittle(BlockState) */ - public static final TagKey CREATE_BRITTLE = make(CreateIntegration.ID, "brittle"); + public static final TagKey CREATE_BRITTLE = make("create", "brittle"); private static TagKey make(String mod, String name) { return TagKey.create(Registries.BLOCK, new ResourceLocation(mod, name)); diff --git a/projects/common/src/main/java/dan200/computercraft/shared/integration/CreateIntegration.java b/projects/fabric/src/main/java/dan200/computercraft/shared/integration/CreateIntegration.java similarity index 100% rename from projects/common/src/main/java/dan200/computercraft/shared/integration/CreateIntegration.java rename to projects/fabric/src/main/java/dan200/computercraft/shared/integration/CreateIntegration.java diff --git a/projects/forge/build.gradle.kts b/projects/forge/build.gradle.kts index 0e24739f1..97cc0725d 100644 --- a/projects/forge/build.gradle.kts +++ b/projects/forge/build.gradle.kts @@ -155,7 +155,7 @@ dependencies { clientCompileOnly(variantOf(libs.emi) { classifier("api") }) modCompileOnly(libs.bundles.externalMods.forge.compile) modRuntimeOnly(libs.bundles.externalMods.forge.runtime) - modCompileOnly(variantOf(libs.create.forge) { classifier("slim") }) + modCompileOnly(variantOf(libs.create.forge) { classifier("slim") }) { isTransitive = false } // Depend on our other projects. "localImplementation"(project(":core")) diff --git a/projects/forge/src/main/java/dan200/computercraft/shared/integration/CreateIntegration.java b/projects/forge/src/main/java/dan200/computercraft/shared/integration/CreateIntegration.java new file mode 100644 index 000000000..a606f9376 --- /dev/null +++ b/projects/forge/src/main/java/dan200/computercraft/shared/integration/CreateIntegration.java @@ -0,0 +1,34 @@ +// SPDX-FileCopyrightText: 2024 The CC: Tweaked Developers +// +// SPDX-License-Identifier: MPL-2.0 + +package dan200.computercraft.shared.integration; + +import com.simibubi.create.api.contraption.BlockMovementChecks; +import com.simibubi.create.api.contraption.BlockMovementChecks.CheckResult; +import dan200.computercraft.shared.peripheral.modem.wired.CableBlock; +import dan200.computercraft.shared.peripheral.modem.wireless.WirelessModemBlock; + +/** + * Integration with Create. + */ +public final class CreateIntegration { + public static final String ID = "create"; + + private CreateIntegration() { + } + + public static void setup() { + // Allow modems to be treated as "attached" to their adjacent block. + BlockMovementChecks.registerAttachedCheck((state, world, pos, direction) -> { + var block = state.getBlock(); + if (block instanceof WirelessModemBlock) { + return CheckResult.of(state.getValue(WirelessModemBlock.FACING) == direction); + } else if (block instanceof CableBlock) { + return CheckResult.of(state.getValue(CableBlock.MODEM).getFacing() == direction); + } else { + return CheckResult.PASS; + } + }); + } +} From 9d2c2db22bb4a5179fccbeb11944174d318211bb Mon Sep 17 00:00:00 2001 From: Jonathan Coates Date: Sat, 1 Mar 2025 20:28:37 +0000 Subject: [PATCH 3/6] Fix speaker.playAudio not updating volume MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Honestly, the whole design around volume and playSound/playAudio is a little janky — it probably should be a separate setVolume method which updates directly. But too late to change that now, so let's do what we can. See #2108 --- .../client/sound/SpeakerInstance.java | 22 ++++++++++++++----- .../client/sound/SpeakerSound.java | 6 +++++ 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/projects/common/src/client/java/dan200/computercraft/client/sound/SpeakerInstance.java b/projects/common/src/client/java/dan200/computercraft/client/sound/SpeakerInstance.java index 1e55362e4..cb08140f2 100644 --- a/projects/common/src/client/java/dan200/computercraft/client/sound/SpeakerInstance.java +++ b/projects/common/src/client/java/dan200/computercraft/client/sound/SpeakerInstance.java @@ -24,7 +24,7 @@ public class SpeakerInstance { SpeakerInstance() { } - private void pushAudio(EncodedAudio buffer) { + private void pushAudio(EncodedAudio buffer, float volume) { var sound = this.sound; var stream = currentStream; @@ -32,18 +32,30 @@ public class SpeakerInstance { var exhausted = stream.isEmpty(); stream.push(buffer); - // If we've got nothing left in the buffer, enqueue an additional one just in case. - if (exhausted && sound != null && sound.stream == stream && stream.channel != null && stream.executor != null) { + if (sound == null) return; + + var volumeChanged = sound.setVolume(volume); + + if ((exhausted || volumeChanged) && sound.stream == stream && stream.channel != null && stream.executor != null) { var actualStream = sound.stream; stream.executor.execute(() -> { var channel = Nullability.assertNonNull(actualStream.channel); - if (!channel.stopped()) channel.pumpBuffers(1); + if (channel.stopped()) return; + + // If we've got nothing left in the buffer, enqueue an additional one just in case. + if (exhausted) channel.pumpBuffers(1); + + // Update the attenuation if the volume has changed: SoundEngine.tickNonPaused updates the volume + // itself, but leaves the attenuation unchanged. We mirror the logic of SoundEngine.play here. + if (volumeChanged) { + channel.linearAttenuation(Math.max(volume, 1) * sound.getSound().getAttenuationDistance()); + } }); } } public void playAudio(SpeakerPosition position, float volume, EncodedAudio buffer) { - pushAudio(buffer); + pushAudio(buffer, volume); var soundManager = Minecraft.getInstance().getSoundManager(); diff --git a/projects/common/src/client/java/dan200/computercraft/client/sound/SpeakerSound.java b/projects/common/src/client/java/dan200/computercraft/client/sound/SpeakerSound.java index 44ab385f2..e55e8d542 100644 --- a/projects/common/src/client/java/dan200/computercraft/client/sound/SpeakerSound.java +++ b/projects/common/src/client/java/dan200/computercraft/client/sound/SpeakerSound.java @@ -83,4 +83,10 @@ public class SpeakerSound extends AbstractSoundInstance implements TickableSound public @Nullable AudioStream getStream() { return stream; } + + boolean setVolume(float volume) { + if (volume == this.volume) return false; + this.volume = volume; + return true; + } } From b9267ecbfc654b2f6e87d7cf1cb806fe90e25d85 Mon Sep 17 00:00:00 2001 From: Jonathan Coates Date: Sat, 1 Mar 2025 22:24:27 +0000 Subject: [PATCH 4/6] Resize lectern pocket computer textures This bumps them to be 48x48, which allows them to be downscaled to a mipmap level of 4. We possibly should bump these to be 64x64 (actual power of two), but I kinda want to avoid that, as it's so much wasted space. If this does become a problem, we should probably put these on a separate atlas instead. --- .../client/model/LecternPocketModel.java | 4 ++-- .../entity/pocket_computer_advanced.png | Bin 152 -> 155 bytes .../textures/entity/pocket_computer_colour.png | Bin 179 -> 140 bytes .../textures/entity/pocket_computer_frame.png | Bin 119 -> 120 bytes .../textures/entity/pocket_computer_light.png | Bin 92 -> 96 bytes .../textures/entity/pocket_computer_normal.png | Bin 152 -> 155 bytes 6 files changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/common/src/client/java/dan200/computercraft/client/model/LecternPocketModel.java b/projects/common/src/client/java/dan200/computercraft/client/model/LecternPocketModel.java index 0b81bc291..6e8f174a2 100644 --- a/projects/common/src/client/java/dan200/computercraft/client/model/LecternPocketModel.java +++ b/projects/common/src/client/java/dan200/computercraft/client/model/LecternPocketModel.java @@ -47,8 +47,8 @@ public class LecternPocketModel { public static final float TERM_HEIGHT = 14.0f / 32.0f; // The size of the texture. The texture is 36x36, but is at 2x resolution. - private static final int TEXTURE_WIDTH = 36 / 2; - private static final int TEXTURE_HEIGHT = 36 / 2; + private static final int TEXTURE_WIDTH = 48 / 2; + private static final int TEXTURE_HEIGHT = 48 / 2; private final ModelPart root; diff --git a/projects/common/src/main/resources/assets/computercraft/textures/entity/pocket_computer_advanced.png b/projects/common/src/main/resources/assets/computercraft/textures/entity/pocket_computer_advanced.png index b8b6b40d0e8c575758be7dca4c6d32f707a25543..9096b84015ad3839a23ba5ca7afb10c179a2b1d9 100644 GIT binary patch delta 124 zcmbQiIGa(iGr-TCmrII^fq{Y7)59eQNE?7K6El$1$`KTqsHhQS>*?YcqA@W!fuSjY zO~v4dWNQ6I>sY~JO;+b&lNy^%&twuZ^{<3T4gsu+rJ^JCB0vp4( XHQ_rLmOior8pz=3>gTe~DWM4ftHdgT delta 121 zcmbQuID=8KGr-TCmrII^fq{Y7)59eQNUMM_6El#UlUKk!QBlL+%G1R$L?S#nfuSjY zO+un(O@KtgivR!r=l=i_>zyM06o@(TtdN^Ib!*nuQw9pzuN*dnt&K7jeOSdXkw1J# U&-1_SK+_mJUHx3vIVCg!07NP&xBvhE diff --git a/projects/common/src/main/resources/assets/computercraft/textures/entity/pocket_computer_colour.png b/projects/common/src/main/resources/assets/computercraft/textures/entity/pocket_computer_colour.png index 23e57787bd1c785e839a99907f1e9e793e2f9e1c..2d236d3f318b63361b361aed2529fe3d3c2e5a9b 100644 GIT binary patch literal 140 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDD3?#L31Vw-pXMj(LE0BKr^y&Zq|BoEp;|Am~ zmIV0)GdMiEkp|=#db&7|l3?zm1T2})p{s5m4S0MfL>C^xJ|3k<{jQ;z8 zLd+#We!)QcSJ{z!Kq|n~#W6%9I60t+fsIX7qG6+igvbM*KdT%XICoD_U@8;twq^Z diff --git a/projects/common/src/main/resources/assets/computercraft/textures/entity/pocket_computer_light.png b/projects/common/src/main/resources/assets/computercraft/textures/entity/pocket_computer_light.png index 49b2a99ffdb98bcbbd0fbc16fd7c53982baf828d..9e92b04c8ddeff9fd2d739e8f2c11246b7691598 100644 GIT binary patch literal 96 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA1|-9oezpTCbx#+^kc@k8FBtMNFmNz$_-W32 pK8|NXn3FJ2a^4IhMj*v-Ad~TgGyBhONoE@m*VEO{Wt~$(69CF17LEV_ literal 92 zcmeAS@N?(olHy`uVBq!ia0vp^Dj>|k1|%Oc%$NbBls#P>Ln02pyK!TObib?S+{Yq|NJM~>k3rP;OXk;vd$@?2>_Ch7asrs diff --git a/projects/common/src/main/resources/assets/computercraft/textures/entity/pocket_computer_normal.png b/projects/common/src/main/resources/assets/computercraft/textures/entity/pocket_computer_normal.png index 5102383aadf421cc739be328e0ea913733c5df2a..20dff3ff33d71e841963a4ccbd9ebc400040b01a 100644 GIT binary patch delta 124 zcmbQiIGa(iGr-TCmrII^fq{Y7)59eQNE?7K6El$1$`KTqsHhQS>*?YcqA@W!fuSjY zO~v4dWNQ6I>sY~JO;+b&lNy^%&twuZ^{<3T4gsu+rJ^JCB0vp4( XHQ_rLmOior8pz=3>gTe~DWM4ftHdgT delta 121 zcmbQuID=8KGr-TCmrII^fq{Y7)59eQNUMM_6El#UlUKk!QBlL+%G1R$L?S#nfuSjY zO+un(O@KtgivR!r=l=i_>zyM06o@(TtdN^Ib!*nuQw9pzuN*dnt&K7jeOSdXkw1J# U&-1_SK+_mJUHx3vIVCg!07NP&xBvhE From 29c8f96912b8c8617a834ae60ea4142773f3bd11 Mon Sep 17 00:00:00 2001 From: Jonathan Coates Date: Sat, 1 Mar 2025 22:34:45 +0000 Subject: [PATCH 5/6] Sync translations from CrowdIn MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I remembered to do this *before* the update! 🎉 --- .../assets/computercraft/lang/de_de.json | 3 +++ .../assets/computercraft/lang/fr_fr.json | 16 ++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/projects/common/src/main/resources/assets/computercraft/lang/de_de.json b/projects/common/src/main/resources/assets/computercraft/lang/de_de.json index c4a6dbe43..3c4aa9d55 100644 --- a/projects/common/src/main/resources/assets/computercraft/lang/de_de.json +++ b/projects/common/src/main/resources/assets/computercraft/lang/de_de.json @@ -1,5 +1,6 @@ { "argument.computercraft.argument_expected": "Parameter erwartet", + "argument.computercraft.computer.distance": "Entfernung zur Entität", "argument.computercraft.computer.family": "Computer familie", "argument.computercraft.computer.id": "Computer ID", "argument.computercraft.computer.instance": "einzigartige Instanz ID", @@ -98,6 +99,7 @@ "gui.computercraft.config.http.bandwidth.tooltip": "Limitiert die Bandbreite der Computer.", "gui.computercraft.config.http.enabled": "HTTP-API aktivieren", "gui.computercraft.config.http.max_requests": "Maximale Anzahl gleichzeitiger Anfragen", + "gui.computercraft.config.http.max_requests.tooltip": "Die Anzahl der http Anfragen, die ein Computer gleichzeitig machen kann. Zusätzliche Anfragen werden der Warteschlange hinzugefügt und nach den laufenden Anfragen gesendet. Für unendlich auf 0 setzen.", "gui.computercraft.config.http.max_websockets": "Maximale Anzahl gleichzeitiger Websockets", "gui.computercraft.config.http.max_websockets.tooltip": "Die Anzahl der Websockets die ein Computer gleichzeitig öffnen kann.", "gui.computercraft.config.http.proxy": "Proxy", @@ -114,6 +116,7 @@ "gui.computercraft.config.log_computer_errors": "Computerfehler loggen", "gui.computercraft.config.maximum_open_files": "Maximalanzahl an gleichzeitig offenen Dateien je Computer", "gui.computercraft.config.maximum_open_files.tooltip": "Legen Sie fest, wie viele Dateien gleichzeitig geöffnet werden können. Setzen Sie auf 0 für unbegrenzt.", + "gui.computercraft.config.monitor_distance": "Monitordistanz", "gui.computercraft.config.peripheral": "Peripheriegeräte", "gui.computercraft.config.peripheral.command_block_enabled": "Befehlsblöcke als Peripheriegerät erlauben", "gui.computercraft.config.peripheral.command_block_enabled.tooltip": "Befehlsblock Peripherie Unterstützung aktivieren", diff --git a/projects/common/src/main/resources/assets/computercraft/lang/fr_fr.json b/projects/common/src/main/resources/assets/computercraft/lang/fr_fr.json index f4481d5ec..414d410ee 100644 --- a/projects/common/src/main/resources/assets/computercraft/lang/fr_fr.json +++ b/projects/common/src/main/resources/assets/computercraft/lang/fr_fr.json @@ -1,8 +1,14 @@ { "argument.computercraft.argument_expected": "Argument attendu", + "argument.computercraft.computer.distance": "Distance jusqu'à l'entité", + "argument.computercraft.computer.family": "Famille d'ordinateurs", + "argument.computercraft.computer.id": "ID de l'ordinateur", + "argument.computercraft.computer.instance": "ID unique de l'instance", + "argument.computercraft.computer.label": "Étiquette de l'ordinateur", "argument.computercraft.computer.many_matching": "Plusieurs ordinateurs correspondent à '%s' (instances %s)", "argument.computercraft.computer.no_matching": "Pas d'ordinateurs correspondant à '%s'", "argument.computercraft.tracking_field.no_field": "Champ '%s' inconnu", + "argument.computercraft.unknown_computer_family": "Famille d'ordinateur '%s ' inconnue", "block.computercraft.cable": "Câble réseau", "block.computercraft.computer_advanced": "Ordinateur Avancé", "block.computercraft.computer_command": "Ordinateur de commande", @@ -11,6 +17,7 @@ "block.computercraft.monitor_advanced": "Moniteur Avancé", "block.computercraft.monitor_normal": "Moniteur", "block.computercraft.printer": "Imprimante", + "block.computercraft.redstone_relay": "Relais de Redstone", "block.computercraft.speaker": "Haut-parleur", "block.computercraft.turtle_advanced": "Tortue Avancée", "block.computercraft.turtle_advanced.upgraded": "Tortue %s Avancée", @@ -137,16 +144,22 @@ "gui.computercraft.config.term_sizes": "Tailles de terminal", "gui.computercraft.config.term_sizes.computer": "Ordinateur", "gui.computercraft.config.term_sizes.computer.height": "Hauteur du terminal", + "gui.computercraft.config.term_sizes.computer.height.tooltip": "Hauteur du terminal de l'ordinateur", "gui.computercraft.config.term_sizes.computer.tooltip": "Taille du terminal des ordinateurs.", "gui.computercraft.config.term_sizes.computer.width": "Largeur du terminal", + "gui.computercraft.config.term_sizes.computer.width.tooltip": "Largeur du terminal de l'ordinateur", "gui.computercraft.config.term_sizes.monitor": "Moniteur", "gui.computercraft.config.term_sizes.monitor.height": "Hauteur maximale du moniteur", + "gui.computercraft.config.term_sizes.monitor.height.tooltip": "Hauteur maximale des moniteurs", "gui.computercraft.config.term_sizes.monitor.tooltip": "Taille maximale des moniteurs (en blocs).", "gui.computercraft.config.term_sizes.monitor.width": "Largeur maximale du moniteur", + "gui.computercraft.config.term_sizes.monitor.width.tooltip": "Largeur maximale des moniteurs", "gui.computercraft.config.term_sizes.pocket_computer": "Ordinateur de poche", "gui.computercraft.config.term_sizes.pocket_computer.height": "Hauteur du terminal", + "gui.computercraft.config.term_sizes.pocket_computer.height.tooltip": "Hauteur du terminal de l'ordinateur de poche", "gui.computercraft.config.term_sizes.pocket_computer.tooltip": "Taille du terminal des ordinateurs de poche.", "gui.computercraft.config.term_sizes.pocket_computer.width": "Largeur du terminal", + "gui.computercraft.config.term_sizes.pocket_computer.width.tooltip": "Largeur du terminal de l'ordinateur de poche", "gui.computercraft.config.term_sizes.tooltip": "Configure la taille des différents terminaux de l'ordinateur.\nLes terminaux plus grands nécessitent plus de bande passante, réglez donc avec précaution.", "gui.computercraft.config.turtle": "Tortues", "gui.computercraft.config.turtle.advanced_fuel_limit": "Limite de carburant par Tortue Avancée", @@ -192,6 +205,8 @@ "item.computercraft.treasure_disk": "Disquette", "itemGroup.computercraft": "ComputerCraft", "tag.item.computercraft.computer": "Ordinateurs", + "tag.item.computercraft.monitor": "Moniteurs", + "tag.item.computercraft.turtle": "Tortues", "tag.item.computercraft.wired_modem": "Modems câblés", "tracking_field.computercraft.avg": "%s (moyenne)", "tracking_field.computercraft.computer_tasks.name": "Tâches", @@ -200,6 +215,7 @@ "tracking_field.computercraft.http_download.name": "Téléchargement HTTP", "tracking_field.computercraft.http_requests.name": "Requêtes HTTP", "tracking_field.computercraft.http_upload.name": "Publication HTTP", + "tracking_field.computercraft.java_allocation.name": "Allocations Java", "tracking_field.computercraft.max": "%s (max)", "tracking_field.computercraft.peripheral.name": "Appels aux périphériques", "tracking_field.computercraft.server_tasks.name": "Tâches du serveur", From dd7e8fcefc7ef8bc48ce2dcaa1c46ce2239fa33f Mon Sep 17 00:00:00 2001 From: Jonathan Coates Date: Sat, 1 Mar 2025 22:35:29 +0000 Subject: [PATCH 6/6] Bump CC:T to 1.115.1 --- gradle.properties | 2 +- .../data/computercraft/lua/rom/help/changelog.md | 10 ++++++++++ .../data/computercraft/lua/rom/help/whatsnew.md | 12 ++++++------ 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/gradle.properties b/gradle.properties index b6ec96a87..0fa66cb6e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,7 +10,7 @@ kotlin.jvm.target.validation.mode=error # Mod properties isUnstable=false -modVersion=1.115.0 +modVersion=1.115.1 # Minecraft properties: We want to configure this here so we can read it in settings.gradle mcVersion=1.20.1 diff --git a/projects/core/src/main/resources/data/computercraft/lua/rom/help/changelog.md b/projects/core/src/main/resources/data/computercraft/lua/rom/help/changelog.md index aaaa635ac..d16716ba3 100644 --- a/projects/core/src/main/resources/data/computercraft/lua/rom/help/changelog.md +++ b/projects/core/src/main/resources/data/computercraft/lua/rom/help/changelog.md @@ -1,3 +1,13 @@ +# New features in CC: Tweaked 1.115.1 + +* Update various translations (cyb3r, kevk2156, teamer337, yakku). +* Support Fabric's item lookup API for registering media providers. + +Several bug fixes: +* Fix crashes on Create 6.0 (ellellie). +* Fix `speaker.playAudio` not updating speaker volume. +* Resize pocket lectern textures to fix issues with generating mipmaps. + # New features in CC: Tweaked 1.115.0 * Support placing pocket computers on lecterns. diff --git a/projects/core/src/main/resources/data/computercraft/lua/rom/help/whatsnew.md b/projects/core/src/main/resources/data/computercraft/lua/rom/help/whatsnew.md index 3407ffa45..ba927c761 100644 --- a/projects/core/src/main/resources/data/computercraft/lua/rom/help/whatsnew.md +++ b/projects/core/src/main/resources/data/computercraft/lua/rom/help/whatsnew.md @@ -1,11 +1,11 @@ -New features in CC: Tweaked 1.115.0 +New features in CC: Tweaked 1.115.1 -* Support placing pocket computers on lecterns. -* Suggest alternative table keys on `nil` errors. -* Errors from inside `parallel` functions now have source information attached. -* Expose printout contents to the Java API. +* Update various translations (cyb3r, kevk2156, teamer337, yakku). +* Support Fabric's item lookup API for registering media providers. Several bug fixes: -* Ignore unrepresentable characters in `char`/`paste` events. +* Fix crashes on Create 6.0 (ellellie). +* Fix `speaker.playAudio` not updating speaker volume. +* Resize pocket lectern textures to fix issues with generating mipmaps. Type "help changelog" to see the full version history.