From 7b4ba11fb4b21e614612ab638a0a43d2401f6e7c Mon Sep 17 00:00:00 2001 From: Jonathan Coates Date: Sat, 17 Jun 2023 10:46:34 +0100 Subject: [PATCH] Allow changing turtle upgrades from the GUI This adds two slots to the right of the turtle interface which contain the left and right upgrades of a turtle. - Add turtle_upgrade_{left,right} indicators, which used as the background texture for the two upgrade slots. In order to use Slot.getNoItemIcon, we need to bake these into the block texture atlas. This is done with the new atlas JSON and a data generator - it's mostly pretty simple, but we do now need a client-side data generator, which is a little ugly to do. - Add a new UpgradeContainer/UpgradeSlot, which exposes a turtle's upgrades in an inventory-like way. - Update the turtle menu and screen to handle these new slots. --- .../client/gui/TurtleScreen.java | 12 +- .../data/client/ClientDataProviders.java | 34 ++++++ .../computercraft/data/DataProviders.java | 9 ++ .../shared/turtle/inventory/TurtleMenu.java | 13 ++- .../turtle/inventory/UpgradeContainer.java | 108 ++++++++++++++++++ .../shared/turtle/inventory/UpgradeSlot.java | 50 ++++++++ .../textures/gui/turtle_advanced.png | Bin 1004 -> 1455 bytes .../textures/gui/turtle_normal.png | Bin 983 -> 1415 bytes .../textures/gui/turtle_upgrade_left.png | Bin 0 -> 129 bytes .../gui/turtle_upgrade_left.png.license | 3 + .../textures/gui/turtle_upgrade_right.png | Bin 0 -> 129 bytes .../gui/turtle_upgrade_right.png.license | 3 + projects/fabric/build.gradle.kts | 2 +- .../assets/minecraft/atlases/blocks.json | 6 + .../assets/minecraft/atlases/blocks.json | 6 + 15 files changed, 237 insertions(+), 9 deletions(-) create mode 100644 projects/common/src/client/java/dan200/computercraft/data/client/ClientDataProviders.java create mode 100644 projects/common/src/main/java/dan200/computercraft/shared/turtle/inventory/UpgradeContainer.java create mode 100644 projects/common/src/main/java/dan200/computercraft/shared/turtle/inventory/UpgradeSlot.java create mode 100644 projects/common/src/main/resources/assets/computercraft/textures/gui/turtle_upgrade_left.png create mode 100644 projects/common/src/main/resources/assets/computercraft/textures/gui/turtle_upgrade_left.png.license create mode 100644 projects/common/src/main/resources/assets/computercraft/textures/gui/turtle_upgrade_right.png create mode 100644 projects/common/src/main/resources/assets/computercraft/textures/gui/turtle_upgrade_right.png.license create mode 100644 projects/fabric/src/generated/resources/assets/minecraft/atlases/blocks.json create mode 100644 projects/forge/src/generated/resources/assets/minecraft/atlases/blocks.json diff --git a/projects/common/src/client/java/dan200/computercraft/client/gui/TurtleScreen.java b/projects/common/src/client/java/dan200/computercraft/client/gui/TurtleScreen.java index f99bc32ac..f31ff8ab1 100644 --- a/projects/common/src/client/java/dan200/computercraft/client/gui/TurtleScreen.java +++ b/projects/common/src/client/java/dan200/computercraft/client/gui/TurtleScreen.java @@ -26,9 +26,11 @@ public class TurtleScreen extends AbstractComputerScreen { private static final ResourceLocation BACKGROUND_NORMAL = new ResourceLocation(ComputerCraftAPI.MOD_ID, "textures/gui/turtle_normal.png"); private static final ResourceLocation BACKGROUND_ADVANCED = new ResourceLocation(ComputerCraftAPI.MOD_ID, "textures/gui/turtle_advanced.png"); - private static final int TEX_WIDTH = 254; + private static final int TEX_WIDTH = 278; private static final int TEX_HEIGHT = 217; + private static final int FULL_TEX_SIZE = 512; + public TurtleScreen(TurtleMenu container, Inventory player, Component title) { super(container, player, title, BORDER); @@ -45,16 +47,16 @@ public class TurtleScreen extends AbstractComputerScreen { protected void renderBg(PoseStack transform, float partialTicks, int mouseX, int mouseY) { var advanced = family == ComputerFamily.ADVANCED; RenderSystem.setShaderTexture(0, advanced ? BACKGROUND_ADVANCED : BACKGROUND_NORMAL); - blit(transform, leftPos + AbstractComputerMenu.SIDEBAR_WIDTH, topPos, 0, 0, TEX_WIDTH, TEX_HEIGHT); + blit(transform, leftPos + AbstractComputerMenu.SIDEBAR_WIDTH, topPos, 0, 0, 0, TEX_WIDTH, TEX_HEIGHT, FULL_TEX_SIZE, FULL_TEX_SIZE); + // Render selected slot var slot = getMenu().getSelectedSlot(); if (slot >= 0) { - RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F); var slotX = slot % 4; var slotY = slot / 4; blit(transform, - leftPos + TURTLE_START_X - 2 + slotX * 18, topPos + PLAYER_START_Y - 2 + slotY * 18, - 0, 217, 24, 24 + leftPos + TURTLE_START_X - 2 + slotX * 18, topPos + PLAYER_START_Y - 2 + slotY * 18, 0, + 0, 217, 24, 24, FULL_TEX_SIZE, FULL_TEX_SIZE ); } diff --git a/projects/common/src/client/java/dan200/computercraft/data/client/ClientDataProviders.java b/projects/common/src/client/java/dan200/computercraft/data/client/ClientDataProviders.java new file mode 100644 index 000000000..61d4dd6cf --- /dev/null +++ b/projects/common/src/client/java/dan200/computercraft/data/client/ClientDataProviders.java @@ -0,0 +1,34 @@ +// SPDX-FileCopyrightText: 2023 The CC: Tweaked Developers +// +// SPDX-License-Identifier: MPL-2.0 + +package dan200.computercraft.data.client; + +import dan200.computercraft.data.DataProviders; +import dan200.computercraft.shared.turtle.inventory.UpgradeSlot; +import net.minecraft.client.renderer.texture.atlas.SpriteSources; +import net.minecraft.client.renderer.texture.atlas.sources.SingleFile; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.server.packs.PackType; + +import java.util.List; +import java.util.Optional; + +/** + * A version of {@link DataProviders} which relies on client-side classes. + *

+ * This is called from {@link DataProviders#add(DataProviders.GeneratorSink)}. + */ +public final class ClientDataProviders { + private ClientDataProviders() { + } + + public static void add(DataProviders.GeneratorSink generator) { + generator.addFromCodec("Block atlases", PackType.CLIENT_RESOURCES, "atlases", SpriteSources.FILE_CODEC, out -> { + out.accept(new ResourceLocation("blocks"), List.of( + new SingleFile(UpgradeSlot.LEFT_UPGRADE, Optional.empty()), + new SingleFile(UpgradeSlot.RIGHT_UPGRADE, Optional.empty()) + )); + }); + } +} diff --git a/projects/common/src/main/java/dan200/computercraft/data/DataProviders.java b/projects/common/src/main/java/dan200/computercraft/data/DataProviders.java index a4abd7c8f..c5f8aa661 100644 --- a/projects/common/src/main/java/dan200/computercraft/data/DataProviders.java +++ b/projects/common/src/main/java/dan200/computercraft/data/DataProviders.java @@ -41,6 +41,15 @@ public final class DataProviders { generator.models(BlockModelProvider::addBlockModels, ItemModelProvider::addItemModels); generator.add(out -> new LanguageProvider(out, turtleUpgrades, pocketUpgrades)); + + // Unfortunately we rely on some client-side classes in this code. We just load in the client side data provider + // and invoke that. + try { + Class.forName("dan200.computercraft.data.client.ClientDataProviders") + .getMethod("add", GeneratorSink.class).invoke(null, generator); + } catch (ReflectiveOperationException e) { + throw new RuntimeException(e); + } } public interface GeneratorSink { diff --git a/projects/common/src/main/java/dan200/computercraft/shared/turtle/inventory/TurtleMenu.java b/projects/common/src/main/java/dan200/computercraft/shared/turtle/inventory/TurtleMenu.java index 77116234b..61d2e67d8 100644 --- a/projects/common/src/main/java/dan200/computercraft/shared/turtle/inventory/TurtleMenu.java +++ b/projects/common/src/main/java/dan200/computercraft/shared/turtle/inventory/TurtleMenu.java @@ -4,6 +4,7 @@ package dan200.computercraft.shared.turtle.inventory; +import dan200.computercraft.api.turtle.TurtleSide; import dan200.computercraft.shared.ModRegistry; import dan200.computercraft.shared.computer.core.ComputerFamily; import dan200.computercraft.shared.computer.core.ServerComputer; @@ -29,12 +30,13 @@ public final class TurtleMenu extends AbstractComputerMenu { public static final int PLAYER_START_Y = 134; public static final int TURTLE_START_X = SIDEBAR_WIDTH + 175; public static final int PLAYER_START_X = SIDEBAR_WIDTH + BORDER; + public static final int UPGRADE_START_X = SIDEBAR_WIDTH + 254; private final ContainerData data; private TurtleMenu( int id, Predicate canUse, ComputerFamily family, @Nullable ServerComputer computer, @Nullable ComputerContainerData menuData, - Inventory playerInventory, Container inventory, ContainerData data + Inventory playerInventory, Container inventory, Container turtleUpgrades, ContainerData data ) { super(ModRegistry.Menus.TURTLE.get(), id, canUse, family, computer, menuData); this.data = data; @@ -58,19 +60,24 @@ public final class TurtleMenu extends AbstractComputerMenu { for (var x = 0; x < 9; x++) { addSlot(new Slot(playerInventory, x, PLAYER_START_X + x * 18, PLAYER_START_Y + 3 * 18 + 5)); } + + // Turtle upgrades + addSlot(new UpgradeSlot(turtleUpgrades, TurtleSide.LEFT, 0, UPGRADE_START_X, PLAYER_START_Y + 1)); + addSlot(new UpgradeSlot(turtleUpgrades, TurtleSide.RIGHT, 1, UPGRADE_START_X, PLAYER_START_Y + 1 + 18)); } public static TurtleMenu ofBrain(int id, Inventory player, TurtleBrain turtle) { return new TurtleMenu( // Laziness in turtle.getOwner() is important here! id, p -> turtle.getOwner().stillValid(p), turtle.getFamily(), turtle.getOwner().createServerComputer(), null, - player, turtle.getInventory(), (SingleContainerData) turtle::getSelectedSlot + player, turtle.getInventory(), new UpgradeContainer(turtle), (SingleContainerData) turtle::getSelectedSlot ); } public static TurtleMenu ofMenuData(int id, Inventory player, ComputerContainerData data) { return new TurtleMenu( - id, x -> true, data.family(), null, data, player, new SimpleContainer(TurtleBlockEntity.INVENTORY_SIZE), new SimpleContainerData(1) + id, x -> true, data.family(), null, data, + player, new SimpleContainer(TurtleBlockEntity.INVENTORY_SIZE), new SimpleContainer(2), new SimpleContainerData(1) ); } diff --git a/projects/common/src/main/java/dan200/computercraft/shared/turtle/inventory/UpgradeContainer.java b/projects/common/src/main/java/dan200/computercraft/shared/turtle/inventory/UpgradeContainer.java new file mode 100644 index 000000000..22d918626 --- /dev/null +++ b/projects/common/src/main/java/dan200/computercraft/shared/turtle/inventory/UpgradeContainer.java @@ -0,0 +1,108 @@ +// SPDX-FileCopyrightText: 2023 The CC: Tweaked Developers +// +// SPDX-License-Identifier: MPL-2.0 + +package dan200.computercraft.shared.turtle.inventory; + +import dan200.computercraft.api.turtle.ITurtleAccess; +import dan200.computercraft.api.turtle.ITurtleUpgrade; +import dan200.computercraft.api.turtle.TurtleSide; +import dan200.computercraft.impl.TurtleUpgrades; +import net.minecraft.core.NonNullList; +import net.minecraft.world.Container; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.ItemStack; + +import java.util.Arrays; +import java.util.List; + +/** + * A fake {@link Container} which exposes the {@linkplain ITurtleAccess#getUpgrade(TurtleSide) upgrades} a turtle has. + * + * @see TurtleMenu + * @see UpgradeSlot + */ +class UpgradeContainer implements Container { + private static final int SIZE = 2; + + private final ITurtleAccess turtle; + + private final List lastUpgrade = Arrays.asList(null, null); + private final NonNullList lastStack = NonNullList.withSize(2, ItemStack.EMPTY); + + UpgradeContainer(ITurtleAccess turtle) { + this.turtle = turtle; + } + + private TurtleSide getSide(int slot) { + return switch (slot) { + case 0 -> TurtleSide.LEFT; + case 1 -> TurtleSide.RIGHT; + default -> throw new IllegalArgumentException("Invalid slot " + slot); + }; + } + + @Override + public ItemStack getItem(int slot) { + var upgrade = turtle.getUpgrade(getSide(slot)); + + // We don't want to return getCraftingItem directly here, as consumers may mutate the stack (they shouldn't!, + // but if they do it's a pain to track down). To avoid recreating the stack each tick, we maintain a simple + // cache. + if (upgrade == lastUpgrade.get(slot)) return lastStack.get(slot); + + var stack = upgrade == null ? ItemStack.EMPTY : upgrade.getCraftingItem().copy(); + lastUpgrade.set(slot, upgrade); + lastStack.set(slot, stack); + return stack; + } + + @Override + public void setItem(int slot, ItemStack itemStack) { + turtle.setUpgrade(getSide(slot), TurtleUpgrades.instance().get(itemStack)); + } + + @Override + public int getContainerSize() { + return SIZE; + } + + @Override + public int getMaxStackSize() { + return 1; + } + + @Override + public boolean isEmpty() { + for (var i = 0; i < SIZE; i++) { + if (!getItem(i).isEmpty()) return false; + } + return true; + } + + @Override + public ItemStack removeItem(int slot, int count) { + return count <= 0 ? ItemStack.EMPTY : removeItemNoUpdate(slot); + } + + @Override + public ItemStack removeItemNoUpdate(int slot) { + var current = getItem(slot); + setItem(slot, ItemStack.EMPTY); + return current; + } + + @Override + public void setChanged() { + } + + @Override + public boolean stillValid(Player player) { + return true; + } + + @Override + public void clearContent() { + for (var i = 0; i < SIZE; i++) setItem(i, ItemStack.EMPTY); + } +} diff --git a/projects/common/src/main/java/dan200/computercraft/shared/turtle/inventory/UpgradeSlot.java b/projects/common/src/main/java/dan200/computercraft/shared/turtle/inventory/UpgradeSlot.java new file mode 100644 index 000000000..7947785e1 --- /dev/null +++ b/projects/common/src/main/java/dan200/computercraft/shared/turtle/inventory/UpgradeSlot.java @@ -0,0 +1,50 @@ +// SPDX-FileCopyrightText: 2023 The CC: Tweaked Developers +// +// SPDX-License-Identifier: MPL-2.0 + +package dan200.computercraft.shared.turtle.inventory; + +import com.mojang.datafixers.util.Pair; +import dan200.computercraft.api.ComputerCraftAPI; +import dan200.computercraft.api.turtle.TurtleSide; +import dan200.computercraft.impl.TurtleUpgrades; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.Container; +import net.minecraft.world.inventory.InventoryMenu; +import net.minecraft.world.inventory.Slot; +import net.minecraft.world.item.ItemStack; + +import javax.annotation.Nullable; + +/** + * A slot in the turtle UI which holds the turtle's current upgrade. + * + * @see TurtleMenu + */ +public class UpgradeSlot extends Slot { + public static final ResourceLocation LEFT_UPGRADE = new ResourceLocation(ComputerCraftAPI.MOD_ID, "gui/turtle_upgrade_left"); + public static final ResourceLocation RIGHT_UPGRADE = new ResourceLocation(ComputerCraftAPI.MOD_ID, "gui/turtle_upgrade_right"); + + private final TurtleSide side; + + public UpgradeSlot(Container container, TurtleSide side, int slot, int xPos, int yPos) { + super(container, slot, xPos, yPos); + this.side = side; + } + + @Override + public boolean mayPlace(ItemStack stack) { + return TurtleUpgrades.instance().get(stack) != null; + } + + @Override + public int getMaxStackSize() { + return 1; + } + + @Nullable + @Override + public Pair getNoItemIcon() { + return Pair.of(InventoryMenu.BLOCK_ATLAS, side == TurtleSide.LEFT ? LEFT_UPGRADE : RIGHT_UPGRADE); + } +} diff --git a/projects/common/src/main/resources/assets/computercraft/textures/gui/turtle_advanced.png b/projects/common/src/main/resources/assets/computercraft/textures/gui/turtle_advanced.png index 74a149a4744b52abf881f2ab0b81ec57e80bf063..8f7d66500bc458800fa8879114a0b3e886e51b14 100644 GIT binary patch delta 1134 zcmaFEzMfmPGr-TCmrII^fq{Y7)59f*fq@CgWMbf822zKYshj{(ws!DJ+`&{nzo+@4XpA1O?MA&;QNHe<4>N@NDnD7}f>`kG*Ui9gAa@@7@3SQaryx z+e*LRXHP7R=Tx|QTuIH&xsgGDfeDBl7&sUh6&P3=Kzu52>XD3lAjcGuX7|^LA&!|E zMkARFb?CduslUH;FT3Bnx|nUk`?wAA`BL@$^{aweKm0Zg*mM5-r~8to^7X$h0~uX^ zDxN#ja$V-Afj^^I<2_adhD-Z-ZK7%uzCUS{y?Oh|{hj+S|H-NEORtgMvHR13htt{1 zQnsAj|M@{%y0yeiTmdE5xcV={?)KIFHd~bcKfift=Pl9tIXUhZe9v#&FMP6$RsF7D zNrw9bQ&7la34sqYZVFC`c_-_5_6~J%TG_hWf$`40OFy3SEikBC#=ruNv@K_3%UE=8?^o`)_P4(1g<3hw(px`2 zZ?|^Hz9E>x+rV(+i%7xhonKG>Y)gBx``zQG@3I@Vz2Q10f)VHcm*oCte8b@-ci>)z zvAY2oXe39t0#IcimL0L@kM#s?c>d#)gK?M5ZL>YpLw!cgH_wt zE#|AcIzAsgx@OgB3yqrp(eoHqt#CKoS@z~-XW_}umIos1-`=?VLUM))iSr#`;^*Wa|d|e%T?iibzKf~twHt7S!Ak(vIkD7b#cGpN| z_}mul@P*fB7DLs?Ga4y;2~u;nHeX)Zc(Ry1Vom(pd729T49n-v&+b03DLLU1%Z2?B zyKgn$az9wfq*0yyUw)VE_n!q)p&{$7Q>RRyoAvQ`Sisk5SEv17c2?M74xb;J;B@_C z-F`>bSie4}%P7PuYG5<>$eMe7CkwZ}xHh?N%G08U=824xCowugco-U3d6}R5r&Gr{|6k&U?Nhu&DCvc5< z$b^ek2f4c}iav(9p8Ega(JaL0%_rB(Zl@~mEz2~LH=DbB^XA!?@7{D<9O&wsJmZx` z)~W}8?eDGiWBiu9?DEPshTlM|UK}}f*2-Z`aKk@IhF(U8$pWmd?BaY2CJVCK z)bE(Vpg7;!=JW4!7o-11e0);~)bpqE_n(Yi&(}Wv;@zK`t^bFd)Aa?Pm9 zE1ezSnvunzww0TqgYScX^`*oA14PRtSYR4~w1Z2-$yj9*RffsY9-IyZ4VgRrE+l0E zB_!_G>!^Fb4BI_-gXB8Z7}ody9Tc+ss_H9#Z2kUm!xZ!PryVt`pO#9hut%l-sy_Gg z-h;g#lT7cQTiskAUN>zz6XTa6?X$~Umre_x?6Lfib$M3szxIgY1Gi!yWnA9A^=822 z2e;=2ecQI}^zNcb&2joS0u}PtJ)84B@7dRb$D0pk=PC<1#Cc{WuDhFOb~#D=?9wYy jdCNUa9R(p^V#ZI-m65-k7a5nF1%;QVtDnm{r-UW|$K)Lc diff --git a/projects/common/src/main/resources/assets/computercraft/textures/gui/turtle_normal.png b/projects/common/src/main/resources/assets/computercraft/textures/gui/turtle_normal.png index 83b6a882ed5ea9844cc4d44fea53cc471baccffa..f676c56b20d2173381b54b6ecef670edc0c0b78c 100644 GIT binary patch literal 1415 zcmd5(Sx}p06#f2?whT(yUO+p5u?Ar*ty^k~w4nqjTcAx)9Eb@45-5aF5}-nXU!BTQ z5eA&L$Yz1Cgb)gW!LmmdanP9-!LTF{@)2+uPUI zH!(3WJ3A|pNap9~7Zw&47Z;b7mZVatOeR}iUS3&Qk;~<)tE&oyVr^|rsZ^>|s*Q~e zjYhM#w|8)GaCmsA*Xs=igVAU-nM`K0nHM%wYgr89UMG?OUOCSI08I%d_>pfdYGtw; z(m-c;m3>-UR*mOGp8XwlB?2{UL(R-_2|vlXF*P%p8Jg8QP?2LF<`nu6jhj^Ozh4+1 zEvPy_BXCwYUci13aNN+lUl)?3Q6M3aqMkq$6h^_S$~VaRVs#T~~L^ z@>;)Ux|C;r3r?VxbZT;4kC*dd`l=SP2Pk{k)8g^K8bIy<4TFC@kQ<;EUCs`ObX!Ln z|ACBaaHU>1Ju5GN8?H#(EhuUK@tMS*4=$ZCtVazOn5y@GK|1q8$#_r6O(gi>PTy0N z=P33`A3)=ucYextHOVvdZ?@^&-G)e;X}2Itq6os{}}Y5p1qn%&=C z1~&8bI{+bxBUo!UFP*8?lf*={(Wg#Le&pm=iR}H;RYgidWX9tNbT|j|I%c}qT?3&< z$2{Fs?u0)LDmQ>Qp0J zK(tCI_XQ}qv`$pr)UEE%M z>5zf;v2O6hcSFvlzGZicgPri2!1&xHBn%3>P-Usp{N%RmM-}+ z>vmy3?#*OWv^LOZI8zmsUI+MdNp|T^b1&BflK51$mzpxitxq%joYCt26$2Xz{G~#3 ztX)?@*X4H|D6+XBE5BmYylHOop`dYy)gMq0ONg?q-2wj-8?7-~ERN@z`zJ(GBR*51F7sa5g|b8c7RWaE06|)-@kuP z)HzoF=g*(NfB*jb_wWDz|B8=hX8>iGOM?7@85sZV%+P9KU|?F|>EaktaqI2fY=2=# z5w-`fx;R24qeKE%bFi=1&{A60v_0$f|NpLGU7Z_ha)eJ+-dpBrEN?b<`R2`&C%?;C zeRb8QWu|_nXJ%=1F=_dtOUZDpddm4q6=L_7e=1E zqE+u?%xthWn8Bf}VdhG%-8@W4$`q6jeEFwrqReplwg;y}QA6ZPuG>DmKn23D{~J22 z{`Ffk^H?=!_{rb)LMLWDzQ@mI|0|xo^zXam+K}t*UvF1U@z`?u%leKAi>my+?~d+$ z8}~&i?pTphLtV)!r^pz+r6s4mcGut0dirzoB#sB=CRMxTXEMAB@4Z*oe|sjwEcY^$XR1hd#(# z{PLpHGQkZOGiR+?62%c~e|yV!lgmLr9@HhD`adU|@5Y|WZ7-ict64TRVUPWa*N6B1 z{pI6aJ7;m7{moE?vZ~vH{AEeXN^<>iv!iD+B(0rtbZOr9yL#rCG4O%BaI=U97aPN_ Xe;ho)$+ACynixD?{an^LB{Ts56R09N literal 0 HcmV?d00001 diff --git a/projects/common/src/main/resources/assets/computercraft/textures/gui/turtle_upgrade_right.png.license b/projects/common/src/main/resources/assets/computercraft/textures/gui/turtle_upgrade_right.png.license new file mode 100644 index 000000000..05aed57f6 --- /dev/null +++ b/projects/common/src/main/resources/assets/computercraft/textures/gui/turtle_upgrade_right.png.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2023 The CC: Tweaked Developers + +SPDX-License-Identifier: MPL-2.0 diff --git a/projects/fabric/build.gradle.kts b/projects/fabric/build.gradle.kts index f2aef9cb8..13b8e7065 100644 --- a/projects/fabric/build.gradle.kts +++ b/projects/fabric/build.gradle.kts @@ -119,7 +119,7 @@ loom { register("data") { configName = "Datagen" - server() + client() runDir("run/dataGen") property("cct.pretty-json") diff --git a/projects/fabric/src/generated/resources/assets/minecraft/atlases/blocks.json b/projects/fabric/src/generated/resources/assets/minecraft/atlases/blocks.json new file mode 100644 index 000000000..d9d236296 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/minecraft/atlases/blocks.json @@ -0,0 +1,6 @@ +{ + "sources": [ + {"type": "minecraft:single", "resource": "computercraft:gui/turtle_upgrade_left"}, + {"type": "minecraft:single", "resource": "computercraft:gui/turtle_upgrade_right"} + ] +} diff --git a/projects/forge/src/generated/resources/assets/minecraft/atlases/blocks.json b/projects/forge/src/generated/resources/assets/minecraft/atlases/blocks.json new file mode 100644 index 000000000..d9d236296 --- /dev/null +++ b/projects/forge/src/generated/resources/assets/minecraft/atlases/blocks.json @@ -0,0 +1,6 @@ +{ + "sources": [ + {"type": "minecraft:single", "resource": "computercraft:gui/turtle_upgrade_left"}, + {"type": "minecraft:single", "resource": "computercraft:gui/turtle_upgrade_right"} + ] +}