From 6e9799316a1514ecdf3b2fc4c9ef14734c39fe4b Mon Sep 17 00:00:00 2001 From: Jonathan Coates Date: Sun, 28 Apr 2024 18:32:19 +0100 Subject: [PATCH 01/12] Update ErrorProne --- .../src/main/kotlin/cc-tweaked.java-convention.gradle.kts | 3 +-- .../main/kotlin/cc/tweaked/gradle/CCTweakedExtension.kt | 7 +++---- gradle/libs.versions.toml | 2 +- .../peripheral/generic/GenericPeripheralProvider.java | 4 ---- .../java/dan200/computercraft/shared/util/IDAssigner.java | 1 - .../dan200/computercraft/shared/util/TickScheduler.java | 2 ++ .../mixin/gametest/GameTestSequenceMixin.java | 1 + .../mixin/gametest/client/MinecraftMixin.java | 2 +- .../mixin/gametest/client/WorldOpenFlowsMixin.java | 2 +- .../computercraft/mixin/client/GameRendererMixin.java | 2 +- .../computercraft/mixin/client/ItemFrameRendererMixin.java | 2 +- .../mixin/client/ItemInHandRendererMixin.java | 2 +- .../dan200/computercraft/mixin/client/MinecraftMixin.java | 5 +++-- .../mixin/client/MultiPlayerGameModeMixin.java | 2 +- .../computercraft/mixin/client/SoundEngineMixin.java | 4 ++-- .../java/dan200/computercraft/mixin/ChunkMapMixin.java | 4 ++-- .../main/java/dan200/computercraft/mixin/EntityMixin.java | 2 +- .../java/dan200/computercraft/mixin/ItemEntityMixin.java | 2 +- .../java/dan200/computercraft/mixin/TagsProviderMixin.java | 2 +- 19 files changed, 24 insertions(+), 27 deletions(-) diff --git a/buildSrc/src/main/kotlin/cc-tweaked.java-convention.gradle.kts b/buildSrc/src/main/kotlin/cc-tweaked.java-convention.gradle.kts index 84029760b..e5c26619d 100644 --- a/buildSrc/src/main/kotlin/cc-tweaked.java-convention.gradle.kts +++ b/buildSrc/src/main/kotlin/cc-tweaked.java-convention.gradle.kts @@ -94,9 +94,8 @@ sourceSets.all { check("InlineMeSuggester", CheckSeverity.OFF) // Minecraft uses @Deprecated liberally // Too many false positives right now. Maybe we need an indirection for it later on. check("ReferenceEquality", CheckSeverity.OFF) - check("UnusedVariable", CheckSeverity.OFF) // Too many false positives with records. + check("EnumOrdinal", CheckSeverity.OFF) // For now. We could replace most of these with EnumMap. check("OperatorPrecedence", CheckSeverity.OFF) // For now. - check("AlreadyChecked", CheckSeverity.OFF) // Seems to be broken? check("NonOverridingEquals", CheckSeverity.OFF) // Peripheral.equals makes this hard to avoid check("FutureReturnValueIgnored", CheckSeverity.OFF) // Too many false positives with Netty diff --git a/buildSrc/src/main/kotlin/cc/tweaked/gradle/CCTweakedExtension.kt b/buildSrc/src/main/kotlin/cc/tweaked/gradle/CCTweakedExtension.kt index c254d55b6..3066459e0 100644 --- a/buildSrc/src/main/kotlin/cc/tweaked/gradle/CCTweakedExtension.kt +++ b/buildSrc/src/main/kotlin/cc/tweaked/gradle/CCTweakedExtension.kt @@ -35,7 +35,6 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile import java.io.File import java.io.IOException import java.net.URI -import java.net.URL import java.util.regex.Pattern abstract class CCTweakedExtension( @@ -226,12 +225,12 @@ abstract class CCTweakedExtension( * where possible. */ fun downloadFile(label: String, url: String): File { - val url = URL(url) - val path = File(url.path) + val uri = URI(url) + val path = File(uri.path) project.repositories.ivy { name = label - setUrl(URI(url.protocol, url.userInfo, url.host, url.port, path.parent, null, null)) + setUrl(URI(uri.scheme, uri.userInfo, uri.host, uri.port, path.parent, null, null)) patternLayout { artifact("[artifact].[ext]") } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index fd7a87ec9..42534f269 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -57,7 +57,7 @@ jmh = "1.37" cctJavadoc = "1.8.2" checkstyle = "10.14.1" curseForgeGradle = "1.0.14" -errorProne-core = "2.23.0" +errorProne-core = "2.27.0" errorProne-plugin = "3.1.0" fabric-loom = "1.6.7" forgeGradle = "6.0.21" diff --git a/projects/common/src/main/java/dan200/computercraft/shared/peripheral/generic/GenericPeripheralProvider.java b/projects/common/src/main/java/dan200/computercraft/shared/peripheral/generic/GenericPeripheralProvider.java index 09670ac20..0bdce7984 100644 --- a/projects/common/src/main/java/dan200/computercraft/shared/peripheral/generic/GenericPeripheralProvider.java +++ b/projects/common/src/main/java/dan200/computercraft/shared/peripheral/generic/GenericPeripheralProvider.java @@ -13,8 +13,6 @@ import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.server.level.ServerLevel; import net.minecraft.world.level.block.entity.BlockEntity; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import javax.annotation.Nullable; import java.util.ArrayList; @@ -29,8 +27,6 @@ import java.util.Objects; * @param A platform-specific type, used for the invalidation callback. */ public final class GenericPeripheralProvider { - private static final Logger LOG = LoggerFactory.getLogger(GenericPeripheralProvider.class); - private final List> lookups = new ArrayList<>(); /** diff --git a/projects/common/src/main/java/dan200/computercraft/shared/util/IDAssigner.java b/projects/common/src/main/java/dan200/computercraft/shared/util/IDAssigner.java index fd6ec23ab..30c17f2a0 100644 --- a/projects/common/src/main/java/dan200/computercraft/shared/util/IDAssigner.java +++ b/projects/common/src/main/java/dan200/computercraft/shared/util/IDAssigner.java @@ -33,7 +33,6 @@ public final class IDAssigner { private final Path idFile; private final Path newIdFile; - private boolean atomicMove = true; private @Nullable Map ids; public IDAssigner(Path path) { diff --git a/projects/common/src/main/java/dan200/computercraft/shared/util/TickScheduler.java b/projects/common/src/main/java/dan200/computercraft/shared/util/TickScheduler.java index fd459e5c1..f54baf78e 100644 --- a/projects/common/src/main/java/dan200/computercraft/shared/util/TickScheduler.java +++ b/projects/common/src/main/java/dan200/computercraft/shared/util/TickScheduler.java @@ -4,6 +4,7 @@ package dan200.computercraft.shared.util; +import com.google.errorprone.annotations.Keep; import net.minecraft.core.BlockPos; import net.minecraft.resources.ResourceKey; import net.minecraft.server.level.ChunkLevel; @@ -132,6 +133,7 @@ public final class TickScheduler { /** * The current state of this token. */ + @Keep private volatile State $state = State.IDLE; public Token(BlockEntity owner) { diff --git a/projects/common/src/testMod/java/dan200/computercraft/mixin/gametest/GameTestSequenceMixin.java b/projects/common/src/testMod/java/dan200/computercraft/mixin/gametest/GameTestSequenceMixin.java index 48d2eaed0..33a970a7c 100644 --- a/projects/common/src/testMod/java/dan200/computercraft/mixin/gametest/GameTestSequenceMixin.java +++ b/projects/common/src/testMod/java/dan200/computercraft/mixin/gametest/GameTestSequenceMixin.java @@ -42,6 +42,7 @@ class GameTestSequenceMixin { } @Shadow + @SuppressWarnings("unused") private void tick(long tick) { } } diff --git a/projects/common/src/testMod/java/dan200/computercraft/mixin/gametest/client/MinecraftMixin.java b/projects/common/src/testMod/java/dan200/computercraft/mixin/gametest/client/MinecraftMixin.java index 52ab5c742..801bd81b6 100644 --- a/projects/common/src/testMod/java/dan200/computercraft/mixin/gametest/client/MinecraftMixin.java +++ b/projects/common/src/testMod/java/dan200/computercraft/mixin/gametest/client/MinecraftMixin.java @@ -38,7 +38,7 @@ class MinecraftMixin implements MinecraftExtensions { private final AtomicBoolean isStable = new AtomicBoolean(false); @Inject(method = "runTick", at = @At("TAIL")) - @SuppressWarnings("UnusedMethod") + @SuppressWarnings("unused") private void updateStable(boolean render, CallbackInfo ci) { isStable.set( level != null && player != null && diff --git a/projects/common/src/testMod/java/dan200/computercraft/mixin/gametest/client/WorldOpenFlowsMixin.java b/projects/common/src/testMod/java/dan200/computercraft/mixin/gametest/client/WorldOpenFlowsMixin.java index ec3c861b7..f0fbbd9c4 100644 --- a/projects/common/src/testMod/java/dan200/computercraft/mixin/gametest/client/WorldOpenFlowsMixin.java +++ b/projects/common/src/testMod/java/dan200/computercraft/mixin/gametest/client/WorldOpenFlowsMixin.java @@ -22,7 +22,7 @@ public class WorldOpenFlowsMixin { * @reason Makes it easier to run tests. We can switch to an @Inject if this becomes a problem. */ @Overwrite - @SuppressWarnings("UnusedMethod") + @SuppressWarnings("unused") private void askForBackup(Screen screen, String level, boolean customised, Runnable action) { action.run(); } diff --git a/projects/fabric/src/client/java/dan200/computercraft/mixin/client/GameRendererMixin.java b/projects/fabric/src/client/java/dan200/computercraft/mixin/client/GameRendererMixin.java index b0ca49e29..a7d123974 100644 --- a/projects/fabric/src/client/java/dan200/computercraft/mixin/client/GameRendererMixin.java +++ b/projects/fabric/src/client/java/dan200/computercraft/mixin/client/GameRendererMixin.java @@ -27,7 +27,7 @@ class GameRendererMixin { private Map shaders; @Inject(method = "reloadShaders", at = @At(value = "TAIL")) - @SuppressWarnings("UnusedMethod") + @SuppressWarnings("unused") private void onReloadShaders(ResourceProvider resourceManager, CallbackInfo ci) { try { ClientRegistry.registerShaders(resourceManager, (shader, callback) -> { diff --git a/projects/fabric/src/client/java/dan200/computercraft/mixin/client/ItemFrameRendererMixin.java b/projects/fabric/src/client/java/dan200/computercraft/mixin/client/ItemFrameRendererMixin.java index 88b766edc..5be6df1b9 100644 --- a/projects/fabric/src/client/java/dan200/computercraft/mixin/client/ItemFrameRendererMixin.java +++ b/projects/fabric/src/client/java/dan200/computercraft/mixin/client/ItemFrameRendererMixin.java @@ -22,7 +22,7 @@ class ItemFrameRendererMixin { at = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/vertex/PoseStack;mulPose(Lorg/joml/Quaternionf;)V", ordinal = 2, shift = At.Shift.AFTER), cancellable = true ) - @SuppressWarnings("UnusedMethod") + @SuppressWarnings("unused") private void render(ItemFrame entity, float yaw, float partialTicks, PoseStack pose, MultiBufferSource buffers, int light, CallbackInfo ci) { if (ClientHooks.onRenderItemFrame(pose, buffers, entity, entity.getItem(), light)) { ci.cancel(); diff --git a/projects/fabric/src/client/java/dan200/computercraft/mixin/client/ItemInHandRendererMixin.java b/projects/fabric/src/client/java/dan200/computercraft/mixin/client/ItemInHandRendererMixin.java index 7f934cb4e..3692af1d3 100644 --- a/projects/fabric/src/client/java/dan200/computercraft/mixin/client/ItemInHandRendererMixin.java +++ b/projects/fabric/src/client/java/dan200/computercraft/mixin/client/ItemInHandRendererMixin.java @@ -19,7 +19,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @Mixin(ItemInHandRenderer.class) class ItemInHandRendererMixin { @Inject(method = "renderArmWithItem", at = @At("HEAD"), cancellable = true) - @SuppressWarnings("UnusedMethod") + @SuppressWarnings("unused") private void onRenderItem( AbstractClientPlayer player, float partialTicks, float pitch, InteractionHand hand, float swingProgress, ItemStack stack, float equippedProgress, PoseStack transform, MultiBufferSource buffer, int combinedLight, CallbackInfo ci diff --git a/projects/fabric/src/client/java/dan200/computercraft/mixin/client/MinecraftMixin.java b/projects/fabric/src/client/java/dan200/computercraft/mixin/client/MinecraftMixin.java index 262439220..23244e8b9 100644 --- a/projects/fabric/src/client/java/dan200/computercraft/mixin/client/MinecraftMixin.java +++ b/projects/fabric/src/client/java/dan200/computercraft/mixin/client/MinecraftMixin.java @@ -25,13 +25,13 @@ class MinecraftMixin { private ReloadableResourceManager resourceManager; @Inject(method = "clearLevel(Lnet/minecraft/client/gui/screens/Screen;)V", at = @At("HEAD")) - @SuppressWarnings("UnusedMethod") + @SuppressWarnings("unused") private void clearLevel(Screen screen, CallbackInfo ci) { ClientHooks.onWorldUnload(); } @Inject(method = "setLevel", at = @At("HEAD")) - @SuppressWarnings("UnusedMethod") + @SuppressWarnings("unused") private void setLevel(ClientLevel screen, CallbackInfo ci) { ClientHooks.onWorldUnload(); } @@ -44,6 +44,7 @@ class MinecraftMixin { ordinal = 0 ) ) + @SuppressWarnings("unused") public void beforeInitialResourceReload(GameConfig gameConfig, CallbackInfo ci) { ClientRegistry.registerReloadListeners(resourceManager::registerReloadListener, (Minecraft) (Object) this); } diff --git a/projects/fabric/src/client/java/dan200/computercraft/mixin/client/MultiPlayerGameModeMixin.java b/projects/fabric/src/client/java/dan200/computercraft/mixin/client/MultiPlayerGameModeMixin.java index 85377cebc..484389104 100644 --- a/projects/fabric/src/client/java/dan200/computercraft/mixin/client/MultiPlayerGameModeMixin.java +++ b/projects/fabric/src/client/java/dan200/computercraft/mixin/client/MultiPlayerGameModeMixin.java @@ -31,7 +31,7 @@ class MultiPlayerGameModeMixin { cancellable = true, locals = LocalCapture.CAPTURE_FAILHARD ) - @SuppressWarnings("UnusedMethod") + @SuppressWarnings("unused") private void onBlockBreak(BlockPos pos, CallbackInfoReturnable cir, Level level, BlockState state, Block block) { if (!FabricCommonHooks.onBlockDestroy(level, minecraft.player, pos, state, null)) cir.setReturnValue(true); } diff --git a/projects/fabric/src/client/java/dan200/computercraft/mixin/client/SoundEngineMixin.java b/projects/fabric/src/client/java/dan200/computercraft/mixin/client/SoundEngineMixin.java index 95b1c7555..943d3207a 100644 --- a/projects/fabric/src/client/java/dan200/computercraft/mixin/client/SoundEngineMixin.java +++ b/projects/fabric/src/client/java/dan200/computercraft/mixin/client/SoundEngineMixin.java @@ -26,13 +26,13 @@ class SoundEngineMixin { private static SoundEngine self; @Inject(method = "play", at = @At(value = "HEAD")) - @SuppressWarnings("UnusedMethod") + @SuppressWarnings("unused") private void playSound(SoundInstance sound, CallbackInfo ci) { self = (SoundEngine) (Object) this; } @Inject(at = @At("TAIL"), method = "method_19755") - @SuppressWarnings("UnusedMethod") + @SuppressWarnings("unused") private static void onStream(AudioStream stream, Channel channel, CallbackInfo ci) { SpeakerManager.onPlayStreaming(assertNonNull(self), channel, stream); } diff --git a/projects/fabric/src/main/java/dan200/computercraft/mixin/ChunkMapMixin.java b/projects/fabric/src/main/java/dan200/computercraft/mixin/ChunkMapMixin.java index 29512445b..f99aca02b 100644 --- a/projects/fabric/src/main/java/dan200/computercraft/mixin/ChunkMapMixin.java +++ b/projects/fabric/src/main/java/dan200/computercraft/mixin/ChunkMapMixin.java @@ -29,13 +29,13 @@ class ChunkMapMixin { ServerLevel level; @Inject(method = "playerLoadedChunk", at = @At("TAIL")) - @SuppressWarnings("UnusedMethod") + @SuppressWarnings("unused") private void onPlayerLoadedChunk(ServerPlayer player, MutableObject packetCache, LevelChunk chunk, CallbackInfo callback) { CommonHooks.onChunkWatch(chunk, player); } @Inject(method = "updateChunkScheduling", at = @At("HEAD")) - @SuppressWarnings("UnusedMethod") + @SuppressWarnings("unused") private void onUpdateChunkScheduling(long chunkPos, int newLevel, @Nullable ChunkHolder holder, int oldLevel, CallbackInfoReturnable callback) { CommonHooks.onChunkTicketLevelChanged(level, chunkPos, oldLevel, newLevel); } diff --git a/projects/fabric/src/main/java/dan200/computercraft/mixin/EntityMixin.java b/projects/fabric/src/main/java/dan200/computercraft/mixin/EntityMixin.java index 5e97f4e5c..8014b5dee 100644 --- a/projects/fabric/src/main/java/dan200/computercraft/mixin/EntityMixin.java +++ b/projects/fabric/src/main/java/dan200/computercraft/mixin/EntityMixin.java @@ -20,7 +20,7 @@ class EntityMixin { at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/Level;addFreshEntity(Lnet/minecraft/world/entity/Entity;)Z"), cancellable = true ) - @SuppressWarnings("UnusedMethod") + @SuppressWarnings("unused") private void spawnAtLocation(ItemStack stack, float yOffset, CallbackInfoReturnable cb) { if (CommonHooks.onLivingDrop((Entity) (Object) this, stack)) cb.setReturnValue(null); } diff --git a/projects/fabric/src/main/java/dan200/computercraft/mixin/ItemEntityMixin.java b/projects/fabric/src/main/java/dan200/computercraft/mixin/ItemEntityMixin.java index 71c94154f..8dc004b9e 100644 --- a/projects/fabric/src/main/java/dan200/computercraft/mixin/ItemEntityMixin.java +++ b/projects/fabric/src/main/java/dan200/computercraft/mixin/ItemEntityMixin.java @@ -16,7 +16,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @Mixin(ItemEntity.class) abstract class ItemEntityMixin { @Inject(method = "tick", at = @At("HEAD")) - @SuppressWarnings("UnusedMethod") + @SuppressWarnings("unused") private void onTick(CallbackInfo ci) { var stack = getItem(); if (stack.getItem() instanceof PocketComputerItem pocket) { diff --git a/projects/fabric/src/main/java/dan200/computercraft/mixin/TagsProviderMixin.java b/projects/fabric/src/main/java/dan200/computercraft/mixin/TagsProviderMixin.java index 2e844e5c8..bcef75dca 100644 --- a/projects/fabric/src/main/java/dan200/computercraft/mixin/TagsProviderMixin.java +++ b/projects/fabric/src/main/java/dan200/computercraft/mixin/TagsProviderMixin.java @@ -21,7 +21,7 @@ import java.util.function.Predicate; @Mixin(TagsProvider.class) class TagsProviderMixin { @Inject(at = @At("HEAD"), method = "method_49658", cancellable = true) - @SuppressWarnings("UnusedMethod") + @SuppressWarnings("unused") private static void onVerifyPresent(Predicate predicate1, Predicate predicate2, TagEntry tag, CallbackInfoReturnable cir) { var element = ((TagEntryAccessor) tag).computercraft$elementOrTag(); if (element.tag() && element.id().getNamespace().equals("minecraft")) cir.setReturnValue(false); From 735e7ce09b3bd62ee73ee9fa08fe16cfb5e70a8a Mon Sep 17 00:00:00 2001 From: Weblate Date: Mon, 29 Apr 2024 19:00:14 +0000 Subject: [PATCH 02/12] Translations for Italian Co-authored-by: Alessandro --- .../assets/computercraft/lang/it_it.json | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/projects/common/src/main/resources/assets/computercraft/lang/it_it.json b/projects/common/src/main/resources/assets/computercraft/lang/it_it.json index 68f7db998..c9ac0babc 100644 --- a/projects/common/src/main/resources/assets/computercraft/lang/it_it.json +++ b/projects/common/src/main/resources/assets/computercraft/lang/it_it.json @@ -218,5 +218,18 @@ "upgrade.minecraft.diamond_hoe.adjective": "Contadina", "upgrade.minecraft.diamond_pickaxe.adjective": "Minatrice", "upgrade.minecraft.diamond_shovel.adjective": "Scavatrice", - "upgrade.minecraft.diamond_sword.adjective": "Da Combattimento" + "upgrade.minecraft.diamond_sword.adjective": "Da Combattimento", + "tag.item.computercraft.computer": "Computer", + "tag.item.computercraft.wired_modem": "Modem cablati", + "argument.computercraft.computer.distance": "Distanza dall'entità", + "argument.computercraft.computer.family": "Famiglia computer", + "argument.computercraft.computer.id": "ID computer", + "argument.computercraft.computer.instance": "ID istanza unica", + "argument.computercraft.computer.label": "Etichetta computer", + "argument.computercraft.unknown_computer_family": "Famiglia computer '%s' sconosciuta", + "gui.computercraft.config.disabled_generic_methods": "Metodi generici disattivati", + "gui.computercraft.config.disabled_generic_methods.tooltip": "Una lista di metodi generici o sorgenti di metodi da disattivare. I metodi generici sono\nmetodi aggiunti a blocchi/entità blocchi quando non c'è un provider della periferica esplicito.\nQuesto include metodi dell'inventario (ad es. inventory.getItemDetail, inventory.pushItems) e,\nse su Forge, i metodi fluid_storage e energy_storage.\nI metodi in questa lista possono essere sia un gruppo intero di metodi (computer:inventory)\no un singolo metodo (computer:inventory#pushItems).\n", + "tag.item.computercraft.monitor": "Monitor", + "tag.item.computercraft.turtle": "Tartarughe", + "tracking_field.computercraft.java_allocation.name": "Allocazioni Java" } From de930c8d09a3a8560439ea43ab9a6e475b9fd03d Mon Sep 17 00:00:00 2001 From: Jonathan Coates Date: Tue, 30 Apr 2024 21:58:07 +0100 Subject: [PATCH 03/12] Split up turtle textures (#1813) Turtles currently read their textures from a single 128x128 sprite sheet. Most of this texture is unused which means we end up wasting a lot of the block texture atlas[^1]. This change splits up the turtle textures into individual 32x32 textures[^2], one for each side, and then an additional backpack texture. I'm very sorry to any resource pack artists out there. The tools/update-resources.py script will update existing packs, but does not (currently) handle non-standard resolutions. [^1]: It used to be worse: https://github.com/dan200/ComputerCraft/issues/145 [^2]: Turtle textures are a bit weird, in that they mostly *look* 16x16, but have some detail in places. --- .../kotlin/cc/tweaked/gradle/MergeTrees.kt | 1 - .../models/block/turtle_advanced.json | 13 +++- .../models/block/turtle_normal.json | 13 +++- .../data/BlockModelProvider.java | 16 ++++- .../models/block/turtle_base.json | 24 +++---- .../models/block/turtle_colour.json | 60 +++++++++++------- .../models/block/turtle_elf_overlay.json | 37 +++++++++-- .../models/block/turtle_overlay.json | 43 ------------- .../textures/block/turtle_advanced.png | Bin 1686 -> 0 bytes .../textures/block/turtle_advanced_back.png | Bin 0 -> 533 bytes .../block/turtle_advanced_backpack.png | Bin 0 -> 489 bytes .../textures/block/turtle_advanced_bottom.png | Bin 0 -> 421 bytes .../textures/block/turtle_advanced_front.png | Bin 0 -> 495 bytes .../textures/block/turtle_advanced_left.png | Bin 0 -> 502 bytes .../textures/block/turtle_advanced_right.png | Bin 0 -> 517 bytes .../textures/block/turtle_advanced_top.png | Bin 0 -> 490 bytes .../textures/block/turtle_colour.png | Bin 2344 -> 0 bytes .../block/turtle_colour_body_back.png | Bin 0 -> 258 bytes .../block/turtle_colour_body_backpack.png | Bin 0 -> 229 bytes .../block/turtle_colour_body_bottom.png | Bin 0 -> 361 bytes .../block/turtle_colour_body_front.png | Bin 0 -> 247 bytes .../block/turtle_colour_body_left.png | Bin 0 -> 292 bytes .../block/turtle_colour_body_right.png | Bin 0 -> 253 bytes .../textures/block/turtle_colour_body_top.png | Bin 0 -> 168 bytes .../block/turtle_colour_frame_back.png | Bin 0 -> 235 bytes .../block/turtle_colour_frame_backpack.png | Bin 0 -> 191 bytes .../block/turtle_colour_frame_bottom.png | Bin 0 -> 233 bytes .../block/turtle_colour_frame_front.png | Bin 0 -> 203 bytes .../block/turtle_colour_frame_left.png | Bin 0 -> 225 bytes .../block/turtle_colour_frame_right.png | Bin 0 -> 184 bytes .../block/turtle_colour_frame_top.png | Bin 0 -> 185 bytes .../textures/block/turtle_elf_overlay.png | Bin 1681 -> 0 bytes .../block/turtle_elf_overlay_back.png | Bin 0 -> 338 bytes .../block/turtle_elf_overlay_backpack.png | Bin 0 -> 483 bytes .../block/turtle_elf_overlay_front.png | Bin 0 -> 234 bytes .../block/turtle_elf_overlay_left.png | Bin 0 -> 233 bytes .../block/turtle_elf_overlay_right.png | Bin 0 -> 272 bytes .../textures/block/turtle_elf_overlay_top.png | Bin 0 -> 590 bytes .../textures/block/turtle_normal.png | Bin 1096 -> 0 bytes .../textures/block/turtle_normal_back.png | Bin 0 -> 397 bytes .../textures/block/turtle_normal_backpack.png | Bin 0 -> 287 bytes .../textures/block/turtle_normal_bottom.png | Bin 0 -> 350 bytes .../textures/block/turtle_normal_front.png | Bin 0 -> 410 bytes .../textures/block/turtle_normal_left.png | Bin 0 -> 408 bytes .../textures/block/turtle_normal_right.png | Bin 0 -> 393 bytes .../textures/block/turtle_normal_top.png | Bin 0 -> 340 bytes .../textures/block/turtle_rainbow_overlay.png | Bin 596 -> 186 bytes .../textures/block/turtle_trans_overlay.png | Bin 4303 -> 154 bytes tools/update-resources.py | 51 +++++++++++++++ 49 files changed, 171 insertions(+), 87 deletions(-) delete mode 100644 projects/common/src/main/resources/assets/computercraft/models/block/turtle_overlay.json delete mode 100644 projects/common/src/main/resources/assets/computercraft/textures/block/turtle_advanced.png create mode 100644 projects/common/src/main/resources/assets/computercraft/textures/block/turtle_advanced_back.png create mode 100644 projects/common/src/main/resources/assets/computercraft/textures/block/turtle_advanced_backpack.png create mode 100644 projects/common/src/main/resources/assets/computercraft/textures/block/turtle_advanced_bottom.png create mode 100644 projects/common/src/main/resources/assets/computercraft/textures/block/turtle_advanced_front.png create mode 100644 projects/common/src/main/resources/assets/computercraft/textures/block/turtle_advanced_left.png create mode 100644 projects/common/src/main/resources/assets/computercraft/textures/block/turtle_advanced_right.png create mode 100644 projects/common/src/main/resources/assets/computercraft/textures/block/turtle_advanced_top.png delete mode 100644 projects/common/src/main/resources/assets/computercraft/textures/block/turtle_colour.png create mode 100644 projects/common/src/main/resources/assets/computercraft/textures/block/turtle_colour_body_back.png create mode 100644 projects/common/src/main/resources/assets/computercraft/textures/block/turtle_colour_body_backpack.png create mode 100644 projects/common/src/main/resources/assets/computercraft/textures/block/turtle_colour_body_bottom.png create mode 100644 projects/common/src/main/resources/assets/computercraft/textures/block/turtle_colour_body_front.png create mode 100644 projects/common/src/main/resources/assets/computercraft/textures/block/turtle_colour_body_left.png create mode 100644 projects/common/src/main/resources/assets/computercraft/textures/block/turtle_colour_body_right.png create mode 100644 projects/common/src/main/resources/assets/computercraft/textures/block/turtle_colour_body_top.png create mode 100644 projects/common/src/main/resources/assets/computercraft/textures/block/turtle_colour_frame_back.png create mode 100644 projects/common/src/main/resources/assets/computercraft/textures/block/turtle_colour_frame_backpack.png create mode 100644 projects/common/src/main/resources/assets/computercraft/textures/block/turtle_colour_frame_bottom.png create mode 100644 projects/common/src/main/resources/assets/computercraft/textures/block/turtle_colour_frame_front.png create mode 100644 projects/common/src/main/resources/assets/computercraft/textures/block/turtle_colour_frame_left.png create mode 100644 projects/common/src/main/resources/assets/computercraft/textures/block/turtle_colour_frame_right.png create mode 100644 projects/common/src/main/resources/assets/computercraft/textures/block/turtle_colour_frame_top.png delete mode 100644 projects/common/src/main/resources/assets/computercraft/textures/block/turtle_elf_overlay.png create mode 100644 projects/common/src/main/resources/assets/computercraft/textures/block/turtle_elf_overlay_back.png create mode 100644 projects/common/src/main/resources/assets/computercraft/textures/block/turtle_elf_overlay_backpack.png create mode 100644 projects/common/src/main/resources/assets/computercraft/textures/block/turtle_elf_overlay_front.png create mode 100644 projects/common/src/main/resources/assets/computercraft/textures/block/turtle_elf_overlay_left.png create mode 100644 projects/common/src/main/resources/assets/computercraft/textures/block/turtle_elf_overlay_right.png create mode 100644 projects/common/src/main/resources/assets/computercraft/textures/block/turtle_elf_overlay_top.png delete mode 100644 projects/common/src/main/resources/assets/computercraft/textures/block/turtle_normal.png create mode 100644 projects/common/src/main/resources/assets/computercraft/textures/block/turtle_normal_back.png create mode 100644 projects/common/src/main/resources/assets/computercraft/textures/block/turtle_normal_backpack.png create mode 100644 projects/common/src/main/resources/assets/computercraft/textures/block/turtle_normal_bottom.png create mode 100644 projects/common/src/main/resources/assets/computercraft/textures/block/turtle_normal_front.png create mode 100644 projects/common/src/main/resources/assets/computercraft/textures/block/turtle_normal_left.png create mode 100644 projects/common/src/main/resources/assets/computercraft/textures/block/turtle_normal_right.png create mode 100644 projects/common/src/main/resources/assets/computercraft/textures/block/turtle_normal_top.png mode change 100644 => 100755 tools/update-resources.py diff --git a/buildSrc/src/main/kotlin/cc/tweaked/gradle/MergeTrees.kt b/buildSrc/src/main/kotlin/cc/tweaked/gradle/MergeTrees.kt index 16074cb93..21754f563 100644 --- a/buildSrc/src/main/kotlin/cc/tweaked/gradle/MergeTrees.kt +++ b/buildSrc/src/main/kotlin/cc/tweaked/gradle/MergeTrees.kt @@ -98,7 +98,6 @@ abstract class MergeTrees : DefaultTask() { } val sharedFiles = files.entries.asSequence().filter { (_, v) -> v.found == sources.size }.map { (k, _) -> k }.toList() - println(sharedFiles) // Copy shared files to the common directory fsOperations.sync { diff --git a/projects/common/src/generated/resources/assets/computercraft/models/block/turtle_advanced.json b/projects/common/src/generated/resources/assets/computercraft/models/block/turtle_advanced.json index 99ba96d2c..b149f4869 100644 --- a/projects/common/src/generated/resources/assets/computercraft/models/block/turtle_advanced.json +++ b/projects/common/src/generated/resources/assets/computercraft/models/block/turtle_advanced.json @@ -1 +1,12 @@ -{"parent": "computercraft:block/turtle_base", "textures": {"texture": "computercraft:block/turtle_advanced"}} +{ + "parent": "computercraft:block/turtle_base", + "textures": { + "back": "computercraft:block/turtle_advanced_back", + "backpack": "computercraft:block/turtle_advanced_backpack", + "bottom": "computercraft:block/turtle_advanced_bottom", + "front": "computercraft:block/turtle_advanced_front", + "left": "computercraft:block/turtle_advanced_left", + "right": "computercraft:block/turtle_advanced_right", + "top": "computercraft:block/turtle_advanced_top" + } +} diff --git a/projects/common/src/generated/resources/assets/computercraft/models/block/turtle_normal.json b/projects/common/src/generated/resources/assets/computercraft/models/block/turtle_normal.json index a3ea9a7f4..c73e5333c 100644 --- a/projects/common/src/generated/resources/assets/computercraft/models/block/turtle_normal.json +++ b/projects/common/src/generated/resources/assets/computercraft/models/block/turtle_normal.json @@ -1 +1,12 @@ -{"parent": "computercraft:block/turtle_base", "textures": {"texture": "computercraft:block/turtle_normal"}} +{ + "parent": "computercraft:block/turtle_base", + "textures": { + "back": "computercraft:block/turtle_normal_back", + "backpack": "computercraft:block/turtle_normal_backpack", + "bottom": "computercraft:block/turtle_normal_bottom", + "front": "computercraft:block/turtle_normal_front", + "left": "computercraft:block/turtle_normal_left", + "right": "computercraft:block/turtle_normal_right", + "top": "computercraft:block/turtle_normal_top" + } +} diff --git a/projects/common/src/main/java/dan200/computercraft/data/BlockModelProvider.java b/projects/common/src/main/java/dan200/computercraft/data/BlockModelProvider.java index d05d8c308..c0c9f3491 100644 --- a/projects/common/src/main/java/dan200/computercraft/data/BlockModelProvider.java +++ b/projects/common/src/main/java/dan200/computercraft/data/BlockModelProvider.java @@ -38,6 +38,9 @@ import static net.minecraft.data.models.model.TextureMapping.getBlockTexture; class BlockModelProvider { private static final TextureSlot CURSOR = TextureSlot.create("cursor"); + private static final TextureSlot LEFT = TextureSlot.create("left"); + private static final TextureSlot RIGHT = TextureSlot.create("right"); + private static final TextureSlot BACKPACK = TextureSlot.create("backpack"); private static final ModelTemplate COMPUTER_ON = new ModelTemplate( Optional.of(new ResourceLocation(ComputerCraftAPI.MOD_ID, "block/computer_on")), @@ -58,7 +61,7 @@ class BlockModelProvider { private static final ModelTemplate TURTLE = new ModelTemplate( Optional.of(new ResourceLocation(ComputerCraftAPI.MOD_ID, "block/turtle_base")), Optional.empty(), - TextureSlot.TEXTURE + TextureSlot.FRONT, TextureSlot.BACK, TextureSlot.TOP, TextureSlot.BOTTOM, LEFT, RIGHT, BACKPACK ); private static final ModelTemplate TURTLE_UPGRADE_LEFT = new ModelTemplate( Optional.of(new ResourceLocation(ComputerCraftAPI.MOD_ID, "block/turtle_upgrade_base_left")), @@ -167,7 +170,16 @@ class BlockModelProvider { } private static void registerTurtle(BlockModelGenerators generators, TurtleBlock block) { - var model = TURTLE.create(block, TextureMapping.defaultTexture(block), generators.modelOutput); + var model = TURTLE.create(block, new TextureMapping() + .put(TextureSlot.FRONT, getBlockTexture(block, "_front")) + .put(TextureSlot.BACK, getBlockTexture(block, "_back")) + .put(TextureSlot.TOP, getBlockTexture(block, "_top")) + .put(TextureSlot.BOTTOM, getBlockTexture(block, "_bottom")) + .put(LEFT, getBlockTexture(block, "_left")) + .put(RIGHT, getBlockTexture(block, "_right")) + .put(BACKPACK, getBlockTexture(block, "_backpack")), + generators.modelOutput + ); generators.blockStateOutput.accept( MultiVariantGenerator.multiVariant(block, Variant.variant().with(VariantProperties.MODEL, model)) .with(createHorizontalFacingDispatch()) diff --git a/projects/common/src/main/resources/assets/computercraft/models/block/turtle_base.json b/projects/common/src/main/resources/assets/computercraft/models/block/turtle_base.json index 52ae637d4..d526ac215 100644 --- a/projects/common/src/main/resources/assets/computercraft/models/block/turtle_base.json +++ b/projects/common/src/main/resources/assets/computercraft/models/block/turtle_base.json @@ -2,30 +2,30 @@ "parent": "block/block", "render_type": "translucent", "textures": { - "particle": "#texture" + "particle": "#front" }, "elements": [ { "from": [ 2, 2, 2 ], "to": [ 14, 14, 13 ], "faces": { - "down": { "uv": [ 5.75, 2.75, 2.75, 0 ], "texture": "#texture" }, - "up": { "uv": [ 8.75, 0, 5.75, 2.75 ], "texture": "#texture" }, - "north": { "uv": [ 11.5, 5.75, 8.5, 2.75 ], "texture": "#texture" }, - "south": { "uv": [ 5.75, 5.75, 2.75, 2.75 ], "texture": "#texture" }, - "west": { "uv": [ 8.5, 5.75, 5.75, 2.75 ], "texture": "#texture" }, - "east": { "uv": [ 2.75, 5.75, 0, 2.75 ], "texture": "#texture" } + "down": { "uv": [ 0, 0, 12, 11 ], "texture": "#bottom" }, + "up": { "uv": [ 0, 0, 12, 11 ], "texture": "#top" }, + "north": { "uv": [ 0, 0, 12, 12 ], "texture": "#front" }, + "south": { "uv": [ 0, 0, 12, 12 ], "texture": "#back" }, + "west": { "uv": [ 0, 0, 11, 12 ], "texture": "#left" }, + "east": { "uv": [ 0, 0, 11, 12 ], "texture": "#right" } } }, { "from": [ 3, 6, 13 ], "to": [ 13, 13, 15 ], "faces": { - "down": { "uv": [ 11.75, 0.5, 9.25, 0 ], "texture": "#texture" }, - "up": { "uv": [ 14.25, 0, 11.75, 0.5 ], "texture": "#texture" }, - "south": { "uv": [ 11.75, 2.25, 9.25, 0.5 ], "texture": "#texture" }, - "west": { "uv": [ 12.25, 2.25, 11.75, 0.5 ], "texture": "#texture" }, - "east": { "uv": [ 9.25, 2.25, 8.75, 0.5 ], "texture": "#texture" } + "down": { "uv": [ 2, 9, 12, 11 ], "texture": "#backpack" }, + "up": { "uv": [ 2, 0, 12, 2 ], "texture": "#backpack" }, + "south": { "uv": [ 2, 2, 12, 9 ], "texture": "#backpack" }, + "west": { "uv": [ 0, 2, 2, 9 ], "texture": "#backpack" }, + "east": { "uv": [ 12, 2, 14, 9 ], "texture": "#backpack" } } } ] diff --git a/projects/common/src/main/resources/assets/computercraft/models/block/turtle_colour.json b/projects/common/src/main/resources/assets/computercraft/models/block/turtle_colour.json index d40487d67..652791dae 100644 --- a/projects/common/src/main/resources/assets/computercraft/models/block/turtle_colour.json +++ b/projects/common/src/main/resources/assets/computercraft/models/block/turtle_colour.json @@ -1,53 +1,67 @@ { "parent": "computercraft:block/turtle_base", "textures": { - "texture": "computercraft:block/turtle_colour" + "texture": "computercraft:block/turtle_colour", + "body_back": "computercraft:block/turtle_colour_body_back", + "body_backpack": "computercraft:block/turtle_colour_body_backpack", + "body_bottom": "computercraft:block/turtle_colour_body_bottom", + "body_front": "computercraft:block/turtle_colour_body_front", + "body_left": "computercraft:block/turtle_colour_body_left", + "body_right": "computercraft:block/turtle_colour_body_right", + "body_top": "computercraft:block/turtle_colour_body_top", + "frame_back": "computercraft:block/turtle_colour_frame_back", + "frame_backpack": "computercraft:block/turtle_colour_frame_backpack", + "frame_bottom": "computercraft:block/turtle_colour_frame_bottom", + "frame_front": "computercraft:block/turtle_colour_frame_front", + "frame_left": "computercraft:block/turtle_colour_frame_left", + "frame_right": "computercraft:block/turtle_colour_frame_right", + "frame_top": "computercraft:block/turtle_colour_frame_top" }, "elements": [ { "from": [ 2, 2, 2 ], "to": [ 14, 14, 13 ], "faces": { - "down": { "uv": [ 5.75, 8.5, 2.75, 5.75 ], "texture": "#texture", "tintindex": 0 }, - "up": { "uv": [ 8.75, 5.75, 5.75, 8.5 ], "texture": "#texture", "tintindex": 0 }, - "north": { "uv": [ 11.5, 11.5, 8.5, 8.5 ], "texture": "#texture", "tintindex": 0 }, - "south": { "uv": [ 5.75, 11.5, 2.75, 8.5 ], "texture": "#texture", "tintindex": 0 }, - "west": { "uv": [ 8.5, 11.5, 5.75, 8.555 ], "texture": "#texture", "tintindex": 0 }, - "east": { "uv": [ 2.75, 11.5, 0, 8.5 ], "texture": "#texture", "tintindex": 0 } + "down": { "uv": [ 0, 0, 12, 11 ], "texture": "#body_bottom", "tintindex": 0 }, + "up": { "uv": [ 0, 0, 12, 11 ], "texture": "#body_top", "tintindex": 0 }, + "north": { "uv": [ 0, 0, 12, 12 ], "texture": "#body_front", "tintindex": 0 }, + "south": { "uv": [ 0, 0, 12, 12 ], "texture": "#body_back", "tintindex": 0 }, + "west": { "uv": [ 0, 0, 11, 12 ], "texture": "#body_left", "tintindex": 0 }, + "east": { "uv": [ 0, 0, 11, 12 ], "texture": "#body_right", "tintindex": 0 } } }, { "from": [ 3, 6, 13 ], "to": [ 13, 13, 15 ], "faces": { - "down": { "uv": [ 11.75, 6.25, 9.25, 5.75 ], "texture": "#texture", "tintindex": 0 }, - "up": { "uv": [ 14.25, 5.75, 11.75, 6.25 ], "texture": "#texture", "tintindex": 0 }, - "south": { "uv": [ 11.75, 8, 9.25, 6.25 ], "texture": "#texture", "tintindex": 0 }, - "west": { "uv": [ 12.25, 8, 11.75, 6.25 ], "texture": "#texture", "tintindex": 0 }, - "east": { "uv": [ 9.25, 8, 8.75, 6.25 ], "texture": "#texture", "tintindex": 0 } + "down": { "uv": [ 2, 9, 12, 11 ], "texture": "#body_backpack", "tintindex": 0 }, + "up": { "uv": [ 2, 0, 12, 2 ], "texture": "#body_backpack", "tintindex": 0 }, + "south": { "uv": [ 2, 2, 12, 9 ], "texture": "#body_backpack", "tintindex": 0 }, + "west": { "uv": [ 0, 2, 2, 9 ], "texture": "#body_backpack", "tintindex": 0 }, + "east": { "uv": [ 12, 2, 14, 9 ], "texture": "#body_backpack", "tintindex": 0 } } }, { "from": [ 2, 2, 2 ], "to": [ 14, 14, 13 ], "faces": { - "down": { "uv": [ 5.75, 2.75, 2.75, 0 ], "texture": "#texture" }, - "up": { "uv": [ 8.75, 0, 5.75, 2.75 ], "texture": "#texture" }, - "north": { "uv": [ 11.5, 5.75, 8.5, 2.75 ], "texture": "#texture" }, - "south": { "uv": [ 5.75, 5.75, 2.75, 2.75 ], "texture": "#texture" }, - "west": { "uv": [ 8.5, 5.75, 5.75, 2.75 ], "texture": "#texture" }, - "east": { "uv": [ 2.75, 5.75, 0, 2.75 ], "texture": "#texture" } + "down": { "uv": [ 0, 0, 12, 11 ], "texture": "#frame_bottom" }, + "up": { "uv": [ 0, 0, 12, 11 ], "texture": "#frame_top" }, + "north": { "uv": [ 0, 0, 12, 12 ], "texture": "#frame_front" }, + "south": { "uv": [ 0, 0, 12, 12 ], "texture": "#frame_back" }, + "west": { "uv": [ 0, 0, 11, 12 ], "texture": "#frame_left" }, + "east": { "uv": [ 0, 0, 11, 12 ], "texture": "#frame_right" } } }, { "from": [ 3, 6, 13 ], "to": [ 13, 13, 15 ], "faces": { - "down": { "uv": [ 11.75, 0.5, 9.25, 0 ], "texture": "#texture" }, - "up": { "uv": [ 14.25, 0, 11.75, 0.5 ], "texture": "#texture" }, - "south": { "uv": [ 11.75, 2.25, 9.25, 0.5 ], "texture": "#texture" }, - "west": { "uv": [ 12.25, 2.25, 11.75, 0.5 ], "texture": "#texture" }, - "east": { "uv": [ 9.25, 2.25, 8.75, 0.5 ], "texture": "#texture" } + "down": { "uv": [ 2, 9, 12, 11 ], "texture": "#frame_backpack" }, + "up": { "uv": [ 2, 0, 12, 2 ], "texture": "#frame_backpack" }, + "south": { "uv": [ 2, 2, 12, 9 ], "texture": "#frame_backpack" }, + "west": { "uv": [ 0, 2, 2, 9 ], "texture": "#frame_backpack" }, + "east": { "uv": [ 12, 2, 14, 9 ], "texture": "#frame_backpack" } } } ] diff --git a/projects/common/src/main/resources/assets/computercraft/models/block/turtle_elf_overlay.json b/projects/common/src/main/resources/assets/computercraft/models/block/turtle_elf_overlay.json index 047576123..66495626a 100644 --- a/projects/common/src/main/resources/assets/computercraft/models/block/turtle_elf_overlay.json +++ b/projects/common/src/main/resources/assets/computercraft/models/block/turtle_elf_overlay.json @@ -1,6 +1,35 @@ { - "parent": "computercraft:block/turtle_overlay", + "parent": "block/block", "textures": { - "texture": "computercraft:block/turtle_elf_overlay" - } -} + "back": "computercraft:block/turtle_elf_overlay_back", + "backpack": "computercraft:block/turtle_elf_overlay_backpack", + "front": "computercraft:block/turtle_elf_overlay_front", + "left": "computercraft:block/turtle_elf_overlay_left", + "right": "computercraft:block/turtle_elf_overlay_right", + "top": "computercraft:block/turtle_elf_overlay_top" + }, + "elements": [ + { + "from": [ 2, 2, 2 ], + "to": [ 14, 14, 13 ], + "faces": { + "up": { "uv": [ 0, 0, 12, 11 ], "texture": "#top" }, + "north": { "uv": [ 0, 0, 12, 12 ], "texture": "#front" }, + "south": { "uv": [ 0, 0, 12, 12 ], "texture": "#back" }, + "west": { "uv": [ 0, 0, 11, 12 ], "texture": "#left" }, + "east": { "uv": [ 0, 0, 11, 12 ], "texture": "#right" } + } + }, + { + "from": [ 3, 6, 13 ], + "to": [ 13, 13, 15 ], + "faces": { + "down": { "uv": [ 2, 9, 12, 11 ], "texture": "#backpack" }, + "up": { "uv": [ 2, 0, 12, 2 ], "texture": "#backpack" }, + "south": { "uv": [ 2, 2, 12, 9 ], "texture": "#backpack" }, + "west": { "uv": [ 0, 2, 2, 9 ], "texture": "#backpack" }, + "east": { "uv": [ 12, 2, 14, 9 ], "texture": "#backpack" } + } + } + ] + } diff --git a/projects/common/src/main/resources/assets/computercraft/models/block/turtle_overlay.json b/projects/common/src/main/resources/assets/computercraft/models/block/turtle_overlay.json deleted file mode 100644 index 906b68a82..000000000 --- a/projects/common/src/main/resources/assets/computercraft/models/block/turtle_overlay.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "parent": "block/block", - "textures": { - "particle": "#texture" - }, - "elements": [ - { - "from": [ 2, 2, 2 ], - "to": [ 14, 14, 13 ], - "faces": { - "down": { "uv": [ 2.75, 0, 5.75, 2.75 ], "texture": "#texture" }, - "up": { "uv": [ 5.75, 0, 8.75, 2.75 ], "texture": "#texture" }, - "north": { "uv": [ 8.5, 5.75, 11.5, 2.75 ], "texture": "#texture" }, - "south": { "uv": [ 2.75, 5.75, 5.75, 2.75 ], "texture": "#texture" }, - "west": { "uv": [ 0, 5.75, 2.75, 2.75 ], "texture": "#texture" }, - "east": { "uv": [ 5.75, 5.75, 8.5, 2.75 ], "texture": "#texture" } - } - }, - { - "from": [ 3, 6, 13 ], - "to": [ 13, 13, 15 ], - "faces": { - "down": { "uv": [ 9.25, 0, 11.75, 0.5 ], "texture": "#texture" }, - "up": { "uv": [ 11.75, 0, 14.25, 0.5 ], "texture": "#texture" }, - "south": { "uv": [ 9.25, 2.25, 11.75, 0.5 ], "texture": "#texture" }, - "west": { "uv": [ 8.75, 2.25, 9.25, 0.5 ], "texture": "#texture" }, - "east": { "uv": [ 11.75, 2.25, 12.25, 0.5 ], "texture": "#texture" } - } - }, - { - "from": [ 1.5, 1.5, 1.5 ], - "to": [ 14.5, 14.5, 13.5 ], - "faces": { - "down": { "uv": [ 2.75, 8, 5.75, 10.75 ], "texture": "#texture" }, - "up": { "uv": [ 5.75, 8, 8.75, 10.75 ], "texture": "#texture" }, - "north": { "uv": [ 8.5, 13.75, 11.5, 10.75 ], "texture": "#texture" }, - "south": { "uv": [ 2.75, 13.75, 5.75, 10.75 ], "texture": "#texture" }, - "west": { "uv": [ 0, 13.75, 2.75, 10.75 ], "texture": "#texture" }, - "east": { "uv": [ 5.75, 13.75, 8.5, 10.75 ], "texture": "#texture" } - } - } - ] -} diff --git a/projects/common/src/main/resources/assets/computercraft/textures/block/turtle_advanced.png b/projects/common/src/main/resources/assets/computercraft/textures/block/turtle_advanced.png deleted file mode 100644 index cf617d963293c3a39c5bb8c8ae121b52b621b5eb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1686 zcmaJ>c~Db%5>6mW0SM84rYw4j{SSd%p)!Mo9AB8(~loqr01_-M_c$>+k!ztGc?XyQ)vd#)O#} zTNsl_B(sR{;CQ|A{|u_3omPjP>mDs4=A^OzT*4EzM-oe4a(b3V#$;sK-*~P`h z)z#I_&CT82-NVC!PN#c%dU|&oJT+NI?qb|_sjrxQ}Q=!55T1}N!Q-jT9 zVHz%`DaAD97+#0r^%&lW;X)knaZMerJ%wX+IM$3~EjT8`@peMaA)pfCZ6z^PN&Hqx z%$y`8{1g7|0VdmXAmuU@ZpSdL{W(0sI4e9h*cS1vt& zw<9;_g)&jTb}#ODXvVkO+tV#m*VWh8ntXm_-Kmg<*G%E-)Yuk7a&-9ytBsLs2Cu+g z-@IP}TtZj!)2DB!LdQ#oY4yX5gn;us!^kG@#&Gomn5=aQQS zZ^K?5mIjeST%L0le}2UKcj7AMmJ0FMxpUl!p5;b5UH3)%thBU|b1a`VV|SuXykf{j zyJQ(Nzs3$JjA^rm?H>zhs^D+UJEi8l_47q@WUANd!HSK8$4z$ani&~+)#2;uS)ge= z__sBpdhv%31EvS6Z#<1uIQLHIp-u4HL#ufXM!=Fs@mWZ=A9~+Uk ziFe0^hSfYTH`=!KXrDm9z;P%(Gdrrqg>EVwJ1!7FNmUd>@qsm>mSt`4%T^lGSX$|D z)5TUv?Wt!|&)@!b;5Ng?rrLVXi|@~~2VLrdL&Kc*)x9wL#oa8(IqC=J#$iLFPBx37 zT1yz;PbrI~iqL-1CF$vwn+KBiOwG;B#Yb!yd_e@eJ4B8)4Qn)Cbt^KHI{Q|AEf3sR z&QH7JG%9Sp^!^Sc74)9={Ry)^^l-I4U{{(B2rndHpu(|^sa777R$KI>UsmN!4fOlu3<_b?-o zl=Co#I`qdrx}9CN?#mL=d-duYrt=Ub)pR-`Ve^jC#g(GeTT2->qqP@!Hv)>v@;C?j$eL>wIzW=RRbmF`kQ(Q|~GBB`A zwp+DQVLjR*5@|9EE8?~Cvbbs&d~tEoA+c%v{p4*!g9VqAb@aV?xnZTGt~e#`aeOaVSk$vM&xNE?Vhv|a!H zTwQnYrb4&;Vo^K2-V{EjJQO`lxJJf&7qZ%*rSiWMc81aViv$Q}SvL^+Xkc(FWv5km zuU+ENJ}7DYW%|t&OUv@G8_6ci32*DPui_uaI~@cUuru4+?)g(5^jo1Z?ZWno7Q0q^ z^Tvn>akGcT{Jd_VE57S>s~hcqJ)1yrA9iu41Ss&E1%h;10(L1|wBTfqTx5Uxzb(d;}}cJ&pS~y!@c# zFPA&!J}pWgI|f!+2XV}Jw|45H!)de#>IwsUw}X8hON7ZK$m6cEbkIX-w$qj}= VB$Z2Exc+64B0^$A3!|3bkc#kx?elzH5iS3osDjoe|GV@oEPdewjrVMm5(<@c}Nj%PzLpNxUJ|;NLWll z)I2#M)jds4(En!+D7UX(ze!h4Lf1r8zfb%6*`EsOR-~Jp-@@_=Xag!9w_sI{O*u>^ z_UmNRCGkDXcpTkxJRau-@WO!qh_??C+I8H}g51=8+|+>F)^Oa`dfe80+}C{E*lyg|aNO8* z+}L*9*m&I8blll`+}V8G+jiXBc--51+}nWN(|_I6b=}u--Pd*9*LmI7d)?V{-Pw8F z+I^X-ZQuX^00DGTPE!Ct=GbNc008w#L_t(I%k7feuEHP?MT=UoLcP_ywTR+vtQL#@ z|F1bbD7HS>lblCaGRY>a2@uBfkYsl#D91(N4+Y!i_-0Z>{^==Y7; zZcnH8XC99LQPgf11w?CGx+ruygTZWOkSvQLm(ny0s|gnO)h-q0;j7T?GFGos$~mRa f@%x+b;~#hc85%rcY)sB{00000NkvXXu0mjfiPz*- literal 0 HcmV?d00001 diff --git a/projects/common/src/main/resources/assets/computercraft/textures/block/turtle_advanced_bottom.png b/projects/common/src/main/resources/assets/computercraft/textures/block/turtle_advanced_bottom.png new file mode 100644 index 0000000000000000000000000000000000000000..3950c69f3aba9be4e0c7cb0d269df0354ab7f346 GIT binary patch literal 421 zcmV;W0b2fvP)D)_~mCeBIT3-Pdv5*LB_3dEM80=;wFn=X&Vqd+6wV>F0sz=y&PpeCgFI>&>wxO%i0bK!>*s6h>3r+ye(ULj`f(^y00001bW%=J06^y0W&i*H&q+iaAP@!6RE_C4wQ0J>+I?UC|Nq*7N=G7uKp%U-aKR(uBtrxc0Sr>qqx}qo|&>R#4MUfg5 z`&k6Sc)pE+JWmbEm~2EG;c9E-o%FFE21KFflPPGBPqVGczD)PUU8bllc(+}3j3)_&aBaNO8-+}V8G+j!jDfZf+|-Pe2F*>mgcj_d4_ z>+G29+<@%qj_m4;?CXx~>y+&4nC$GF?bdtk*?sNehwbBs?c|5;=ZWp=kL~J{?d*;1 z?33;6mF?`A?d+ZI>V$s=Z6g2x00DGTPE!Ct=GbNc008evL_t(I%k9qD4uUWc1yGe* z3Z;~aE3SYd?urZe|379+V?ue*`tD6;nn_O5+rYTlgwQk%!?q!$ln{gnv8={BUje1# z@nq8N`u<|k>%Cuu^Z{dG7zBgCoF@!tGqI=B$`=BFS`>hBzh4KV5v2;Kf1v=^9S*BC z<@P*%06-jXHcvkHdtNSa0#E}F6+9}yahA*7uGsP^igJn5Fn$49mLzLFNs^XJoSlw7 z0N`@D-J&R#HD%A-b@c&4tJU#%y>4Yq*|Q)-1*Z?darXPe;e5_yP1!STw|@bQ$21YL lEC_9zF^pR+jP=1kWnRs&KA5Wk-{}AV002ovPDHLkV1i~7>X85d literal 0 HcmV?d00001 diff --git a/projects/common/src/main/resources/assets/computercraft/textures/block/turtle_advanced_left.png b/projects/common/src/main/resources/assets/computercraft/textures/block/turtle_advanced_left.png new file mode 100644 index 0000000000000000000000000000000000000000..d3fcd1d01f5dbd0f4c2b8a67129288c51b7a552d GIT binary patch literal 502 zcmV~2EG;c9FE1}JFfcJOF)}hTGcz+ZG&D6eH8wUjH#avpI5<2!JlWcG+1h&B)oa_> zb=%l^+t_>C+I8F7d)wT0+|+>F)^Oa`a@^Q(+}Lv5*mm65c-+~1+}d>9+IHOAcHG-| z+}nEG+koBGecjh_-Pe2F*>Bz1bKl^A;N67b-FNHkj_d4_>+G29>5lB`jO^=zM59obB0t?c#^+V#L(Ex7;y00DGTPE!Ct z=GbNc007=eL_t(I%k9$5P69y?Md7b|hT%t09K+W4e=IjHbU{=YMxc9efhHuNWcHqQ z<=mU93YEe^C25s{tdi{g5M80H+$uzkv4uBD?dfFTx*@w0tj(?L+{pGyyB>yQWu-Fp zAbT;jap=`yq%qaWC@e%#()KWP9u3U$(yLBwtI(Wx$nJmNLl8xq$wFf<*(l{p9qP-5 zor%_mU|mJe7UHE2N9LCdL6ijpQ?VWzmz|~UAA3k=|B%e=1O=i3pS^Ao9drg-@1oAT ss5r^FY6wGFX>atM9t641SO0V53u>}PSwU)?*8l(j07*qoM6N<$f<(Ii3;+NC literal 0 HcmV?d00001 diff --git a/projects/common/src/main/resources/assets/computercraft/textures/block/turtle_advanced_right.png b/projects/common/src/main/resources/assets/computercraft/textures/block/turtle_advanced_right.png new file mode 100644 index 0000000000000000000000000000000000000000..a09d72374ee40e985dd7ee2a79aa4cb7efef27a2 GIT binary patch literal 517 zcmV+g0{Z=lP)C+I!pFcHGc{+|qvB)PUU9bllc<+}3#9)_&aAeB9V>+}Lp3*mT_3cHG!} z+}U*8*?ipEbllo@+}e2D+jiXBc--53+}nWN)N|d`b=}o{-Pdv5*LB_3ciq={-Pe2F z*L~gDbKTi@-Pw8I-+Jrpj_d4_?CFl|>yGT}lXYs4 zjqU7{?d+ND?42@=z1RQ%00DGTPE!Ct=GbNc007lVL_t(I%k9v;PQp+e#^L9jw$K7W zag>S43-JDL!@L0WpW#>wP0j@LP$DRaAPA#6oQ>X(DeL= z%Gf~=5k*wJgrL>Pl-9!cie5s<1VJq|bWqCGYW3fR|GxSJt(8AfZIfQ300000NkvXX Hu0mjfGGYt{ literal 0 HcmV?d00001 diff --git a/projects/common/src/main/resources/assets/computercraft/textures/block/turtle_advanced_top.png b/projects/common/src/main/resources/assets/computercraft/textures/block/turtle_advanced_top.png new file mode 100644 index 0000000000000000000000000000000000000000..a0cf88707514517867030cbd4a6a9d05aa966d3b GIT binary patch literal 490 zcmVpB2RDWm<<=``A3tyTbBuU7z66#x+d;BYwD!!JmGef$rU$n^c~ z(YHLO!4^s50#v%uyXe`&EKbuFfT!n=yAo*6z;sMk>K z+#nYKcDvnO3AAURdgiF9JlAZm>B0A{BE-%KL5;07+j&X0W@jv>We)8bxLmx#YI9At zxsFzA@^>dH4X$>d9+J&}Xh8=%AJa95_6*#dD=Ho5l!6Id8{rSx<6Jwc*#qo%!a3*A zo`L99y?jAQNFMhb|Nhg_ZtQsCl}fgNUQA2D>>O?kls06PxXmP+#}Dps$sJL&jw2?H zSKi_@% literal 0 HcmV?d00001 diff --git a/projects/common/src/main/resources/assets/computercraft/textures/block/turtle_colour.png b/projects/common/src/main/resources/assets/computercraft/textures/block/turtle_colour.png deleted file mode 100644 index 9d3fb89d6706df16d379b8329a82778fa4aba168..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2344 zcmeHHTUe3@0R0I>b7**3QfWg=U0%VvfCA%IecV-KM2Z*5<6# zE*2KcTYb$;O}wFa0WTm3q9`gTAgxlPGUs0RwD)zs@0|0U$8#P|eoSX1b48%mnf3_Z7TwL7T+}z#WJv=--Jv~t<6dH~8^78Wb_V)4d z@%8of^Yiof_YVjN2n-CwU@%xL7Kg(H1qB5M2NQ|Jj*gDb&d#o`E-tr|%jI@=clY$P z_4IIidU|*~UT<%2UteE;fB(S10H4nn2n2(JgF{0@!^6WPBO^kgP$UwKj*g1OVu?gD zHZ~@eN@X(H`1rV7E}xi~P$(2rQ&ZE^(@LdsW@ct~c6M%VPNh=Ks}*XsdVYR>VPQd| z(P*_=oldv7xTx3b*BgDnhXwxQ0>$PiDgc0h({a({wf{E&@`|w|06@gyp~UzMsqUKK z_;{#wH-5WJK9D{VA0KklVRnOMHZ*^?g>jaN@9d3eSHfX9(*D}1)ScFM?)~6ovbT?m zt=M9ohW$n#IsLd??)Jjg?~1>2X(dzDqHn&s6ZJ$2-L=~x&eDNZaIUM=y3iiE=L;^G zqA5H1)-W=B9pakKJWjxT=T9QpEhFfyO-99;uB1O2aM1SY%z9CTh7!n&&Bi);7kmrWV7|{1; zZNSngJfg~!o>18g+q|0NhaS9>Z?r_Sx4(pIMC|WZ7cgvdQu*}LdBkcKHjfci1rHZo z;+6!P9RJEM4>Z63Cyy4qF()F~!KGb_O@50!?KB;CwnM^%2k*>ZFg)`xxYzwdxp znuM65*5dwVn{h^W^QP96!ed|{*jTYmK?a^xYlP*|M+sj}u7+30?>~|%lvBSLr1Oo}Y|O&$1RZpO}v^Ry4H_ z=-sjDcNzJ%Ts~%% zZCsWaMmw_&y4*`sIC?PZg%Q?GE%jcWb=h}uSkK7s)9PYU3|l0=eWoG%e!0r2Tw&c_ zoHg`%UkDn0uANCLqQ&yIAFB8?Qk3P2*Bncm7^`9r5c3(zH=NHg$v{ACN+Qqs(vje5 z$>-_EU@S}GBdcHb_$N?^RnbqA6ov;<5!F!RRm)yZuJt}kCd{=QC}XHD=d4xkfL0_q z%e)qLIVn4m#kLP_fE8sj3MBh%>bklectp0a= cU_oC4ERxI{0#ba}FAf00KZ_2n387^F4I+T-8vpDE=HjP7cN~z`t+rJrV6m&y0Xp zGuex%1!GL~ROejXZc`gT@?7GYge?}j7u^pclgV|s17&I)3rcyJy8r+H07*qo IM6N<$f?wKdBme*a literal 0 HcmV?d00001 diff --git a/projects/common/src/main/resources/assets/computercraft/textures/block/turtle_colour_body_backpack.png b/projects/common/src/main/resources/assets/computercraft/textures/block/turtle_colour_body_backpack.png new file mode 100644 index 0000000000000000000000000000000000000000..5fe7fa8067af46fe4faa90e4d5f71c52273c61c5 GIT binary patch literal 229 zcmeAS@N?(olHy`uVBq!ia0vp^3Lwk@BpAX3RW*PVQ%R6tFatx`U3S$H&OX$jZvf%*@Qq&CSlv&d<-!(b3V;($dq@)7910*4Eb7*Vo$G z+Th^e;^N}uuz*=jZ3>=;-O_;OXh<>gww2>+9_7?CtICf1-PV00001bW%=J z06^y0W&i*Hw@E}nR5;7+k4+PTAP_)TAp;ajQM2;n|NqN&*RTP*G}EC&@4&vp+W`Q+ zK$hhjLP(@2;vh(#2a5v%-glk%AjtZ@ZTA6A^(2L+s-^opC9A_MfVIoyo)mD00000NkvXX Hu0mjflTNXL literal 0 HcmV?d00001 diff --git a/projects/common/src/main/resources/assets/computercraft/textures/block/turtle_colour_body_front.png b/projects/common/src/main/resources/assets/computercraft/textures/block/turtle_colour_body_front.png new file mode 100644 index 0000000000000000000000000000000000000000..1b3f48ddd79660220a85b590e155b8a006a21d0d GIT binary patch literal 247 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=ffJeV#6kAr*7pPEF)HA|TKzFI8S3 z-1*r1$jTe>lYO@~U(LJr?$^I5WvBKWXZT~?Bz5n146n$dU-RY#c`-C>{r0Dw>89`( zKeMbUUR9N*^L!f$&c#X@9*cH##ya1-zEX?)Qe=swj|)*mpkk_}%%N=-wiBcQ;;kWSjRoem3$Hgk>4 z3;<}FW?gs!`xJ-ZaRD!#*cPARTfawq4!Cw^*I#uc9tT7OzpB2HmSvj@1b3jW>q`r}@^uQf-mNhP!!QI9;JgRQvJ5LgL?9wy=G7pg*^Q+LeQuA- z0$jPo7`0^?udv_3c5JS?N2vj^rpWmISCtBWSuxN%>z0f?Ve(^`QGoM1lLWfKcuDN z4mh<-J(?BuINM6UaWUV?^SP_fIXh@hwajwavGo1-|15Dbr|-JX{kVJUHg86G!533y zGz1krPgc)B=-Xq-<@P~c%{bnx^% zX|bg_gHe@(Cc{ zuWw*rU}$J)WMpJ)Y;0m;Vrpt?W@ct?ZfeEL!&H8e z_ozUGYrq4ZU0WrXJm&50j%7HRxKM*hM~`ozMpOfnM4J;!*x&nWx9nCfS@v<}|Nk4g bd4zyA)mk2pSG~0pXeooItDnm{r-UW|Hw8!j literal 0 HcmV?d00001 diff --git a/projects/common/src/main/resources/assets/computercraft/textures/block/turtle_colour_frame_backpack.png b/projects/common/src/main/resources/assets/computercraft/textures/block/turtle_colour_frame_backpack.png new file mode 100644 index 0000000000000000000000000000000000000000..5a52d28ae3f7815f26c35a94136f05199e23ec1b GIT binary patch literal 191 zcmeAS@N?(olHy`uVBq!ia0vp^3Lwk@BpAX3RW*PVQ%R6tFatx`{eK01elR`f%<;C6Phsg+3Hg43DOtVmY@71G zwi}vB>x5fQFk%dm=~;R3XDQ>O)rGDctQzVr0^yl&7!261ZQb4+WVxd2z)rahWjtq2 mRIe#MdpcCAdOlioh$ zWmuyg^yqRwItkK5XFD+m1E-^`DG_=-fCu2T51vARs8vl?S@>2 f&(a^B`u}9y!fXBYgGSG7kRLo<{an^LB{Ts5wMAG3 literal 0 HcmV?d00001 diff --git a/projects/common/src/main/resources/assets/computercraft/textures/block/turtle_colour_frame_front.png b/projects/common/src/main/resources/assets/computercraft/textures/block/turtle_colour_frame_front.png new file mode 100644 index 0000000000000000000000000000000000000000..c58d2e6fa330d7753f3e40f80a0814770383da91 GIT binary patch literal 203 zcmeAS@N?(olHy`uVBq!ia0vp^3Lwk@BpAX3RW*PVQ%R6tFatx`!}(@#w^IaLXeebyI#WyrmO&V;e`Iq_erRs|#!?D$E`z75pUXO@geCz0KtyQ( literal 0 HcmV?d00001 diff --git a/projects/common/src/main/resources/assets/computercraft/textures/block/turtle_colour_frame_left.png b/projects/common/src/main/resources/assets/computercraft/textures/block/turtle_colour_frame_left.png new file mode 100644 index 0000000000000000000000000000000000000000..e2b4cc2294a757d7b5195c4e476e92c82e3d14a3 GIT binary patch literal 225 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnF3?v&v(vJfv-2k5uS0JsWrKO{zqpPc{udi=l zU|?uyXk=t$Y;0^|Vq$7)YG!6;ZfmmVAt=O-#oM8jUSj1m+bVRNNqaH-M+HXgc5HyYKHUom$@VNI*h`fuVJcwzj?h RMWAI244$rjF6*2UngE(fLQVhx literal 0 HcmV?d00001 diff --git a/projects/common/src/main/resources/assets/computercraft/textures/block/turtle_colour_frame_right.png b/projects/common/src/main/resources/assets/computercraft/textures/block/turtle_colour_frame_right.png new file mode 100644 index 0000000000000000000000000000000000000000..3f1edd75906ddbfae44bf3a2db636e0548abccb0 GIT binary patch literal 184 zcmeAS@N?(olHy`uVBq!ia0vp^3Lwk@BpAX3RW*PVQ%R6tFatx`!4F&?N>hghtd%Df;?ce@cYY~g^RsqKX$7x&qzRpN`Ftg9Yb4gnIVuekQC3bGC zd7yjQo3H{rA;Okdr)J{an^LB{Ts5Z7V&g literal 0 HcmV?d00001 diff --git a/projects/common/src/main/resources/assets/computercraft/textures/block/turtle_colour_frame_top.png b/projects/common/src/main/resources/assets/computercraft/textures/block/turtle_colour_frame_top.png new file mode 100644 index 0000000000000000000000000000000000000000..8ccd72641f317a38d7d3ed95a9a2cf644f6b7970 GIT binary patch literal 185 zcmeAS@N?(olHy`uVBq!ia0vp^3Lwk@BpAX3RW*PVQ%R6tFatx`y6ahWcZpVx)JvPTHcX*n@iw!t-7GDtmQX|pQIkoG#%45k4 ghi!ij?_XcWe9c(2;_F-8*&sK0y85}Sb4q9e0NXV|SO5S3 literal 0 HcmV?d00001 diff --git a/projects/common/src/main/resources/assets/computercraft/textures/block/turtle_elf_overlay.png b/projects/common/src/main/resources/assets/computercraft/textures/block/turtle_elf_overlay.png deleted file mode 100644 index 9b7814a1df53395d9a9aa070f9e8a63db7ac4e36..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1681 zcmbW1{ZkVM8pogA&1SQ^*@jR73=k z7D=s$FL2e$)fXJc=?ETHxYC~Xlwz&kaVmmCOE4lt2M7rvZ;%)ALfFgw3pew5KHum0 z`FZ9!z9ILw3>8BG0F${sJui~F|CI=f*z@vq005odkh3WxGNz@aO-@u;O$V$`woY0q z^pAJIE`Z$tdjLuR_C`RU6rdD=eGyRDCx9{(_6wj~02Me?h~R(_Dha3*!9fvJk?;`( zAJcG%ff@;Nh(UBxw2DHjXtY|4)=1D#Sgb~Z>7>|Unc!owAmUG>$Yasn0KEWx06$42 z0|NtkfI%ELps2xMct(=XQS>>E4+9Jj503zhVAu$bk5H5mz!m93yxbP5{pu4QL8O6 zF&2wu5CX*-6q)QTCV^ zyWQ@E?nr0k9P@$F0t6fFfNyC z8em!=n8xvGikfDaX{mGuL1qYICep~|GaNTFGvgKr+(MySEOtvIZkBaNMY+{#cXF~P zvRoAP5QIl8_DCcikH?E)UZK!S5MGk>GK`mHy$Xd_t@dg(Ua!}OVLp+_N7Fv3)W@O9OqlS*yr=jBFL;rG)t1R95<`c%+AjGG0czSev0zbv|lXtOQn9f+^ni5%_$Uf8qJ)Z4AXR2 zDh+d7c+sNpAQ=va=VN2%lal7==XrwQX_{wQp5u6hf>){d1q*nMhL4Nm7cJtGlldW< zAEx*bnm5w?%LrnARKkz3yh+MWNcf3}<-D2Yt#aP3;GNMt&v%SxqmiR0_UGm11A-tV z#kzO@BNG5ypP8PvsdC6ZP*SA-or-Wh=`!}->g^bQx25R931!c`Zo@GHtkFbmLb~ zQ=iOw@0Y!4zG%L9Zo#8B%-ZGS((D`7j)Ge4p>n8wse+=kNbi z``Yd6_d59f^(NJ}Lm#{4GFuE_*vTW=5ou9~W9(=kz+`VRJ{gKia=by$q z>KorW?U3O`-@Q<0zOG%-zp?EL|InHDSJ@i#0(mEd^?&iGm;CD0=3VK?rNTWo*4N!{ z=~?~bstidmr{iQ6qsp!6OsallQa`YDD{J( z{?&2c3~bcyXll*88h!l{sayIApbP(RrgSyP&9P^vHYWrluN)vVBR9SMt!;<@3lOQy ADF6Tf diff --git a/projects/common/src/main/resources/assets/computercraft/textures/block/turtle_elf_overlay_back.png b/projects/common/src/main/resources/assets/computercraft/textures/block/turtle_elf_overlay_back.png new file mode 100644 index 0000000000000000000000000000000000000000..e8e50e9b4d6fb85be35d618fe01129373d8ed253 GIT binary patch literal 338 zcmV-Y0j>UtP)g)vt?Ck9B5fSk4@bLr$@eK{~4-fM4 z^79Z7^BEcR0s{312lf*a_zDX66BGLS`uqF){0RyD{r&$O9RDgR|NsBWeNo^50007X zQchC<5NjmeTmS$7oJmAMR5;7+&dCmgAP|6ITquj8EHZ$C`2J7Xa%dWp#x^xgdgyqz8|QT`CBQUYE@c9= z?J(@XvdpuT1pqWnN;^<0AjxrDS4ah*=M{jCdc0OupMkC;jHd2T!A!04g*6j14AAILp}pT z0T3}V6f!UrGBOka5feiZ3qvszLkSB*DGNgxD?=FvLpd8m1v^6p2SX(XLlq}OH5Wq- zH$xpSLp>j39WP@8KT{PKQx!K;Ee}&YA5)_Mb3Gq(13z<u>@?%R}|QmzH@3OLr@Egcm&ho4-K3 zKsiWM=hBsF|CVOHaw@pZp;vqTF!x~}mhfe}f?iwm@7x=a{BU-k@R0z`H(%B~>&uRH zzCHgyrnAoG0yRVRXSYuACA+6;JE!SPo4q68+8)Wolt;^!E=vI0DsQ=fc&*bE~ V@cUX_IiPnLJYD@<);T3K0RYQhw(bA` literal 0 HcmV?d00001 diff --git a/projects/common/src/main/resources/assets/computercraft/textures/block/turtle_elf_overlay_front.png b/projects/common/src/main/resources/assets/computercraft/textures/block/turtle_elf_overlay_front.png new file mode 100644 index 0000000000000000000000000000000000000000..422a17635938e4cab5c303afa982280e39ec49e2 GIT binary patch literal 234 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=ffJjh-%!Ar*7pUNy`<6d=IxK;QR3 z)`F84E?TnwKl)qsUyAv3hxSRX#-ifQHg6ULx94o-`=0x~?{NkDana>xpK-N!iJ2Ue)t*e3;-Bo~&XYh3Ob6Mw<&;$VR@?#$W literal 0 HcmV?d00001 diff --git a/projects/common/src/main/resources/assets/computercraft/textures/block/turtle_elf_overlay_left.png b/projects/common/src/main/resources/assets/computercraft/textures/block/turtle_elf_overlay_left.png new file mode 100644 index 0000000000000000000000000000000000000000..9b49d9924c1b12930387427211e74ce00e70bbaa GIT binary patch literal 233 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE3?yBabR7dyt^qzFu0Z-M1H+XoSMJ=o^XSo| zrwj~FpFVxg#`c1N;SCV6vc3}({P5w!M_%4Eak-ar*5kbD;(W0S1R63yVvP|La$YCNJdc zRgKnvT*H%{t*ffqa81CupzrRs#tgqj64A^aD@E4sb+6%c(r{IIs;r~^)baoT0BuP`K~y-) z?as{(Krj$S(T-8YRR7fA{a@5V#G>dzL?Z5X&X9v;B`^D}6-TEM{pSbhIqtv@^jN7HG| zZ=(LY$^Rp2*WGRj{dOBXM`n8xo_U*l+^t zUay3|XEV^q#Hil~%XniMFC5gXe=bAfrQO@#2meNSZ#V?U*Vmg(VCVMn5nMEzU>;Yu z;w-fqs;aliz1K>&4HXVE$4MLf|xQJ?mN_ zbot=}_-8z>#zXM6czXg5J3G}!l&l+79(+w5c$fS>t5s%RUR;2ut1ECF*PrFgMys?v7-%MYp1MWg#6(WP#Y_sb??cx3V5+0+p zc**nKUC@o&ry+Baev$fd6{Vlzp}!Uj@JEQY7K;rhFwXG~KYj%NO(tMJx8gKPPE+A# z8Gn&gMtMC%iqQxxLgswa?}FN-(I}x67k8p`o;+SJm*86z9c1Il z+4pI^-f#jpgF*Eoy1fO97xzZNI`4u``ioS?B3aVNT~XvtY36PC_3jP~fBe{N0^8We cHny>iU$M^P0~23OApigX07*qoM6N<$f_iBiLjV8( literal 0 HcmV?d00001 diff --git a/projects/common/src/main/resources/assets/computercraft/textures/block/turtle_normal.png b/projects/common/src/main/resources/assets/computercraft/textures/block/turtle_normal.png deleted file mode 100644 index 93f0d75aca4c376c5d369f7535f6906024975d4b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1096 zcmV-O1h@N%P)k zb@UFG*+&s1SPUsjLc$ThF1H210q{-J>b2db5|ywGXP|(=;(4EYf`H>a?iZ8^!>OYM zkH?|pH~_7^L&%qPLV$Zs>wfFlq!>&~fiVs4Hm#d0Dd14_t6E|Ir6QIhn<03KQUotQ zsD0R#c!a0RD==EZt@Doq!uGY=!Q`q%DNz(h8GOXFMk`xQWDw}F4~WC#=&a%c%h02J zVpfQR&wdPzEBq8%Z)aFG@CY*Igr@Qtl!O~_#2$Prf*|ivbn|NnmYfcjgq(r_9TEx*IbbIGe_470FFYqS zFO!loV2chz94U&@1xf~N;8y7W?II|U!BNOttNT15hbXS0FD2zB3B547ej?=- z1>d)<_2`dQJO$SmyVaIfAj9KBHfu;pFepW}eqZmCA;ngeZqus@b16hj4)N}7k*h}R}bK5H(#UmJO zZQlitguX32rcu#_(VL4a(4T+e{k17@I=a969-#~?l~#uAP;99DYWrWiRc>hM@OLW* zs5ERpKeqx4E^190WL0*f(69DW5L^=hD?ite1*H@%`;*;juTxC@9ZkL@=$t7`vciJa zqCxf&$0!m$gp-_yN=TX&D^PH$Wf%SgJPA7-PmC6n?F$kIa*B}Yw<{eJtm73>!f=Xx z$QDI&8;BxG1}5(Z=xWGE$FIt(x? z^#6Vl6o^D3kw_#Gi9{liNF)-8L?V$$Boc{4B9TZW5{X12kw_#GiTn%vf=Q(0hd&Vj O0000mM4lJrpEAcj?VLzXxC#242tOI0j&vCIF7dBLIEh18})q07%mmfVOQT-mrUj_!}frcsiW` zh@xn=3U4n*cDqk4Qhq+4R|OE>0Vzq6WOiT`TXZhvT7}(vgm*wWpu6;Pz~VWe)jH}C z-T~G3;cx)HDihWj`<{KSKCwi22c%rss<3yfT(MXO#&KK~KzIifsh7>3BR@rW2W$_w zckN}n@cPC7=>w|Qq9}l8{Vvt}QqR{^0!!z9WufY=?CNSRLvcUKM+-+9S&Id;-X_40ukr*XtE{PQBI{ r)%opqo4u!85>37toy#t?QB-*L26kh`qy)o7NeXIa$tlLXm$LTGUuB|JpY~+V1zGNu zIx-P6qGncZoa#2^os)-(Q$|=^&Qig`MFYg|yQUlp5#RMibIICGpEI7{ znHQyO8a%xv&o0wxhUAjk&pYq0^3+^feOG28M`}P_OyTn`>))>qhhzm6bP0l+XkKhM8?7 literal 0 HcmV?d00001 diff --git a/projects/common/src/main/resources/assets/computercraft/textures/block/turtle_normal_bottom.png b/projects/common/src/main/resources/assets/computercraft/textures/block/turtle_normal_bottom.png new file mode 100644 index 0000000000000000000000000000000000000000..3b5064202fd9f5f8b4f2470f1eb92e0bd54ccf56 GIT binary patch literal 350 zcmV-k0iphhP)-Z8{iKKGVi6V%KAZQA)h(fA}-~%M3 zAy^2$gRdhiuKP32&UnqnCY_b%q#M@e#u^K2wYh~__SGP}LVR~q*l3YuN$ry&@WtSk z&jx$`h+6HX9dm~j2gVj&w<|^1c!L8Qhj?X6RKmn<=My#8-Ep=nPZXhdt~hg9)ROcz z=~U#Sq?5lXLg$6zxxd9ywU>+}wR}$}*_K@)lJ=v))TzPUtO%VWS@I0WHlDZ;OO5&| zj&;&wypuwa^`=w5?eDuJ)E>@Bj^h}B zvMhl?xkkY?UoMvbEEaDqa`1FIc@YTjfE36H&3z%|V~#lq*oE`?Jc)qC;c%Gre0;mz zfa%Izu(2>oz%K0fd#{Z)SbZ)3A|U0;bG=AP#y)6cz_s6n@L6!VTmUGF0vHsiqDhI( zcMI#l@p$wi5Z;0HdJTM^ogIB05cYp$y5Z+FErX3UuJ0{7JMKWvS>;oWmFUe073A6 zPs&(N8Pj^jIUEk7HZZ?|`~BX1h$5iR(1+eDb8Ad-hBChaRqeM1^i&rOWqt#j%?9YJ zSk-M&hSq@X4#gYF{01J62LNfBc0c^of=nEbM*vo<)!P8p!1;V0wSkWYk|Y@wa4f%b zK>w+oa6u4|Wf`Z_X;46)DIbGtU@8-lPCMHL@2WjbQ>vz%QCNl$!cIKBHd(E1L_K)+3uV1wtJeU8MT4=4JZR;ZVlMe&Q3miL-L&^K4v%I z@;q;$&s=B0^?C*R+p%gy=$33vD9*pR6)!9-EIa{pVO(c#ZB$DD0000&?} literal 0 HcmV?d00001 diff --git a/projects/common/src/main/resources/assets/computercraft/textures/block/turtle_normal_right.png b/projects/common/src/main/resources/assets/computercraft/textures/block/turtle_normal_right.png new file mode 100644 index 0000000000000000000000000000000000000000..04f6127b8b21f67785b6efd9c437f0c2a36b223a GIT binary patch literal 393 zcmV;40e1e0P)?0XQCyvpD^KI2-`DUauZ2;I9e#Bm&=mGb&V%S5n@EmUhMA#`2ml)&~1G))6cjFx)9!YUwpKA)Wu z*j|Bg9D(Wli@B|>y}smYPOQcD3aFNXm}t_;*C~;ors>R=t*Xi?fqyBWm%jsnnAvW& zR&n;_OA~S}oTA^!TzH-W&2llY=RC`@*^RdLdQOrgP6@11;1kS+=LeuD3SeR)yM(1$ z55wS;!1i;%e$T~R8_p|5Y|m&zT8r%!uwASgN`Y6iU-oMi@U#_MMp8mOqRmMgPusS@ nv^6VUwyx{%*ot@T*su0l@ literal 0 HcmV?d00001 diff --git a/projects/common/src/main/resources/assets/computercraft/textures/block/turtle_normal_top.png b/projects/common/src/main/resources/assets/computercraft/textures/block/turtle_normal_top.png new file mode 100644 index 0000000000000000000000000000000000000000..9ca3f030aba51d36c8678634f63e76bdc53c5759 GIT binary patch literal 340 zcmV-a0jvIrP)u~OFO#It}m)kFz&|r67Gx1D-LP&9`qKxXgJ^->T17KZO z0P;Ksz!-C~kK=fz(dP_{T7P)EUJ3&JZl z1@0gTe~DWM4f0*N(} delta 583 zcmV-N0=WIU0n`ML7=H)`0000V^Z#K000C}kLqkw$V`BgSD3NuMJ4*vW6otPeilPxk zEkp!UM6rk<3Sz0TNE0N)2u5v^%}dB**-emOE7({BEJPb$h5tZX!B#;K6hXw!-d7`G zz2gcAlFTxDKhDg#+&v4pJ)zg!%<9How86zh=ChW~+OWNN&>Py_o{L-S-LD@r?gbCosL!1)pWGON( zH7}Vp_D%fy7Jn#+N0YZs8ABXtGUD}#T9U3wsVUKu@?Mz4im)IDcpR*a9Ph00009a7bBm000XT z000XT0n*)m`~Uy|j7da6R5(v#c*?-=9~Wi-f-=UA{~#I$3f$fQH-(0R#X$O4q*r4fAwE7N7o5I_#{fnQISen9 zZSBNqKtLB38ITJ=hL8s(-~`$iNP8ghmJ9c6qA}krEmB6Imt|i zndU!kZtv~;{`kD__w)U}H}^Jr3-j-epB0ZF$ldM&R}mbOv}dXj{-*W~aB%obb#bX$ z#6{3hSQe!UfU0Xk00mJ=M3Cqw0q@Gh<7h&E&wcZ9UtTu#WK;R%{-Y={V3D0DvZ*PPre1K;r>=lSN8wTEooaO>jvjW>)R&Rw2(&l4q2BZy&x6`m|zq<6#uO7TC7dQN}s?$)? zTB};p1m&IF>pwBn?oLfRyXfrSdtB7y4|*%7r>^?imwl%H(_L>ob^7&$>!uT{_dalc zud(;W-aX2t*_&JH-b~tc@2d}}Io>_P#xb?@!< zFReY*yXo_~(A|blzWfK>eCK(j-5>5mj;ae`*F`1RU8SBS zEH4MloFMyvIT{GTwnLC?M>NFoM!z%K>u*w;teF;o)l*i#uE(i3umGO3_C43axEN$fHON*rm7*9AR>{7IYOJ|u%Dn9h9O7`VX@%Q0$0`qRW6DL zm2?dvhT#GVAC^L@BnMFqlk>@ysvX0i9vzA=5b}72;e*N`3y=>Y%7qBZOcH?rG1@~> z^Qs`oU_d|Up%lYSN)!P_t_<@auL=a!^wAIkKkOf>3|Hvs2s{BQKmeL5a8+u|lKF0r zci2Otz%K(yr6OEj+i&j%n+& zg3L<-tH0VT3?pPxR-7bBD{i&%9M13}jr&M};V6-#C_ZZxlsl-XT#yGE6a+U*5XZ_0 z85U8n;55lF5F%5+85-7=2DC_vywygD8KWSUh9%gQT*c_9G$;W=QPvD0g9aSVQ5FHW z0>I#$l_qf?2L#S1+A;wUbtr*n7s}xP2g@l1I6ojlLBFoh2xoJ=ZaZc%lOqyu1*eM8 z!HzAFf|bz`MX?kB%T!KdlghM_mMj}%Wo%hl86-1e^dtx?uoE>*iZs(!U89wSg~>o- zIjv72fG&r*u+A{xR5@HM%N2G^3klUcht(dqodizhT$~CZC~2Wtl4fbDn95>F27VtW zDV7{%FAI{m=6_jhn+MH~mApVw;QDKHQEW#o1FK`R*t9~@w-So#n}X%|SPBYP1q3}# zh!s=uWn9n?;OQ~gu0wL^2UQGI*AlnTf;7`EU+U00)^FqR4Z=Du5VC!{~}E zsu3;>a{Q1-$Q5i)oh$TFy-<&hjU`eBv?@TtaFWKqPZ%+nFrl3pLm6ii-{T}(HyCxu zK);v_9$xS)B!&;eLC#>jKjvq!7C+_^C_1soxcHr*Yl5zEF)%LUiSC-9Yg`PB%Xp%@ z{%>@}k6fof5dI5_z{}F7p_OpF(Fog=1D+n^}UhOd;I~r#~ z;S|;F$(zy>mzrcUWk*te21V6wS5C3*44+`{?{UN>wtUjCA^GV89bLEElTuTiT~{yE zHu(o``IoEDOphy!YkB$5p;r1&{WnbK{GUyYoRkpfU2!=b|K_h08jCu9x6AR<^*3)O z8Be^`wnac{X0%McFKtH4q1NNyElGH2($CYtOCL*8LY94G&2G diff --git a/tools/update-resources.py b/tools/update-resources.py old mode 100644 new mode 100755 index 7664d1ced..08e0953ac --- a/tools/update-resources.py +++ b/tools/update-resources.py @@ -76,6 +76,45 @@ def unstitch_corners(input_file: pathlib.Path, family: str): sidebar.save(output_dir / f"sidebar_{family}.png") +def unstitch_turtle(input_file: pathlib.Path, family: str, *, dy: int = 0): + input = Image.open(input_file) + output_dir = input_file.parent + + fragments = [ + ("bottom", 22, 0, 24, 22, Image.Transpose.ROTATE_180), + ("top", 46, 0, 24, 22, Image.Transpose.FLIP_LEFT_RIGHT), + ("right", 0, 22, 22, 24, Image.Transpose.ROTATE_180), + ("back", 22, 22, 24, 24, Image.Transpose.ROTATE_180), + ("left", 46, 22, 22, 24, Image.Transpose.ROTATE_180), + ("front", 68, 22, 24, 24, Image.Transpose.ROTATE_180), + ] + + for suffix, x, y, w, h, transform in fragments: + if family == "elf_overlay" and suffix == "bottom": + continue + + slice = input.crop(box(x, dy + y, w, h)).transpose(transform) + + fragment = Image.new("RGBA", (32, 32)) + fragment.paste(slice) + fragment.save(output_dir / f"turtle_{family}_{suffix}.png") + + backpack = Image.new("RGBA", (32, 32)) + backpack.paste( + input.crop(box(70, dy + 4, 28, 14)).transpose(Image.Transpose.ROTATE_180), + (0, 4), + ) + backpack.paste( + input.crop(box(74, dy + 0, 20, 4)).transpose(Image.Transpose.ROTATE_180), + (4, 18), + ) + backpack.paste( + input.crop(box(94, dy + 0, 20, 4)).transpose(Image.Transpose.FLIP_LEFT_RIGHT), + (4, 0), + ) + backpack.save(output_dir / f"turtle_{family}_backpack.png") + + def main() -> None: spec = argparse.ArgumentParser() spec.add_argument("dir", type=pathlib.Path) @@ -97,6 +136,18 @@ def main() -> None: unstitch_corners(path, family) transformed.append(path) + for family in ("normal", "advanced", "elf_overlay"): + path = texture_path / "block" / f"turtle_{family}.png" + if path.exists(): + unstitch_turtle(path, family) + transformed.append(path) + + path = texture_path / "block" / f"turtle_colour.png" + if path.exists(): + unstitch_turtle(path, "colour_frame") + unstitch_turtle(path, "colour_body", dy=46) + transformed.append(path) + if len(transformed) == 0: print("No files were transformed") return From 1e214f329e76077853e3e40acff02523a998228d Mon Sep 17 00:00:00 2001 From: Jonathan Coates Date: Mon, 6 May 2024 09:59:09 +0100 Subject: [PATCH 04/12] Build docs for all MC versions --- .github/workflows/make-doc.yml | 3 +-- .../main/resources/data/computercraft/lua/rom/apis/rednet.lua | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/make-doc.yml b/.github/workflows/make-doc.yml index 4da2a788a..26eeb3c4e 100644 --- a/.github/workflows/make-doc.yml +++ b/.github/workflows/make-doc.yml @@ -3,8 +3,7 @@ name: Build documentation on: push: branches: - - mc-1.19.x - - mc-1.20.x + - mc-* jobs: make_doc: diff --git a/projects/core/src/main/resources/data/computercraft/lua/rom/apis/rednet.lua b/projects/core/src/main/resources/data/computercraft/lua/rom/apis/rednet.lua index b14618bdb..097086a51 100644 --- a/projects/core/src/main/resources/data/computercraft/lua/rom/apis/rednet.lua +++ b/projects/core/src/main/resources/data/computercraft/lua/rom/apis/rednet.lua @@ -149,7 +149,7 @@ function isOpen(modem) end --[[- Allows a computer or turtle with an attached modem to send a message -intended for a sycomputer with a specific ID. At least one such modem must first +intended for a computer with a specific ID. At least one such modem must first be [opened][`rednet.open`] before sending is possible. Assuming the target was in range and also had a correctly opened modem, the From c7e49d1929b02f5520fe38d0289be625d4f0dc6a Mon Sep 17 00:00:00 2001 From: Jonathan Coates Date: Thu, 9 May 2024 22:54:03 +0100 Subject: [PATCH 05/12] Use RecordItem.getDisplayName to get audio title Rather than constructing the component manually. This should be more compatible with mods that override getDisplayName. --- .../computercraft/shared/media/items/RecordMedia.java | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/projects/common/src/main/java/dan200/computercraft/shared/media/items/RecordMedia.java b/projects/common/src/main/java/dan200/computercraft/shared/media/items/RecordMedia.java index 86c638528..8442d7d17 100644 --- a/projects/common/src/main/java/dan200/computercraft/shared/media/items/RecordMedia.java +++ b/projects/common/src/main/java/dan200/computercraft/shared/media/items/RecordMedia.java @@ -5,7 +5,6 @@ package dan200.computercraft.shared.media.items; import dan200.computercraft.api.media.IMedia; -import net.minecraft.network.chat.Component; import net.minecraft.sounds.SoundEvent; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.RecordItem; @@ -13,7 +12,7 @@ import net.minecraft.world.item.RecordItem; import javax.annotation.Nullable; /** - * An implementation of IMedia for ItemRecords. + * An implementation of {@link IMedia} for {@link RecordItem}. */ public final class RecordMedia implements IMedia { public static final RecordMedia INSTANCE = new RecordMedia(); @@ -29,16 +28,12 @@ public final class RecordMedia implements IMedia { @Override public @Nullable String getAudioTitle(ItemStack stack) { var item = stack.getItem(); - if (!(item instanceof RecordItem)) return null; - - return Component.translatable(item.getDescriptionId() + ".desc").getString(); + return item instanceof RecordItem record ? record.getDisplayName().getString() : null; } @Override public @Nullable SoundEvent getAudio(ItemStack stack) { var item = stack.getItem(); - if (!(item instanceof RecordItem)) return null; - - return ((RecordItem) item).getSound(); + return item instanceof RecordItem record ? record.getSound() : null; } } From f63f85921fb7ef27175df7bfe2f3c3d93475493b Mon Sep 17 00:00:00 2001 From: Jonathan Coates Date: Sun, 19 May 2024 08:38:41 +0100 Subject: [PATCH 06/12] Fix missing quotes in the settings example --- .../main/resources/data/computercraft/lua/rom/apis/settings.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/core/src/main/resources/data/computercraft/lua/rom/apis/settings.lua b/projects/core/src/main/resources/data/computercraft/lua/rom/apis/settings.lua index 0d6ead5a2..6f1d1a3ab 100644 --- a/projects/core/src/main/resources/data/computercraft/lua/rom/apis/settings.lua +++ b/projects/core/src/main/resources/data/computercraft/lua/rom/apis/settings.lua @@ -19,7 +19,7 @@ When a computer starts, it reads the current value of settings from the settings.define("my.setting", { description = "An example setting", default = 123, - type = number, + type = "number", }) print("my.setting = " .. settings.get("my.setting")) -- 123 From 57c289f173f2aecff8902962ec440f4e473b91b7 Mon Sep 17 00:00:00 2001 From: Daniel Ratcliffe Date: Mon, 13 May 2024 12:47:31 +0100 Subject: [PATCH 07/12] Allow planks to be used for building in "adventure" --- .../data/computercraft/lua/rom/programs/fun/adventure.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/projects/core/src/main/resources/data/computercraft/lua/rom/programs/fun/adventure.lua b/projects/core/src/main/resources/data/computercraft/lua/rom/programs/fun/adventure.lua index b374ff835..ff7134eaa 100644 --- a/projects/core/src/main/resources/data/computercraft/lua/rom/programs/fun/adventure.lua +++ b/projects/core/src/main/resources/data/computercraft/lua/rom/programs/fun/adventure.lua @@ -108,6 +108,7 @@ local items = { }, ["some planks"] = { aliases = { "planks", "wooden planks", "wood planks" }, + material = true, desc = "You could easily craft these planks into sticks.", }, ["some sticks"] = { From 4d619de357cb57a1d85798553b53254205b69b06 Mon Sep 17 00:00:00 2001 From: Jonathan Coates Date: Sun, 26 May 2024 09:34:10 +0100 Subject: [PATCH 08/12] Don't publish Gradle module metadata for common Fixes #1842 --- projects/common/build.gradle.kts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/projects/common/build.gradle.kts b/projects/common/build.gradle.kts index ded4093da..e0b20e3d0 100644 --- a/projects/common/build.gradle.kts +++ b/projects/common/build.gradle.kts @@ -127,3 +127,5 @@ val runData by tasks.registering(MergeTrees::class) { } } } + +tasks.withType(GenerateModuleMetadata::class).configureEach { isEnabled = false } From d48b85d50cdb30af941c0dc4eccbb8971e902011 Mon Sep 17 00:00:00 2001 From: Jonathan Coates Date: Sun, 26 May 2024 10:16:33 +0100 Subject: [PATCH 09/12] Add r+/w+ support to io library --- .../dan200/computercraft/core/apis/FSAPI.java | 8 ++++---- .../data/computercraft/lua/rom/apis/io.lua | 16 +++++++++------- .../resources/test-rom/spec/apis/io_spec.lua | 15 +++++++++++++++ 3 files changed, 28 insertions(+), 11 deletions(-) diff --git a/projects/core/src/main/java/dan200/computercraft/core/apis/FSAPI.java b/projects/core/src/main/java/dan200/computercraft/core/apis/FSAPI.java index a359320dd..794d8b7c4 100644 --- a/projects/core/src/main/java/dan200/computercraft/core/apis/FSAPI.java +++ b/projects/core/src/main/java/dan200/computercraft/core/apis/FSAPI.java @@ -309,10 +309,10 @@ public class FSAPI implements ILuaAPI { *

* The {@code mode} string can be any of the following: *

    - *
  • "r": Read mode
  • - *
  • "w": Write mode
  • - *
  • "a": Append mode
  • - *
  • "r+": Update mode (allows reading and writing), all data is preserved
  • + *
  • "r": Read mode.
  • + *
  • "w": Write mode.
  • + *
  • "a": Append mode.
  • + *
  • "r+": Update mode (allows reading and writing), all data is preserved.
  • *
  • "w+": Update mode, all data is erased.
  • *
*

diff --git a/projects/core/src/main/resources/data/computercraft/lua/rom/apis/io.lua b/projects/core/src/main/resources/data/computercraft/lua/rom/apis/io.lua index 34d6d075a..6291318da 100644 --- a/projects/core/src/main/resources/data/computercraft/lua/rom/apis/io.lua +++ b/projects/core/src/main/resources/data/computercraft/lua/rom/apis/io.lua @@ -365,24 +365,26 @@ end -- or [`nil`], plus an error message. -- -- The `mode` string can be any of the following: --- - **"r"**: Read mode --- - **"w"**: Write mode --- - **"a"**: Append mode +-- - **"r"**: Read mode. +-- - **"w"**: Write mode. +-- - **"a"**: Append mode. +-- - **"r+"**: Update mode (allows reading and writing), all data is preserved. +-- - **"w+"**: Update mode, all data is erased. -- -- The mode may also have a `b` at the end, which opens the file in "binary --- mode". This allows you to read binary files, as well as seek within a file. +-- mode". This has no impact on functionality. -- -- @tparam string filename The name of the file to open. --- @tparam[opt] string mode The mode to open the file with. This defaults to `rb`. +-- @tparam[opt] string mode The mode to open the file with. This defaults to `r`. -- @treturn[1] Handle The opened file. -- @treturn[2] nil In case of an error. -- @treturn[2] string The reason the file could not be opened. +-- @changed 1.111.0 Add support for `r+` and `w+`. function open(filename, mode) expect(1, filename, "string") expect(2, mode, "string", "nil") - local sMode = mode and mode:gsub("%+", "") or "r" - local file, err = fs.open(filename, sMode) + local file, err = fs.open(filename, mode or "r") if not file then return nil, err end return make_file(file) diff --git a/projects/core/src/test/resources/test-rom/spec/apis/io_spec.lua b/projects/core/src/test/resources/test-rom/spec/apis/io_spec.lua index dd850d530..daa1a54cc 100644 --- a/projects/core/src/test/resources/test-rom/spec/apis/io_spec.lua +++ b/projects/core/src/test/resources/test-rom/spec/apis/io_spec.lua @@ -329,4 +329,19 @@ describe("The io library", function() expect(read_all(file)):eq("alo\n " .. t .. " ;end of file\n") end) end) + + describe("read/write handles", function() + it("can read and write to a file", function() + write_file(file, "an example file") + + local handle = io.open(file, "r+") + expect(handle:read(3)):eq("an ") + + handle:write("exciting file") + expect(handle:seek("cur")):eq(16) + + handle:seek("set", 0) + expect(handle:read("*a")):eq("an exciting file") + end) + end) end) From 862d92785e5f349f593e574f99931421d8b0c588 Mon Sep 17 00:00:00 2001 From: Jonathan Coates Date: Tue, 28 May 2024 09:47:12 +0100 Subject: [PATCH 10/12] Don't expose a menu provider for computers We can't safely use this anyway (as custom data is not sent), so better not to expose it at all. Fixes #1844. --- .../shared/computer/blocks/AbstractComputerBlock.java | 8 -------- 1 file changed, 8 deletions(-) diff --git a/projects/common/src/main/java/dan200/computercraft/shared/computer/blocks/AbstractComputerBlock.java b/projects/common/src/main/java/dan200/computercraft/shared/computer/blocks/AbstractComputerBlock.java index 46af2e6ff..263456005 100644 --- a/projects/common/src/main/java/dan200/computercraft/shared/computer/blocks/AbstractComputerBlock.java +++ b/projects/common/src/main/java/dan200/computercraft/shared/computer/blocks/AbstractComputerBlock.java @@ -18,7 +18,6 @@ import net.minecraft.server.level.ServerLevel; import net.minecraft.stats.Stats; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; -import net.minecraft.world.MenuProvider; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; @@ -196,13 +195,6 @@ public abstract class AbstractComputerBlock BlockEntityTicker getTicker(Level level, BlockState state, BlockEntityType type) { From 0c9f9a86521e24f44780dad33790031c0c55fc34 Mon Sep 17 00:00:00 2001 From: Jonathan Coates Date: Tue, 28 May 2024 18:10:50 +0100 Subject: [PATCH 11/12] Warn when Optifine is installed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We keep getting bug reports on 1.20.1 about an Optifine bug that causes Forge's capabilities to not work (#1458). The cause of this bug is not immediately visible to users, and can be very confusing when hit. Optifine have not released a fix for this bug (despite it being reported a year ago), and we continue to receive bug reports about it. Nobody likes it when mods complain about other mods. So much Minecraft drama can be traced back to this, and it's a slippery slope to go down. I've tried to keep this as unobtrusive as possible — it's just a chat message at world join, and it'll turn off if the bug is fixed. --- .../shared/ForgeCommonHooks.java | 7 ++ .../shared/integration/Optifine.java | 84 +++++++++++++++++++ 2 files changed, 91 insertions(+) create mode 100644 projects/forge/src/main/java/dan200/computercraft/shared/integration/Optifine.java diff --git a/projects/forge/src/main/java/dan200/computercraft/shared/ForgeCommonHooks.java b/projects/forge/src/main/java/dan200/computercraft/shared/ForgeCommonHooks.java index 05c95398b..eb03e9e6d 100644 --- a/projects/forge/src/main/java/dan200/computercraft/shared/ForgeCommonHooks.java +++ b/projects/forge/src/main/java/dan200/computercraft/shared/ForgeCommonHooks.java @@ -8,6 +8,7 @@ import dan200.computercraft.api.ComputerCraftAPI; import dan200.computercraft.shared.command.CommandComputerCraft; import dan200.computercraft.shared.computer.blocks.ComputerBlockEntity; import dan200.computercraft.shared.config.Config; +import dan200.computercraft.shared.integration.Optifine; import dan200.computercraft.shared.network.client.UpgradesLoadedMessage; import dan200.computercraft.shared.network.server.ServerNetworking; import dan200.computercraft.shared.peripheral.commandblock.CommandBlockPeripheral; @@ -29,6 +30,7 @@ import net.minecraft.world.level.chunk.LevelChunk; import net.minecraftforge.event.*; import net.minecraftforge.event.entity.EntityJoinLevelEvent; import net.minecraftforge.event.entity.living.LivingDropsEvent; +import net.minecraftforge.event.entity.player.PlayerEvent; import net.minecraftforge.event.level.ChunkEvent; import net.minecraftforge.event.level.ChunkTicketLevelUpdatedEvent; import net.minecraftforge.event.level.ChunkWatchEvent; @@ -61,6 +63,11 @@ public class ForgeCommonHooks { CommonHooks.onServerStarting(event.getServer()); } + @SubscribeEvent + public static void onPlayerJoin(PlayerEvent.PlayerLoggedInEvent event) { + Optifine.warnAboutOptifine(event.getEntity()::sendSystemMessage); + } + @SubscribeEvent public static void onServerStopped(ServerStoppedEvent event) { CommonHooks.onServerStopped(); diff --git a/projects/forge/src/main/java/dan200/computercraft/shared/integration/Optifine.java b/projects/forge/src/main/java/dan200/computercraft/shared/integration/Optifine.java new file mode 100644 index 000000000..da450a8ef --- /dev/null +++ b/projects/forge/src/main/java/dan200/computercraft/shared/integration/Optifine.java @@ -0,0 +1,84 @@ +// SPDX-FileCopyrightText: 2024 The CC: Tweaked Developers +// +// SPDX-License-Identifier: MPL-2.0 + +package dan200.computercraft.shared.integration; + +import dan200.computercraft.core.util.Nullability; +import dan200.computercraft.shared.Capabilities; +import dan200.computercraft.shared.ModRegistry; +import net.minecraft.ChatFormatting; +import net.minecraft.core.BlockPos; +import net.minecraft.network.chat.ClickEvent; +import net.minecraft.network.chat.Component; +import net.minecraft.world.level.block.entity.BlockEntity; + +import java.util.function.Consumer; + +/** + * Detect whether Optifine is installed. + */ +public final class Optifine { + private static final boolean LOADED; + + static { + boolean loaded; + try { + Class.forName("optifine.Installer", false, Optifine.class.getClassLoader()); + loaded = true; + } catch (ReflectiveOperationException | LinkageError ignore) { + loaded = false; + } + + LOADED = loaded; + } + + private Optifine() { + } + + public static boolean isLoaded() { + return LOADED; + } + + + /** + * This rant probably should be in a commit message, but sometimes I want it visible in the code. + *

+ * There is a long-standing Optifine issue (#7549, + * #7395) that causes a block entity's + * {@link BlockEntity#gatherCapabilities()} not to be called. This causes peripherals to not show up for block + * entities. + *

+ * While the bug is marked as fixed, there has not been a release since, and it continues to affect users a year + * after being reported. This is a frequent problem with Optifine (see also #7127 + * and #7261 which I still get bug reports + * about), and this doesn't seem likely to change any time soon. + *

+ * The ideal situation would be that any time the game starts with Optifine, we delete it from the mods folder. + * That's probably a little uncouth (and a pain to get working on Windows), so instead we try to detect the bug in + * question and print a message in chat whenever a player joins. + * + * @param send The object to send a message too. + */ + public static void warnAboutOptifine(Consumer send) { + if (!Optifine.isLoaded()) return; + + var computer = Nullability.assertNonNull(ModRegistry.BlockEntities.COMPUTER_NORMAL.get().create( + BlockPos.ZERO, ModRegistry.Blocks.COMPUTER_NORMAL.get().defaultBlockState() + )); + if (computer.getCapability(Capabilities.CAPABILITY_PERIPHERAL).isPresent()) return; + + send.accept( + Component.literal("") + .append(Component.literal("(CC: Tweaked) ").withStyle(ChatFormatting.GRAY)) + .append(Component.literal("[WARNING] ").withStyle(ChatFormatting.RED)) + .append("It looks like you're running Optifine. This has an ") + .append(Component.literal("unfixed issue").withStyle(s -> s + .withColor(ChatFormatting.BLUE).withUnderlined(true) + .withClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, "https://github.com/sp614x/optifine/issues/7549")) + )) + .append(" which causes issues with many modded block entities, including those added by CC: Tweaked. " + + "Please replace Optifine with an alternative shader mod such as Oculus.") + ); + } +} From 209b1ddbf9bc0396481d39ac5cdb8e7234714ae2 Mon Sep 17 00:00:00 2001 From: Jonathan Coates Date: Tue, 28 May 2024 18:19:13 +0100 Subject: [PATCH 12/12] Bump CC:T to 1.111.0 --- gradle.properties | 2 +- .../data/computercraft/lua/rom/help/changelog.md | 12 ++++++++++++ .../data/computercraft/lua/rom/help/whatsnew.md | 12 ++++++++---- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/gradle.properties b/gradle.properties index 215a03030..adf404ab3 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,7 +10,7 @@ kotlin.jvm.target.validation.mode=error # Mod properties isUnstable=false -modVersion=1.110.3 +modVersion=1.111.0 # 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 45a40bbda..863f6448e 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,15 @@ +# New features in CC: Tweaked 1.111.0 + +* Update several translations (Ale32bit). +* Split up turtle textures into individual textures. +* Add `r+`/`w+` support to the `io` library. +* Warn when capabilities are not registered and Optifine is installed. + +Several bug fixes: +* Allow planks to be used for building in "adventure" (dan200). +* Fix `disk.getAudioTitle()` returning untranslated strings for some modded discs. +* Fix crash when right clicking turtles in spectator. + # New features in CC: Tweaked 1.110.3 * Update several translations (PatriikPlays). 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 0a9ec167e..90f960dd9 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,9 +1,13 @@ -New features in CC: Tweaked 1.110.3 +New features in CC: Tweaked 1.111.0 -* Update several translations (PatriikPlays). +* Update several translations (Ale32bit). +* Split up turtle textures into individual textures. +* Add `r+`/`w+` support to the `io` library. +* Warn when capabilities are not registered and Optifine is installed. Several bug fixes: -* Fix some errors missing source positions. -* Correctly handle multiple threads sending websocket messages at once. +* Allow planks to be used for building in "adventure" (dan200). +* Fix `disk.getAudioTitle()` returning untranslated strings for some modded discs. +* Fix crash when right clicking turtles in spectator. Type "help changelog" to see the full version history.