diff --git a/doc/guides/speaker_audio.md b/doc/guides/speaker_audio.md index c1baf3479..0f9652ae4 100644 --- a/doc/guides/speaker_audio.md +++ b/doc/guides/speaker_audio.md @@ -18,7 +18,7 @@ representable value. This representation of sound - a long, uniformally sampled list of amplitudes is referred to as [Pulse-code Modulation][PCM] (PCM). PCM can be thought of as the "standard" audio format, as it's incredibly easy to work with. For -instance, to mix two pieces of audio together, you can just samples from the two tracks together and take the average. +instance, to mix two pieces of audio together, you can just add samples from the two tracks together and take the average. CC: Tweaked's speakers also work with PCM audio. It plays back 48,000 samples a second, where each sample is an integer between -128 and 127. This is more commonly referred to as 48kHz and an 8-bit resolution. diff --git a/gradle.properties b/gradle.properties index cfacb9e19..f1445a3a6 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ org.gradle.jvmargs=-Xmx3G # Mod properties -mod_version=1.100.1 +mod_version=1.100.2 # Minecraft properties (update mods.toml when changing) mc_version=1.18.1 diff --git a/src/main/java/dan200/computercraft/shared/peripheral/modem/wired/CableModemVariant.java b/src/main/java/dan200/computercraft/shared/peripheral/modem/wired/CableModemVariant.java index 60b965864..bc7bd273b 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/modem/wired/CableModemVariant.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/modem/wired/CableModemVariant.java @@ -59,7 +59,7 @@ public enum CableModemVariant implements StringRepresentable @Nonnull public static CableModemVariant from( Direction facing, boolean modem, boolean peripheral ) { - int state = (modem ? 2 : 0) + (peripheral ? 1 : 0); + int state = (modem ? 1 : 0) + (peripheral ? 2 : 0); return facing == null ? None : VALUES[1 + 6 * state + facing.get3DDataValue()]; } diff --git a/src/main/java/dan200/computercraft/shared/util/NBTUtil.java b/src/main/java/dan200/computercraft/shared/util/NBTUtil.java index 4bdaab08e..2896f285c 100644 --- a/src/main/java/dan200/computercraft/shared/util/NBTUtil.java +++ b/src/main/java/dan200/computercraft/shared/util/NBTUtil.java @@ -5,9 +5,9 @@ */ package dan200.computercraft.shared.util; +import com.google.common.io.BaseEncoding; import dan200.computercraft.ComputerCraft; import net.minecraft.nbt.*; -import org.apache.commons.codec.binary.Hex; import javax.annotation.Nonnull; import javax.annotation.Nullable; @@ -22,6 +22,8 @@ import java.util.Map; public final class NBTUtil { + private static final BaseEncoding ENCODING = BaseEncoding.base16().lowerCase(); + private NBTUtil() {} private static Tag toNBTTag( Object object ) @@ -177,7 +179,7 @@ public final class NBTUtil DataOutput output = new DataOutputStream( new DigestOutputStream( digest ) ); NbtIo.write( tag, output ); byte[] hash = digest.digest(); - return new String( Hex.encodeHex( hash ) ); + return ENCODING.encode( hash ); } catch( NoSuchAlgorithmException | IOException e ) { diff --git a/src/main/resources/assets/computercraft/lang/da_dk.json b/src/main/resources/assets/computercraft/lang/da_dk.json index 1b72f4622..5dc87bb01 100644 --- a/src/main/resources/assets/computercraft/lang/da_dk.json +++ b/src/main/resources/assets/computercraft/lang/da_dk.json @@ -39,5 +39,25 @@ "chat.computercraft.wired_modem.peripheral_disconnected": "Perifer enhed \"%s\" koblet fra netværk", "gui.computercraft.tooltip.copy": "Kopier til udklipsholder", "gui.computercraft.tooltip.computer_id": "Computer-ID: %s", - "gui.computercraft.tooltip.disk_id": "Disk-ID: %s" + "gui.computercraft.tooltip.disk_id": "Disk-ID: %s", + "gui.computercraft.tooltip.turn_on": "Tænd denne computer", + "gui.computercraft.tooltip.turn_off": "Sluk denne computer", + "gui.computercraft.tooltip.terminate.key": "Hold Ctrl+T nede", + "gui.computercraft.tooltip.turn_off.key": "Hold Ctrl+S nede", + "gui.computercraft.tooltip.terminate": "Stop den igangværende kode", + "gui.computercraft.tooltip.turn_on.key": "Hold Ctrl+R nede", + "gui.computercraft.upload.overwrite_button": "Overskriv", + "gui.computercraft.upload.overwrite.detail": "Følgende filer vil blive overskrevet ved upload. Fortsæt?%s", + "gui.computercraft.upload.success": "Upload Lykkedes", + "gui.computercraft.upload.overwrite": "Filer ville blive overskrevet", + "gui.computercraft.upload.failed.out_of_space": "Ikke nok plads på computeren til disse filer.", + "gui.computercraft.upload.failed.computer_off": "Du skal tænde computeren, før du kan uploade filer.", + "gui.computercraft.upload.failed.too_much": "Dine filer er for store til at blive uploadet.", + "gui.computercraft.upload.failed.overwrite_dir": "Kan ikke uploade %s, da der allerede er en mappe med det samme navn.", + "gui.computercraft.upload.success.msg": "%d filer uploadet.", + "gui.computercraft.upload.failed": "Upload Fejlede", + "gui.computercraft.upload.failed.name_too_long": "Filnavne er for lange til at blive uploadet.", + "gui.computercraft.upload.failed.too_many_files": "Kan ikke uploade så mange filer.", + "gui.computercraft.pocket_computer_overlay": "Lommecomputer åben. Tryk ESC for at lukke.", + "itemGroup.computercraft": "ComputerCraft" } diff --git a/src/main/resources/data/computercraft/lua/rom/help/changelog.md b/src/main/resources/data/computercraft/lua/rom/help/changelog.md index 4fb475e96..8f58dd7b3 100644 --- a/src/main/resources/data/computercraft/lua/rom/help/changelog.md +++ b/src/main/resources/data/computercraft/lua/rom/help/changelog.md @@ -1,3 +1,9 @@ +# New features in CC: Tweaked 1.100.2 + +Several bug fixes: +* Fix wired modems swapping the modem/peripheral block state. +* Remove debugging logging line from `turtle.attack`. + # New features in CC: Tweaked 1.100.1 Several bug fixes: diff --git a/src/main/resources/data/computercraft/lua/rom/help/whatsnew.md b/src/main/resources/data/computercraft/lua/rom/help/whatsnew.md index c613c9bea..bbd0e76f2 100644 --- a/src/main/resources/data/computercraft/lua/rom/help/whatsnew.md +++ b/src/main/resources/data/computercraft/lua/rom/help/whatsnew.md @@ -1,7 +1,7 @@ -New features in CC: Tweaked 1.100.1 +New features in CC: Tweaked 1.100.2 Several bug fixes: -* Fix `peripheral.hasType` not working with wired modems (Toad-Dev). -* Fix crashes when noisy pocket computer are shutdown. +* Fix wired modems swapping the modem/peripheral block state. +* Remove debugging logging line from `turtle.attack`. Type "help changelog" to see the full version history.