diff --git a/gradle.properties b/gradle.properties index f395aa0f3..b89aafb5e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -13,4 +13,4 @@ isUnstable=false modVersion=1.104.0 # Minecraft properties: We want to configure this here so we can read it in settings.gradle -mcVersion=1.19.4 +mcVersion=1.20 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index fa3ffc7c3..aa4045efa 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -7,9 +7,9 @@ # Minecraft # MC version is specified in gradle.properties, as we need that in settings.gradle. # Remember to update corresponding versions in fabric.mod.json/mods.toml -fabric-api = "0.80.0+1.19.4" -fabric-loader = "0.14.19" -forge = "45.0.42" +fabric-api = "0.83.0+1.20" +fabric-loader = "0.14.21" +forge = "46.0.1" forgeSpi = "6.0.0" mixin = "0.8.5" parchment = "2023.03.12" @@ -150,10 +150,10 @@ kotlin = ["kotlin-stdlib", "kotlin-coroutines"] # Minecraft externalMods-common = ["jei-api", "nightConfig-core", "nightConfig-toml"] externalMods-forge-compile = ["oculus", "jei-api"] -externalMods-forge-runtime = ["jei-forge"] +externalMods-forge-runtime = [] externalMods-fabric = ["nightConfig-core", "nightConfig-toml"] externalMods-fabric-compile = ["iris", "jei-api", "rei-api", "rei-builtin"] -externalMods-fabric-runtime = ["jei-fabric", "modmenu"] +externalMods-fabric-runtime = [] # Testing test = ["junit-jupiter-api", "junit-jupiter-params", "hamcrest", "jqwik-api"] diff --git a/projects/common/src/client/java/dan200/computercraft/client/gui/AbstractComputerScreen.java b/projects/common/src/client/java/dan200/computercraft/client/gui/AbstractComputerScreen.java index ca83acb6e..b81be6676 100644 --- a/projects/common/src/client/java/dan200/computercraft/client/gui/AbstractComputerScreen.java +++ b/projects/common/src/client/java/dan200/computercraft/client/gui/AbstractComputerScreen.java @@ -4,7 +4,6 @@ package dan200.computercraft.client.gui; -import com.mojang.blaze3d.vertex.PoseStack; import dan200.computercraft.client.gui.widgets.ComputerSidebar; import dan200.computercraft.client.gui.widgets.DynamicImageButton; import dan200.computercraft.client.gui.widgets.TerminalWidget; @@ -19,6 +18,7 @@ import dan200.computercraft.shared.config.Config; import dan200.computercraft.shared.network.server.UploadFileMessage; import net.minecraft.ChatFormatting; import net.minecraft.Util; +import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen; import net.minecraft.network.chat.Component; import net.minecraft.world.entity.player.Inventory; @@ -124,10 +124,10 @@ public abstract class AbstractComputerScreen ext } @Override - public void render(PoseStack stack, int mouseX, int mouseY, float partialTicks) { - renderBackground(stack); - super.render(stack, mouseX, mouseY, partialTicks); - renderTooltip(stack, mouseX, mouseY); + public void render(GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) { + renderBackground(graphics); + super.render(graphics, mouseX, mouseY, partialTicks); + renderTooltip(graphics, mouseX, mouseY); } @Override @@ -147,7 +147,7 @@ public abstract class AbstractComputerScreen ext @Override - protected void renderLabels(PoseStack transform, int mouseX, int mouseY) { + protected void renderLabels(GuiGraphics graphics, int mouseX, int mouseY) { // Skip rendering labels. } diff --git a/projects/common/src/client/java/dan200/computercraft/client/gui/ComputerScreen.java b/projects/common/src/client/java/dan200/computercraft/client/gui/ComputerScreen.java index 142003763..fa88ac0f2 100644 --- a/projects/common/src/client/java/dan200/computercraft/client/gui/ComputerScreen.java +++ b/projects/common/src/client/java/dan200/computercraft/client/gui/ComputerScreen.java @@ -4,11 +4,11 @@ package dan200.computercraft.client.gui; -import com.mojang.blaze3d.vertex.PoseStack; import dan200.computercraft.client.gui.widgets.ComputerSidebar; import dan200.computercraft.client.gui.widgets.TerminalWidget; import dan200.computercraft.client.render.ComputerBorderRenderer; import dan200.computercraft.shared.computer.inventory.AbstractComputerMenu; +import net.minecraft.client.gui.GuiGraphics; import net.minecraft.network.chat.Component; import net.minecraft.world.entity.player.Inventory; @@ -36,13 +36,14 @@ public final class ComputerScreen extends Abstra } @Override - public void renderBg(PoseStack stack, float partialTicks, int mouseX, int mouseY) { + public void renderBg(GuiGraphics graphics, float partialTicks, int mouseX, int mouseY) { // Draw a border around the terminal var terminal = getTerminal(); + var texture = ComputerBorderRenderer.getTexture(family); ComputerBorderRenderer.render( - stack.last().pose(), ComputerBorderRenderer.getTexture(family), terminal.getX(), terminal.getY(), + graphics.pose().last().pose(), texture, terminal.getX(), terminal.getY(), FULL_BRIGHT_LIGHTMAP, terminal.getWidth(), terminal.getHeight() ); - ComputerSidebar.renderBackground(stack, leftPos, topPos + sidebarYOffset); + ComputerSidebar.renderBackground(graphics, texture, leftPos, topPos + sidebarYOffset); } } diff --git a/projects/common/src/client/java/dan200/computercraft/client/gui/DiskDriveScreen.java b/projects/common/src/client/java/dan200/computercraft/client/gui/DiskDriveScreen.java index 64252d913..5fe8fe15b 100644 --- a/projects/common/src/client/java/dan200/computercraft/client/gui/DiskDriveScreen.java +++ b/projects/common/src/client/java/dan200/computercraft/client/gui/DiskDriveScreen.java @@ -4,9 +4,8 @@ package dan200.computercraft.client.gui; -import com.mojang.blaze3d.systems.RenderSystem; -import com.mojang.blaze3d.vertex.PoseStack; import dan200.computercraft.shared.peripheral.diskdrive.DiskDriveMenu; +import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; @@ -23,16 +22,14 @@ public class DiskDriveScreen extends AbstractContainerScreen { } @Override - protected void renderBg(PoseStack transform, float partialTicks, int mouseX, int mouseY) { - RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F); - RenderSystem.setShaderTexture(0, BACKGROUND); - blit(transform, leftPos, topPos, 0, 0, imageWidth, imageHeight); + protected void renderBg(GuiGraphics graphics, float partialTicks, int mouseX, int mouseY) { + graphics.blit(BACKGROUND, leftPos, topPos, 0, 0, imageWidth, imageHeight); } @Override - public void render(PoseStack transform, int mouseX, int mouseY, float partialTicks) { - renderBackground(transform); - super.render(transform, mouseX, mouseY, partialTicks); - renderTooltip(transform, mouseX, mouseY); + public void render(GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) { + renderBackground(graphics); + super.render(graphics, mouseX, mouseY, partialTicks); + renderTooltip(graphics, mouseX, mouseY); } } diff --git a/projects/common/src/client/java/dan200/computercraft/client/gui/ItemToast.java b/projects/common/src/client/java/dan200/computercraft/client/gui/ItemToast.java index 60e03d791..cdce269b0 100644 --- a/projects/common/src/client/java/dan200/computercraft/client/gui/ItemToast.java +++ b/projects/common/src/client/java/dan200/computercraft/client/gui/ItemToast.java @@ -4,10 +4,8 @@ package dan200.computercraft.client.gui; -import com.mojang.blaze3d.systems.RenderSystem; -import com.mojang.blaze3d.vertex.PoseStack; import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiComponent; +import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.components.toasts.Toast; import net.minecraft.client.gui.components.toasts.ToastComponent; import net.minecraft.network.chat.Component; @@ -73,55 +71,52 @@ public class ItemToast implements Toast { } @Override - public Visibility render(PoseStack transform, ToastComponent component, long time) { + public Visibility render(GuiGraphics graphics, ToastComponent component, long time) { if (isNew) { firstDisplay = time; isNew = false; } - RenderSystem.setShaderTexture(0, TEXTURE); - RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F); - if (width == 160 && message.size() <= 1) { - GuiComponent.blit(transform, 0, 0, 0, 64, width, height()); + graphics.blit(TEXTURE, 0, 0, 0, 64, width, height()); } else { var height = height(); var bottom = Math.min(4, height - 28); - renderBackgroundRow(transform, component, width, 0, 0, 28); + renderBackgroundRow(graphics, width, 0, 0, 28); for (var i = 28; i < height - bottom; i += 10) { - renderBackgroundRow(transform, component, width, 16, i, Math.min(16, height - i - bottom)); + renderBackgroundRow(graphics, width, 16, i, Math.min(16, height - i - bottom)); } - renderBackgroundRow(transform, component, width, 32 - bottom, height - bottom, bottom); + renderBackgroundRow(graphics, width, 32 - bottom, height - bottom, bottom); } var textX = MARGIN; if (!stack.isEmpty()) { textX += MARGIN + IMAGE_SIZE; - component.getMinecraft().getItemRenderer().renderAndDecorateFakeItem(transform, stack, MARGIN, MARGIN + height() / 2 - IMAGE_SIZE); + graphics.renderFakeItem(stack, MARGIN, MARGIN + height() / 2 - IMAGE_SIZE); } - component.getMinecraft().font.draw(transform, title, textX, MARGIN, 0xff500050); + graphics.drawString(component.getMinecraft().font, title, textX, MARGIN, 0xff500050); for (var i = 0; i < message.size(); ++i) { - component.getMinecraft().font.draw(transform, message.get(i), textX, (float) (LINE_SPACING + (i + 1) * LINE_SPACING), 0xff000000); + graphics.drawString(component.getMinecraft().font, message.get(i), textX, LINE_SPACING + (i + 1) * LINE_SPACING, 0xff000000); } return time - firstDisplay < DISPLAY_TIME ? Visibility.SHOW : Visibility.HIDE; } - private static void renderBackgroundRow(PoseStack transform, ToastComponent component, int x, int u, int y, int height) { + private static void renderBackgroundRow(GuiGraphics graphics, int x, int u, int y, int height) { var leftOffset = 5; var rightOffset = Math.min(60, x - leftOffset); - GuiComponent.blit(transform, 0, y, 0, 32 + u, leftOffset, height); + graphics.blit(TEXTURE, 0, y, 0, 32 + u, leftOffset, height); for (var k = leftOffset; k < x - rightOffset; k += 64) { - GuiComponent.blit(transform, k, y, 32, 32 + u, Math.min(64, x - k - rightOffset), height); + graphics.blit(TEXTURE, k, y, 32, 32 + u, Math.min(64, x - k - rightOffset), height); } - GuiComponent.blit(transform, x - rightOffset, y, 160 - rightOffset, 32 + u, rightOffset, height); + graphics.blit(TEXTURE, x - rightOffset, y, 160 - rightOffset, 32 + u, rightOffset, height); } } diff --git a/projects/common/src/client/java/dan200/computercraft/client/gui/NoTermComputerScreen.java b/projects/common/src/client/java/dan200/computercraft/client/gui/NoTermComputerScreen.java index 6499f2e1c..42370d936 100644 --- a/projects/common/src/client/java/dan200/computercraft/client/gui/NoTermComputerScreen.java +++ b/projects/common/src/client/java/dan200/computercraft/client/gui/NoTermComputerScreen.java @@ -4,11 +4,11 @@ package dan200.computercraft.client.gui; -import com.mojang.blaze3d.vertex.PoseStack; import dan200.computercraft.client.gui.widgets.TerminalWidget; import dan200.computercraft.core.terminal.Terminal; import dan200.computercraft.shared.computer.inventory.AbstractComputerMenu; import net.minecraft.client.KeyMapping; +import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.screens.Screen; import net.minecraft.client.gui.screens.inventory.MenuAccess; import net.minecraft.network.chat.Component; @@ -42,7 +42,7 @@ public class NoTermComputerScreen extends Screen @Override protected void init() { - passEvents = true; // Pass mouse vents through to the game's mouse handler. + // FIXME: passEvents = true; // Pass mouse vents through to the game's mouse handler. // First ensure we're still grabbing the mouse, so the user can look around. Then reset bits of state that // grabbing unsets. minecraft.mouseHandler.grabMouse(); @@ -91,15 +91,15 @@ public class NoTermComputerScreen extends Screen } @Override - public void render(PoseStack transform, int mouseX, int mouseY, float partialTicks) { - super.render(transform, mouseX, mouseY, partialTicks); + public void render(GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) { + super.render(graphics, mouseX, mouseY, partialTicks); var font = minecraft.font; var lines = font.split(Component.translatable("gui.computercraft.pocket_computer_overlay"), (int) (width * 0.8)); - var y = 10.0f; + var y = 10; for (var line : lines) { - font.drawShadow(transform, line, (float) ((width / 2) - (minecraft.font.width(line) / 2)), y, 0xFFFFFF); - y += 9.0f; + graphics.drawString(font, line, (width / 2) - (minecraft.font.width(line) / 2), y, 0xFFFFFF, true); + y += 9; } } } diff --git a/projects/common/src/client/java/dan200/computercraft/client/gui/OptionScreen.java b/projects/common/src/client/java/dan200/computercraft/client/gui/OptionScreen.java index defd33357..1dae0bcea 100644 --- a/projects/common/src/client/java/dan200/computercraft/client/gui/OptionScreen.java +++ b/projects/common/src/client/java/dan200/computercraft/client/gui/OptionScreen.java @@ -4,9 +4,8 @@ package dan200.computercraft.client.gui; -import com.mojang.blaze3d.systems.RenderSystem; -import com.mojang.blaze3d.vertex.PoseStack; import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.components.AbstractWidget; import net.minecraft.client.gui.components.Button; import net.minecraft.client.gui.components.MultiLineLabel; @@ -86,20 +85,19 @@ public final class OptionScreen extends Screen { } @Override - public void render(PoseStack transform, int mouseX, int mouseY, float partialTicks) { - renderBackground(transform); + public void render(GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) { + renderBackground(graphics); // Render the actual texture. - RenderSystem.setShaderTexture(0, BACKGROUND); - blit(transform, x, y, 0, 0, innerWidth, PADDING); - blit(transform, + graphics.blit(BACKGROUND, x, y, 0, 0, innerWidth, PADDING); + graphics.blit(BACKGROUND, x, y + PADDING, 0, PADDING, innerWidth, innerHeight - PADDING * 2, innerWidth, PADDING ); - blit(transform, x, y + innerHeight - PADDING, 0, 256 - PADDING, innerWidth, PADDING); + graphics.blit(BACKGROUND, x, y + innerHeight - PADDING, 0, 256 - PADDING, innerWidth, PADDING); - assertNonNull(messageRenderer).renderLeftAlignedNoShadow(transform, x + PADDING, y + PADDING, FONT_HEIGHT, 0x404040); - super.render(transform, mouseX, mouseY, partialTicks); + assertNonNull(messageRenderer).renderLeftAlignedNoShadow(graphics, x + PADDING, y + PADDING, FONT_HEIGHT, 0x404040); + super.render(graphics, mouseX, mouseY, partialTicks); } @Override diff --git a/projects/common/src/client/java/dan200/computercraft/client/gui/PrinterScreen.java b/projects/common/src/client/java/dan200/computercraft/client/gui/PrinterScreen.java index 6e5b6eead..ff2b9899d 100644 --- a/projects/common/src/client/java/dan200/computercraft/client/gui/PrinterScreen.java +++ b/projects/common/src/client/java/dan200/computercraft/client/gui/PrinterScreen.java @@ -4,9 +4,8 @@ package dan200.computercraft.client.gui; -import com.mojang.blaze3d.systems.RenderSystem; -import com.mojang.blaze3d.vertex.PoseStack; import dan200.computercraft.shared.peripheral.printer.PrinterMenu; +import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; @@ -23,18 +22,16 @@ public class PrinterScreen extends AbstractContainerScreen { } @Override - protected void renderBg(PoseStack transform, float partialTicks, int mouseX, int mouseY) { - RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F); - RenderSystem.setShaderTexture(0, BACKGROUND); - blit(transform, leftPos, topPos, 0, 0, imageWidth, imageHeight); + protected void renderBg(GuiGraphics graphics, float partialTicks, int mouseX, int mouseY) { + graphics.blit(BACKGROUND, leftPos, topPos, 0, 0, imageWidth, imageHeight); - if (getMenu().isPrinting()) blit(transform, leftPos + 34, topPos + 21, 176, 0, 25, 45); + if (getMenu().isPrinting()) graphics.blit(BACKGROUND, leftPos + 34, topPos + 21, 176, 0, 25, 45); } @Override - public void render(PoseStack stack, int mouseX, int mouseY, float partialTicks) { - renderBackground(stack); - super.render(stack, mouseX, mouseY, partialTicks); - renderTooltip(stack, mouseX, mouseY); + public void render(GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) { + renderBackground(graphics); + super.render(graphics, mouseX, mouseY, partialTicks); + renderTooltip(graphics, mouseX, mouseY); } } diff --git a/projects/common/src/client/java/dan200/computercraft/client/gui/PrintoutScreen.java b/projects/common/src/client/java/dan200/computercraft/client/gui/PrintoutScreen.java index e05859d5c..8ed3b8f64 100644 --- a/projects/common/src/client/java/dan200/computercraft/client/gui/PrintoutScreen.java +++ b/projects/common/src/client/java/dan200/computercraft/client/gui/PrintoutScreen.java @@ -4,12 +4,11 @@ package dan200.computercraft.client.gui; -import com.mojang.blaze3d.systems.RenderSystem; -import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.Tesselator; import dan200.computercraft.core.terminal.TextBuffer; import dan200.computercraft.shared.common.HeldItemMenu; import dan200.computercraft.shared.media.items.PrintoutItem; +import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen; import net.minecraft.client.renderer.MultiBufferSource; import net.minecraft.network.chat.Component; @@ -83,30 +82,27 @@ public class PrintoutScreen extends AbstractContainerScreen { } @Override - protected void renderBg(PoseStack transform, float partialTicks, int mouseX, int mouseY) { + protected void renderBg(GuiGraphics graphics, float partialTicks, int mouseX, int mouseY) { // Draw the printout - RenderSystem.setShaderColor(1.0f, 1.0f, 1.0f, 1.0f); - RenderSystem.enableDepthTest(); - var renderer = MultiBufferSource.immediate(Tesselator.getInstance().getBuilder()); - drawBorder(transform, renderer, leftPos, topPos, 0, page, pages, book, FULL_BRIGHT_LIGHTMAP); - drawText(transform, renderer, leftPos + X_TEXT_MARGIN, topPos + Y_TEXT_MARGIN, PrintoutItem.LINES_PER_PAGE * page, FULL_BRIGHT_LIGHTMAP, text, colours); + drawBorder(graphics.pose(), renderer, leftPos, topPos, 0, page, pages, book, FULL_BRIGHT_LIGHTMAP); + drawText(graphics.pose(), renderer, leftPos + X_TEXT_MARGIN, topPos + Y_TEXT_MARGIN, PrintoutItem.LINES_PER_PAGE * page, FULL_BRIGHT_LIGHTMAP, text, colours); renderer.endBatch(); } @Override - public void render(PoseStack stack, int mouseX, int mouseY, float partialTicks) { + public void render(GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) { // We must take the background further back in order to not overlap with our printed pages. - stack.pushPose(); - stack.translate(0, 0, -1); - renderBackground(stack); - stack.popPose(); + graphics.pose().pushPose(); + graphics.pose().translate(0, 0, -1); + renderBackground(graphics); + graphics.pose().popPose(); - super.render(stack, mouseX, mouseY, partialTicks); + super.render(graphics, mouseX, mouseY, partialTicks); } @Override - protected void renderLabels(PoseStack transform, int mouseX, int mouseY) { + protected void renderLabels(GuiGraphics graphics, int mouseX, int mouseY) { // Skip rendering labels. } } 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..aec36947e 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 @@ -4,8 +4,6 @@ package dan200.computercraft.client.gui; -import com.mojang.blaze3d.systems.RenderSystem; -import com.mojang.blaze3d.vertex.PoseStack; import dan200.computercraft.api.ComputerCraftAPI; import dan200.computercraft.client.gui.widgets.ComputerSidebar; import dan200.computercraft.client.gui.widgets.TerminalWidget; @@ -13,6 +11,7 @@ import dan200.computercraft.client.render.ComputerBorderRenderer; import dan200.computercraft.shared.computer.core.ComputerFamily; import dan200.computercraft.shared.computer.inventory.AbstractComputerMenu; import dan200.computercraft.shared.turtle.inventory.TurtleMenu; +import net.minecraft.client.gui.GuiGraphics; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; @@ -42,23 +41,21 @@ public class TurtleScreen extends AbstractComputerScreen { } @Override - protected void renderBg(PoseStack transform, float partialTicks, int mouseX, int mouseY) { + protected void renderBg(GuiGraphics graphics, 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); + var texture = advanced ? BACKGROUND_ADVANCED : BACKGROUND_NORMAL; + graphics.blit(texture, leftPos + AbstractComputerMenu.SIDEBAR_WIDTH, topPos, 0, 0, TEX_WIDTH, TEX_HEIGHT); 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, + graphics.blit(texture, leftPos + TURTLE_START_X - 2 + slotX * 18, topPos + PLAYER_START_Y - 2 + slotY * 18, 0, 217, 24, 24 ); } - RenderSystem.setShaderTexture(0, advanced ? ComputerBorderRenderer.BACKGROUND_ADVANCED : ComputerBorderRenderer.BACKGROUND_NORMAL); - ComputerSidebar.renderBackground(transform, leftPos, topPos + sidebarYOffset); + ComputerSidebar.renderBackground(graphics, ComputerBorderRenderer.getTexture(family), leftPos, topPos + sidebarYOffset); } } diff --git a/projects/common/src/client/java/dan200/computercraft/client/gui/widgets/ComputerSidebar.java b/projects/common/src/client/java/dan200/computercraft/client/gui/widgets/ComputerSidebar.java index 24ed53d95..f5ce706f1 100644 --- a/projects/common/src/client/java/dan200/computercraft/client/gui/widgets/ComputerSidebar.java +++ b/projects/common/src/client/java/dan200/computercraft/client/gui/widgets/ComputerSidebar.java @@ -4,14 +4,13 @@ package dan200.computercraft.client.gui.widgets; -import com.mojang.blaze3d.vertex.PoseStack; import dan200.computercraft.api.ComputerCraftAPI; import dan200.computercraft.client.gui.widgets.DynamicImageButton.HintedMessage; import dan200.computercraft.client.render.ComputerBorderRenderer; import dan200.computercraft.shared.computer.core.InputHandler; import dan200.computercraft.shared.computer.inventory.AbstractComputerMenu; +import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.components.AbstractWidget; -import net.minecraft.client.gui.screens.Screen; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; @@ -68,19 +67,19 @@ public final class ComputerSidebar { )); } - public static void renderBackground(PoseStack transform, int x, int y) { - Screen.blit(transform, + public static void renderBackground(GuiGraphics graphics, ResourceLocation texture, int x, int y) { + graphics.blit(texture, x, y, 0, 102, AbstractComputerMenu.SIDEBAR_WIDTH, FULL_BORDER, ComputerBorderRenderer.TEX_SIZE, ComputerBorderRenderer.TEX_SIZE ); - Screen.blit(transform, + graphics.blit(texture, x, y + FULL_BORDER, AbstractComputerMenu.SIDEBAR_WIDTH, HEIGHT - FULL_BORDER * 2, 0, 107, AbstractComputerMenu.SIDEBAR_WIDTH, 4, ComputerBorderRenderer.TEX_SIZE, ComputerBorderRenderer.TEX_SIZE ); - Screen.blit(transform, + graphics.blit(texture, x, y + HEIGHT - FULL_BORDER, 0, 111, AbstractComputerMenu.SIDEBAR_WIDTH, FULL_BORDER, ComputerBorderRenderer.TEX_SIZE, ComputerBorderRenderer.TEX_SIZE ); diff --git a/projects/common/src/client/java/dan200/computercraft/client/gui/widgets/DynamicImageButton.java b/projects/common/src/client/java/dan200/computercraft/client/gui/widgets/DynamicImageButton.java index 6c7324688..4d1be6589 100644 --- a/projects/common/src/client/java/dan200/computercraft/client/gui/widgets/DynamicImageButton.java +++ b/projects/common/src/client/java/dan200/computercraft/client/gui/widgets/DynamicImageButton.java @@ -5,8 +5,8 @@ package dan200.computercraft.client.gui.widgets; import com.mojang.blaze3d.systems.RenderSystem; -import com.mojang.blaze3d.vertex.PoseStack; import net.minecraft.ChatFormatting; +import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.components.Button; import net.minecraft.client.gui.components.Tooltip; import net.minecraft.network.chat.Component; @@ -57,15 +57,14 @@ public class DynamicImageButton extends Button { } @Override - public void renderWidget(PoseStack stack, int mouseX, int mouseY, float partialTicks) { - RenderSystem.setShaderTexture(0, texture); - RenderSystem.disableDepthTest(); + public void renderWidget(GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) { + RenderSystem.enableBlend(); + RenderSystem.enableDepthTest(); var yTex = yTexStart; if (isHoveredOrFocused()) yTex += yDiffTex; - blit(stack, getX(), getY(), xTexStart.getAsInt(), yTex, width, height, textureWidth, textureHeight); - RenderSystem.enableDepthTest(); + graphics.blit(texture, getX(), getY(), xTexStart.getAsInt(), yTex, width, height, textureWidth, textureHeight); } @Override @@ -74,9 +73,9 @@ public class DynamicImageButton extends Button { } @Override - public void render(PoseStack stack, int mouseX, int mouseY, float partialTicks) { + public void render(GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) { setTooltip(message.get().tooltip()); - super.render(stack, mouseX, mouseY, partialTicks); + super.render(graphics, mouseX, mouseY, partialTicks); } public record HintedMessage(Component message, Tooltip tooltip) { diff --git a/projects/common/src/client/java/dan200/computercraft/client/gui/widgets/TerminalWidget.java b/projects/common/src/client/java/dan200/computercraft/client/gui/widgets/TerminalWidget.java index 7f53bb569..a2e306e0c 100644 --- a/projects/common/src/client/java/dan200/computercraft/client/gui/widgets/TerminalWidget.java +++ b/projects/common/src/client/java/dan200/computercraft/client/gui/widgets/TerminalWidget.java @@ -4,7 +4,6 @@ package dan200.computercraft.client.gui.widgets; -import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.Tesselator; import dan200.computercraft.client.render.RenderTypes; import dan200.computercraft.client.render.text.FixedWidthFontRenderer; @@ -12,6 +11,7 @@ import dan200.computercraft.core.terminal.Terminal; import dan200.computercraft.shared.computer.core.InputHandler; import net.minecraft.SharedConstants; import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.components.AbstractWidget; import net.minecraft.client.gui.narration.NarratedElementType; import net.minecraft.client.gui.narration.NarrationElementOutput; @@ -271,11 +271,11 @@ public class TerminalWidget extends AbstractWidget { } @Override - public void renderWidget(PoseStack transform, int mouseX, int mouseY, float partialTicks) { + public void renderWidget(GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) { if (!visible) return; var bufferSource = MultiBufferSource.immediate(Tesselator.getInstance().getBuilder()); - var emitter = FixedWidthFontRenderer.toVertexConsumer(transform, bufferSource.getBuffer(RenderTypes.TERMINAL)); + var emitter = FixedWidthFontRenderer.toVertexConsumer(graphics.pose(), bufferSource.getBuffer(RenderTypes.TERMINAL)); FixedWidthFontRenderer.drawTerminal( emitter, diff --git a/projects/common/src/client/java/dan200/computercraft/client/platform/AbstractClientNetworkContext.java b/projects/common/src/client/java/dan200/computercraft/client/platform/AbstractClientNetworkContext.java index fa5829988..7c454b47f 100644 --- a/projects/common/src/client/java/dan200/computercraft/client/platform/AbstractClientNetworkContext.java +++ b/projects/common/src/client/java/dan200/computercraft/client/platform/AbstractClientNetworkContext.java @@ -52,7 +52,7 @@ public abstract class AbstractClientNetworkContext implements ClientNetworkConte var player = Minecraft.getInstance().player; if (player == null) return; - var te = player.level.getBlockEntity(pos); + var te = player.level().getBlockEntity(pos); if (!(te instanceof MonitorBlockEntity monitor)) return; monitor.read(terminal); diff --git a/projects/common/src/client/java/dan200/computercraft/client/render/ComputerBorderRenderer.java b/projects/common/src/client/java/dan200/computercraft/client/render/ComputerBorderRenderer.java index cdea6213f..3a0633da9 100644 --- a/projects/common/src/client/java/dan200/computercraft/client/render/ComputerBorderRenderer.java +++ b/projects/common/src/client/java/dan200/computercraft/client/render/ComputerBorderRenderer.java @@ -18,9 +18,9 @@ import org.joml.Matrix4f; * {@linkplain PocketItemRenderer in-hand pocket computers}. */ public class ComputerBorderRenderer { - public static final ResourceLocation BACKGROUND_NORMAL = new ResourceLocation(ComputerCraftAPI.MOD_ID, "textures/gui/corners_normal.png"); - public static final ResourceLocation BACKGROUND_ADVANCED = new ResourceLocation(ComputerCraftAPI.MOD_ID, "textures/gui/corners_advanced.png"); - public static final ResourceLocation BACKGROUND_COMMAND = new ResourceLocation(ComputerCraftAPI.MOD_ID, "textures/gui/corners_command.png"); + private static final ResourceLocation BACKGROUND_NORMAL = new ResourceLocation(ComputerCraftAPI.MOD_ID, "textures/gui/corners_normal.png"); + private static final ResourceLocation BACKGROUND_ADVANCED = new ResourceLocation(ComputerCraftAPI.MOD_ID, "textures/gui/corners_advanced.png"); + private static final ResourceLocation BACKGROUND_COMMAND = new ResourceLocation(ComputerCraftAPI.MOD_ID, "textures/gui/corners_command.png"); public static final ResourceLocation BACKGROUND_COLOUR = new ResourceLocation(ComputerCraftAPI.MOD_ID, "textures/gui/corners_colour.png"); /** diff --git a/projects/common/src/client/java/dan200/computercraft/client/render/monitor/MonitorBlockEntityRenderer.java b/projects/common/src/client/java/dan200/computercraft/client/render/monitor/MonitorBlockEntityRenderer.java index d1fae45d7..7b1df0034 100644 --- a/projects/common/src/client/java/dan200/computercraft/client/render/monitor/MonitorBlockEntityRenderer.java +++ b/projects/common/src/client/java/dan200/computercraft/client/render/monitor/MonitorBlockEntityRenderer.java @@ -7,10 +7,7 @@ package dan200.computercraft.client.render.monitor; import com.mojang.blaze3d.platform.GlStateManager; import com.mojang.blaze3d.platform.MemoryTracker; import com.mojang.blaze3d.systems.RenderSystem; -import com.mojang.blaze3d.vertex.PoseStack; -import com.mojang.blaze3d.vertex.Tesselator; -import com.mojang.blaze3d.vertex.VertexBuffer; -import com.mojang.blaze3d.vertex.VertexConsumer; +import com.mojang.blaze3d.vertex.*; import com.mojang.math.Axis; import dan200.computercraft.client.FrameInfo; import dan200.computercraft.client.integration.ShaderMod; @@ -170,7 +167,7 @@ public class MonitorBlockEntityRenderer implements BlockEntityRenderer { var backgroundBuffer = assertNonNull(renderState.backgroundBuffer); diff --git a/projects/common/src/client/java/dan200/computercraft/client/render/vbo/DirectVertexBuffer.java b/projects/common/src/client/java/dan200/computercraft/client/render/vbo/DirectVertexBuffer.java index db511b29d..958ddfa0c 100644 --- a/projects/common/src/client/java/dan200/computercraft/client/render/vbo/DirectVertexBuffer.java +++ b/projects/common/src/client/java/dan200/computercraft/client/render/vbo/DirectVertexBuffer.java @@ -25,6 +25,7 @@ public class DirectVertexBuffer extends VertexBuffer { private int actualIndexCount; public DirectVertexBuffer() { + super(Usage.STATIC); if (DirectBuffers.HAS_DSA) { RenderSystem.glDeleteBuffers(vertexBufferId); if (DirectBuffers.ON_LINUX) BufferUploader.reset(); // See comment on DirectBuffers.deleteBuffer. diff --git a/projects/common/src/main/java/dan200/computercraft/data/LootTableProvider.java b/projects/common/src/main/java/dan200/computercraft/data/LootTableProvider.java index 720af5676..33c9d239b 100644 --- a/projects/common/src/main/java/dan200/computercraft/data/LootTableProvider.java +++ b/projects/common/src/main/java/dan200/computercraft/data/LootTableProvider.java @@ -23,7 +23,7 @@ import net.minecraft.world.level.storage.loot.entries.LootItem; import net.minecraft.world.level.storage.loot.entries.LootPoolEntryContainer; import net.minecraft.world.level.storage.loot.functions.CopyNameFunction; import net.minecraft.world.level.storage.loot.parameters.LootContextParamSets; -import net.minecraft.world.level.storage.loot.predicates.AlternativeLootItemCondition; +import net.minecraft.world.level.storage.loot.predicates.AnyOfCondition; import net.minecraft.world.level.storage.loot.predicates.ExplosionCondition; import net.minecraft.world.level.storage.loot.predicates.LootItemBlockStatePropertyCondition; import net.minecraft.world.level.storage.loot.predicates.LootItemCondition; @@ -79,7 +79,7 @@ class LootTableProvider { } private static void registerGeneric(BiConsumer add) { - add.accept(CommonHooks.LOOT_TREASURE_DISK, LootTable.lootTable()); + add.accept(CommonHooks.TREASURE_DISK_LOOT, LootTable.lootTable()); } private static void selfDrop(BiConsumer add, Supplier wrapper) { @@ -98,7 +98,7 @@ class LootTableProvider { blockDrop( add, block, DynamicLoot.dynamicEntry(new ResourceLocation(ComputerCraftAPI.MOD_ID, "computer")), - AlternativeLootItemCondition.alternative( + AnyOfCondition.anyOf( BlockNamedEntityLootCondition.BUILDER, HasComputerIdLootCondition.BUILDER, PlayerCreativeLootCondition.BUILDER.invert() diff --git a/projects/common/src/main/java/dan200/computercraft/shared/CommonHooks.java b/projects/common/src/main/java/dan200/computercraft/shared/CommonHooks.java index 6e68bcf22..8db24018e 100644 --- a/projects/common/src/main/java/dan200/computercraft/shared/CommonHooks.java +++ b/projects/common/src/main/java/dan200/computercraft/shared/CommonHooks.java @@ -23,13 +23,7 @@ import net.minecraft.world.entity.Entity; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.chunk.LevelChunk; import net.minecraft.world.level.storage.loot.BuiltInLootTables; -import net.minecraft.world.level.storage.loot.LootPool; -import net.minecraft.world.level.storage.loot.entries.LootTableReference; -import net.minecraft.world.level.storage.loot.providers.number.ConstantValue; -import javax.annotation.Nullable; -import java.util.Arrays; -import java.util.HashSet; import java.util.Set; import java.util.function.BiConsumer; @@ -75,9 +69,9 @@ public final class CommonHooks { MonitorWatcher.onWatch(chunk, player); } - public static final ResourceLocation LOOT_TREASURE_DISK = new ResourceLocation(ComputerCraftAPI.MOD_ID, "treasure_disk"); + public static final ResourceLocation TREASURE_DISK_LOOT = new ResourceLocation(ComputerCraftAPI.MOD_ID, "treasure_disk"); - private static final Set TABLES = new HashSet<>(Arrays.asList( + public static final Set TREASURE_DISK_LOOT_TABLES = Set.of( BuiltInLootTables.SIMPLE_DUNGEON, BuiltInLootTables.ABANDONED_MINESHAFT, BuiltInLootTables.STRONGHOLD_CORRIDOR, @@ -88,16 +82,7 @@ public final class CommonHooks { BuiltInLootTables.IGLOO_CHEST, BuiltInLootTables.WOODLAND_MANSION, BuiltInLootTables.VILLAGE_CARTOGRAPHER - )); - - - public static @Nullable LootPool.Builder getExtraLootPool(ResourceLocation lootTable) { - if (!lootTable.getNamespace().equals("minecraft") || !TABLES.contains(lootTable)) return null; - - return LootPool.lootPool() - .add(LootTableReference.lootTableReference(LOOT_TREASURE_DISK)) - .setRolls(ConstantValue.exactly(1)); - } + ); public static void onDatapackReload(BiConsumer addReload) { addReload.accept("mounts", ResourceMount.RELOAD_LISTENER); diff --git a/projects/common/src/main/java/dan200/computercraft/shared/ModRegistry.java b/projects/common/src/main/java/dan200/computercraft/shared/ModRegistry.java index 13ea6d0a6..f174d6240 100644 --- a/projects/common/src/main/java/dan200/computercraft/shared/ModRegistry.java +++ b/projects/common/src/main/java/dan200/computercraft/shared/ModRegistry.java @@ -93,7 +93,7 @@ import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockBehaviour; import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.material.Material; +import net.minecraft.world.level.material.MapColor; import net.minecraft.world.level.storage.loot.predicates.LootItemConditionType; import java.util.function.BiFunction; @@ -112,7 +112,7 @@ public final class ModRegistry { static final RegistrationHelper REGISTRY = PlatformHelper.get().createRegistrationHelper(Registries.BLOCK); private static BlockBehaviour.Properties properties() { - return BlockBehaviour.Properties.of(Material.STONE).strength(2); + return BlockBehaviour.Properties.of().strength(2); } private static BlockBehaviour.Properties computerProperties() { @@ -122,17 +122,17 @@ public final class ModRegistry { } private static BlockBehaviour.Properties turtleProperties() { - return BlockBehaviour.Properties.of(Material.STONE).strength(2.5f); + return BlockBehaviour.Properties.of().strength(2.5f); } private static BlockBehaviour.Properties modemProperties() { - return BlockBehaviour.Properties.of(Material.STONE).strength(1.5f); + return BlockBehaviour.Properties.of().strength(1.5f); } public static final RegistryEntry> COMPUTER_NORMAL = REGISTRY.register("computer_normal", - () -> new ComputerBlock<>(computerProperties(), ComputerFamily.NORMAL, BlockEntities.COMPUTER_NORMAL)); + () -> new ComputerBlock<>(computerProperties().mapColor(MapColor.STONE), ComputerFamily.NORMAL, BlockEntities.COMPUTER_NORMAL)); public static final RegistryEntry> COMPUTER_ADVANCED = REGISTRY.register("computer_advanced", - () -> new ComputerBlock<>(computerProperties(), ComputerFamily.ADVANCED, BlockEntities.COMPUTER_ADVANCED)); + () -> new ComputerBlock<>(computerProperties().mapColor(MapColor.GOLD), ComputerFamily.ADVANCED, BlockEntities.COMPUTER_ADVANCED)); public static final RegistryEntry> COMPUTER_COMMAND = REGISTRY.register("computer_command", () -> new ComputerBlock<>( computerProperties().strength(-1, 6000000.0F), @@ -140,27 +140,27 @@ public final class ModRegistry { )); public static final RegistryEntry TURTLE_NORMAL = REGISTRY.register("turtle_normal", - () -> new TurtleBlock(turtleProperties(), ComputerFamily.NORMAL, BlockEntities.TURTLE_NORMAL)); + () -> new TurtleBlock(turtleProperties().mapColor(MapColor.STONE), ComputerFamily.NORMAL, BlockEntities.TURTLE_NORMAL)); public static final RegistryEntry TURTLE_ADVANCED = REGISTRY.register("turtle_advanced", - () -> new TurtleBlock(turtleProperties(), ComputerFamily.ADVANCED, BlockEntities.TURTLE_ADVANCED)); + () -> new TurtleBlock(turtleProperties().mapColor(MapColor.GOLD), ComputerFamily.ADVANCED, BlockEntities.TURTLE_ADVANCED)); - public static final RegistryEntry SPEAKER = REGISTRY.register("speaker", () -> new SpeakerBlock(properties())); - public static final RegistryEntry DISK_DRIVE = REGISTRY.register("disk_drive", () -> new DiskDriveBlock(properties())); - public static final RegistryEntry PRINTER = REGISTRY.register("printer", () -> new PrinterBlock(properties())); + public static final RegistryEntry SPEAKER = REGISTRY.register("speaker", () -> new SpeakerBlock(properties().mapColor(MapColor.STONE))); + public static final RegistryEntry DISK_DRIVE = REGISTRY.register("disk_drive", () -> new DiskDriveBlock(properties().mapColor(MapColor.STONE))); + public static final RegistryEntry PRINTER = REGISTRY.register("printer", () -> new PrinterBlock(properties().mapColor(MapColor.STONE))); public static final RegistryEntry MONITOR_NORMAL = REGISTRY.register("monitor_normal", - () -> new MonitorBlock(properties(), BlockEntities.MONITOR_NORMAL)); + () -> new MonitorBlock(properties().mapColor(MapColor.STONE), BlockEntities.MONITOR_NORMAL)); public static final RegistryEntry MONITOR_ADVANCED = REGISTRY.register("monitor_advanced", - () -> new MonitorBlock(properties(), BlockEntities.MONITOR_ADVANCED)); + () -> new MonitorBlock(properties().mapColor(MapColor.GOLD), BlockEntities.MONITOR_ADVANCED)); public static final RegistryEntry WIRELESS_MODEM_NORMAL = REGISTRY.register("wireless_modem_normal", - () -> new WirelessModemBlock(properties(), BlockEntities.WIRELESS_MODEM_NORMAL)); + () -> new WirelessModemBlock(properties().mapColor(MapColor.STONE), BlockEntities.WIRELESS_MODEM_NORMAL)); public static final RegistryEntry WIRELESS_MODEM_ADVANCED = REGISTRY.register("wireless_modem_advanced", - () -> new WirelessModemBlock(properties(), BlockEntities.WIRELESS_MODEM_ADVANCED)); + () -> new WirelessModemBlock(properties().mapColor(MapColor.GOLD), BlockEntities.WIRELESS_MODEM_ADVANCED)); public static final RegistryEntry WIRED_MODEM_FULL = REGISTRY.register("wired_modem_full", - () -> new WiredModemFullBlock(modemProperties())); - public static final RegistryEntry CABLE = REGISTRY.register("cable", () -> new CableBlock(modemProperties())); + () -> new WiredModemFullBlock(modemProperties().mapColor(MapColor.STONE))); + public static final RegistryEntry CABLE = REGISTRY.register("cable", () -> new CableBlock(modemProperties().mapColor(MapColor.STONE))); } public static class BlockEntities { @@ -365,50 +365,11 @@ public final class ModRegistry { public static final RegistryEntry IMPOSTOR_SHAPELESS = REGISTRY.register("impostor_shapeless", ImpostorShapelessRecipe.Serializer::new); } - /** - * Register any objects which don't have to be done on the main thread. - */ - public static void register() { - Blocks.REGISTRY.register(); - BlockEntities.REGISTRY.register(); - Items.REGISTRY.register(); - TurtleSerialisers.REGISTRY.register(); - PocketUpgradeSerialisers.REGISTRY.register(); - Menus.REGISTRY.register(); - ArgumentTypes.REGISTRY.register(); - LootItemConditionTypes.REGISTRY.register(); - RecipeSerializers.REGISTRY.register(); + static class CreativeTabs { + static final RegistrationHelper REGISTRY = PlatformHelper.get().createRegistrationHelper(Registries.CREATIVE_MODE_TAB); - // Register bundled power providers - ComputerCraftAPI.registerBundledRedstoneProvider(new DefaultBundledRedstoneProvider()); - ComputerCraftAPI.registerRefuelHandler(new FurnaceRefuelHandler()); - ComputerCraftAPI.registerMediaProvider(stack -> { - var item = stack.getItem(); - if (item instanceof IMedia media) return media; - if (item instanceof RecordItem) return RecordMedia.INSTANCE; - return null; - }); - - VanillaDetailRegistries.ITEM_STACK.addProvider(ItemDetails::fill); - VanillaDetailRegistries.BLOCK_IN_WORLD.addProvider(BlockDetails::fill); - } - - /** - * Register any objects which must be done on the main thread. - */ - public static void registerMainThread() { - CauldronInteraction.WATER.put(ModRegistry.Items.TURTLE_NORMAL.get(), TurtleItem.CAULDRON_INTERACTION); - CauldronInteraction.WATER.put(ModRegistry.Items.TURTLE_ADVANCED.get(), TurtleItem.CAULDRON_INTERACTION); - } - - /** - * Configure a {@link CreativeModeTab.Builder} to contain all of ComputerCraft's items. - * - * @param builder The builder to configure. - * @return The same building, for calling {@link CreativeModeTab.Builder#build()} on. - */ - public static CreativeModeTab.Builder registerCreativeTab(CreativeModeTab.Builder builder) { - return builder + @SuppressWarnings("unused") + private static final RegistryEntry TAB = REGISTRY.register("tab", () -> PlatformHelper.get().newCreativeModeTab() .icon(() -> new ItemStack(Items.COMPUTER_NORMAL.get())) .title(Component.translatable("itemGroup.computercraft")) .displayItems((context, out) -> { @@ -440,7 +401,45 @@ public final class ModRegistry { for (var colour = 0; colour < 16; colour++) { out.accept(DiskItem.createFromIDAndColour(-1, null, Colour.VALUES[colour].getHex())); } - }); + }) + .build()); + } + + /** + * Register any objects which don't have to be done on the main thread. + */ + public static void register() { + Blocks.REGISTRY.register(); + BlockEntities.REGISTRY.register(); + Items.REGISTRY.register(); + TurtleSerialisers.REGISTRY.register(); + PocketUpgradeSerialisers.REGISTRY.register(); + Menus.REGISTRY.register(); + ArgumentTypes.REGISTRY.register(); + LootItemConditionTypes.REGISTRY.register(); + RecipeSerializers.REGISTRY.register(); + CreativeTabs.REGISTRY.register(); + + // Register bundled power providers + ComputerCraftAPI.registerBundledRedstoneProvider(new DefaultBundledRedstoneProvider()); + ComputerCraftAPI.registerRefuelHandler(new FurnaceRefuelHandler()); + ComputerCraftAPI.registerMediaProvider(stack -> { + var item = stack.getItem(); + if (item instanceof IMedia media) return media; + if (item instanceof RecordItem) return RecordMedia.INSTANCE; + return null; + }); + + VanillaDetailRegistries.ITEM_STACK.addProvider(ItemDetails::fill); + VanillaDetailRegistries.BLOCK_IN_WORLD.addProvider(BlockDetails::fill); + } + + /** + * Register any objects which must be done on the main thread. + */ + public static void registerMainThread() { + CauldronInteraction.WATER.put(ModRegistry.Items.TURTLE_NORMAL.get(), TurtleItem.CAULDRON_INTERACTION); + CauldronInteraction.WATER.put(ModRegistry.Items.TURTLE_ADVANCED.get(), TurtleItem.CAULDRON_INTERACTION); } private static void addTurtle(CreativeModeTab.Output out, TurtleItem turtle) { diff --git a/projects/common/src/main/java/dan200/computercraft/shared/command/CommandComputerCraft.java b/projects/common/src/main/java/dan200/computercraft/shared/command/CommandComputerCraft.java index 7c67aab14..4f148eab8 100644 --- a/projects/common/src/main/java/dan200/computercraft/shared/command/CommandComputerCraft.java +++ b/projects/common/src/main/java/dan200/computercraft/shared/command/CommandComputerCraft.java @@ -124,7 +124,9 @@ public final class CommandComputerCraft { if (computer.isOn()) shutdown++; computer.shutdown(); } - context.getSource().sendSuccess(Component.translatable("commands.computercraft.shutdown.done", shutdown, computers.size()), false); + + var didShutdown = shutdown; + context.getSource().sendSuccess(() -> Component.translatable("commands.computercraft.shutdown.done", didShutdown, computers.size()), false); return shutdown; })) @@ -138,7 +140,9 @@ public final class CommandComputerCraft { if (!computer.isOn()) on++; computer.turnOn(); } - context.getSource().sendSuccess(Component.translatable("commands.computercraft.turn_on.done", on, computers.size()), false); + + var didOn = on; + context.getSource().sendSuccess(() -> Component.translatable("commands.computercraft.turn_on.done", didOn, computers.size()), false); return on; })) @@ -213,7 +217,7 @@ public final class CommandComputerCraft { getMetricsInstance(context.getSource()).start(); var stopCommand = "/computercraft track stop"; - context.getSource().sendSuccess(Component.translatable( + context.getSource().sendSuccess(() -> Component.translatable( "commands.computercraft.track.start.stop", link(text(stopCommand), stopCommand, Component.translatable("commands.computercraft.track.stop.action")) ), false); diff --git a/projects/common/src/main/java/dan200/computercraft/shared/command/builder/HelpingArgumentBuilder.java b/projects/common/src/main/java/dan200/computercraft/shared/command/builder/HelpingArgumentBuilder.java index 20aaa2e90..56c50c218 100644 --- a/projects/common/src/main/java/dan200/computercraft/shared/command/builder/HelpingArgumentBuilder.java +++ b/projects/common/src/main/java/dan200/computercraft/shared/command/builder/HelpingArgumentBuilder.java @@ -129,14 +129,14 @@ public final class HelpingArgumentBuilder extends LiteralArgumentBuilder context) { - context.getSource().sendSuccess(getHelp(context, assertNonNull(node), id, command), false); + context.getSource().sendSuccess(() -> getHelp(context, assertNonNull(node), id, command), false); return 0; } } private static Command helpForChild(CommandNode node, String id, String command) { return context -> { - context.getSource().sendSuccess(getHelp(context, node, id + "." + node.getName().replace('-', '_'), command + " " + node.getName()), false); + context.getSource().sendSuccess(() -> getHelp(context, node, id + "." + node.getName().replace('-', '_'), command + " " + node.getName()), false); return 0; }; } diff --git a/projects/common/src/main/java/dan200/computercraft/shared/command/text/ServerTableFormatter.java b/projects/common/src/main/java/dan200/computercraft/shared/command/text/ServerTableFormatter.java index f46138d12..bd50c7ae3 100644 --- a/projects/common/src/main/java/dan200/computercraft/shared/command/text/ServerTableFormatter.java +++ b/projects/common/src/main/java/dan200/computercraft/shared/command/text/ServerTableFormatter.java @@ -37,6 +37,6 @@ public class ServerTableFormatter implements TableFormatter { @Override public void writeLine(String label, Component component) { - source.sendSuccess(component, false); + source.sendSuccess(() -> component, false); } } 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 cafb043a9..5f225f65c 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 @@ -32,7 +32,7 @@ import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.BlockEntityTicker; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.storage.loot.LootContext; +import net.minecraft.world.level.storage.loot.LootParams; import net.minecraft.world.level.storage.loot.parameters.LootContextParams; import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.Vec3; @@ -138,13 +138,12 @@ public abstract class AbstractComputerBlock out.accept(getItem(computer))); + .withDynamicDrop(DROP, out -> out.accept(getItem(computer))); for (var item : state.getDrops(context)) { popResource(world, pos, item); } diff --git a/projects/common/src/main/java/dan200/computercraft/shared/details/ItemDetails.java b/projects/common/src/main/java/dan200/computercraft/shared/details/ItemDetails.java index d1d4dcfe4..861843ad9 100644 --- a/projects/common/src/main/java/dan200/computercraft/shared/details/ItemDetails.java +++ b/projects/common/src/main/java/dan200/computercraft/shared/details/ItemDetails.java @@ -8,6 +8,7 @@ import com.google.gson.JsonParseException; import dan200.computercraft.shared.platform.PlatformHelper; import dan200.computercraft.shared.platform.RegistryWrappers; import dan200.computercraft.shared.util.NBTUtil; +import net.minecraft.core.registries.Registries; import net.minecraft.nbt.ListTag; import net.minecraft.nbt.Tag; import net.minecraft.network.chat.Component; @@ -96,9 +97,7 @@ public class ItemDetails { .map(group -> { Map groupData = new HashMap<>(2); - var id = PlatformHelper.get().getCreativeTabId(group); - if (id != null) groupData.put("id", id.toString()); - + groupData.put("id", PlatformHelper.get().getRegistryKey(Registries.CREATIVE_MODE_TAB, group).toString()); groupData.put("displayName", group.getDisplayName().getString()); return groupData; }) diff --git a/projects/common/src/main/java/dan200/computercraft/shared/peripheral/speaker/SpeakerPosition.java b/projects/common/src/main/java/dan200/computercraft/shared/peripheral/speaker/SpeakerPosition.java index d674c56a1..ec8c54c62 100644 --- a/projects/common/src/main/java/dan200/computercraft/shared/peripheral/speaker/SpeakerPosition.java +++ b/projects/common/src/main/java/dan200/computercraft/shared/peripheral/speaker/SpeakerPosition.java @@ -19,7 +19,7 @@ public record SpeakerPosition(@Nullable Level level, Vec3 position, @Nullable En } public static SpeakerPosition of(Entity entity) { - return new SpeakerPosition(entity.level, entity.getEyePosition(1), entity); + return new SpeakerPosition(entity.level(), entity.getEyePosition(1), entity); } public boolean withinDistance(SpeakerPosition other, double distanceSq) { diff --git a/projects/common/src/main/java/dan200/computercraft/shared/platform/PlatformHelper.java b/projects/common/src/main/java/dan200/computercraft/shared/platform/PlatformHelper.java index d05c0baaa..3b90d1e26 100644 --- a/projects/common/src/main/java/dan200/computercraft/shared/platform/PlatformHelper.java +++ b/projects/common/src/main/java/dan200/computercraft/shared/platform/PlatformHelper.java @@ -274,13 +274,11 @@ public interface PlatformHelper extends dan200.computercraft.impl.PlatformHelper int getBurnTime(ItemStack stack); /** - * Get a unique identifier for this creative tab. + * Create a builder for a new creative tab. * - * @param tab The tab to get - * @return The unique identifier, or {@code null} if not available. + * @return The creative tab builder. */ - @Nullable - ResourceLocation getCreativeTabId(CreativeModeTab tab); + CreativeModeTab.Builder newCreativeModeTab(); /** * Get the "container" item to be returned after crafting. For instance, crafting with a lava bucket should return diff --git a/projects/common/src/main/java/dan200/computercraft/shared/pocket/core/PocketServerComputer.java b/projects/common/src/main/java/dan200/computercraft/shared/pocket/core/PocketServerComputer.java index 6ac22f3dd..eec54879b 100644 --- a/projects/common/src/main/java/dan200/computercraft/shared/pocket/core/PocketServerComputer.java +++ b/projects/common/src/main/java/dan200/computercraft/shared/pocket/core/PocketServerComputer.java @@ -153,7 +153,7 @@ public class PocketServerComputer extends ServerComputer implements IPocketAcces super.tickServer(); // Find any players which have gone missing and remove them from the tracking list. - tracking.removeIf(player -> !player.isAlive() || player.level != getLevel()); + tracking.removeIf(player -> !player.isAlive() || player.level() != getLevel()); // And now find any new players, add them to the tracking list, and broadcast state where appropriate. var sendState = hasOutputChanged() || lightChanged; diff --git a/projects/common/src/main/java/dan200/computercraft/shared/pocket/inventory/PocketComputerMenuProvider.java b/projects/common/src/main/java/dan200/computercraft/shared/pocket/inventory/PocketComputerMenuProvider.java index dd789f63a..7cd84af52 100644 --- a/projects/common/src/main/java/dan200/computercraft/shared/pocket/inventory/PocketComputerMenuProvider.java +++ b/projects/common/src/main/java/dan200/computercraft/shared/pocket/inventory/PocketComputerMenuProvider.java @@ -48,7 +48,7 @@ public class PocketComputerMenuProvider implements MenuProvider { isTypingOnly ? ModRegistry.Menus.POCKET_COMPUTER_NO_TERM.get() : ModRegistry.Menus.POCKET_COMPUTER.get(), id, inventory, p -> { var stack = p.getItemInHand(hand); - return stack.getItem() == item && PocketComputerItem.getServerComputer(assertNonNull(entity.level.getServer()), stack) == computer; + return stack.getItem() == item && PocketComputerItem.getServerComputer(assertNonNull(entity.level().getServer()), stack) == computer; }, computer, item.getFamily() ); diff --git a/projects/common/src/main/java/dan200/computercraft/shared/pocket/items/PocketComputerItem.java b/projects/common/src/main/java/dan200/computercraft/shared/pocket/items/PocketComputerItem.java index a3648ba0c..03c3d7274 100644 --- a/projects/common/src/main/java/dan200/computercraft/shared/pocket/items/PocketComputerItem.java +++ b/projects/common/src/main/java/dan200/computercraft/shared/pocket/items/PocketComputerItem.java @@ -122,10 +122,11 @@ public class PocketComputerItem extends Item implements IComputerItem, IMedia, I @ForgeOverride public boolean onEntityItemUpdate(ItemStack stack, ItemEntity entity) { - if (entity.level.isClientSide || entity.level.getServer() == null) return false; + var level = entity.level(); + if (level.isClientSide || level.getServer() == null) return false; - var computer = getServerComputer(entity.level.getServer(), stack); - if (computer != null && tick(stack, entity.level, entity, computer)) entity.setItem(stack.copy()); + var computer = getServerComputer(level.getServer(), stack); + if (computer != null && tick(stack, entity.level(), entity, computer)) entity.setItem(stack.copy()); return false; } diff --git a/projects/common/src/main/java/dan200/computercraft/shared/pocket/peripherals/PocketSpeakerPeripheral.java b/projects/common/src/main/java/dan200/computercraft/shared/pocket/peripherals/PocketSpeakerPeripheral.java index 12e3e75cb..538790560 100644 --- a/projects/common/src/main/java/dan200/computercraft/shared/pocket/peripherals/PocketSpeakerPeripheral.java +++ b/projects/common/src/main/java/dan200/computercraft/shared/pocket/peripherals/PocketSpeakerPeripheral.java @@ -37,7 +37,7 @@ public class PocketSpeakerPeripheral extends UpgradeSpeakerPeripheral { public void update() { var entity = access.getEntity(); if (entity != null) { - level = entity.level; + level = entity.level(); position = entity.position(); } diff --git a/projects/common/src/main/java/dan200/computercraft/shared/turtle/core/TurtleMoveCommand.java b/projects/common/src/main/java/dan200/computercraft/shared/turtle/core/TurtleMoveCommand.java index c7d8a2ad8..02778bb93 100644 --- a/projects/common/src/main/java/dan200/computercraft/shared/turtle/core/TurtleMoveCommand.java +++ b/projects/common/src/main/java/dan200/computercraft/shared/turtle/core/TurtleMoveCommand.java @@ -44,7 +44,7 @@ public class TurtleMoveCommand implements TurtleCommand { var state = oldWorld.getBlockState(newPosition); if (!oldWorld.isEmptyBlock(newPosition) && !WorldUtil.isLiquidBlock(oldWorld, newPosition) && - !state.getMaterial().isReplaceable()) { + !state.canBeReplaced()) { return TurtleCommandResult.failure("Movement obstructed"); } diff --git a/projects/common/src/main/java/dan200/computercraft/shared/turtle/core/TurtlePlaceCommand.java b/projects/common/src/main/java/dan200/computercraft/shared/turtle/core/TurtlePlaceCommand.java index 447e7a456..b0e29f44a 100644 --- a/projects/common/src/main/java/dan200/computercraft/shared/turtle/core/TurtlePlaceCommand.java +++ b/projects/common/src/main/java/dan200/computercraft/shared/turtle/core/TurtlePlaceCommand.java @@ -29,6 +29,7 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.SignBlockEntity; +import net.minecraft.world.level.block.entity.SignText; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.EntityHitResult; @@ -210,7 +211,7 @@ public class TurtlePlaceCommand implements TurtleCommand { ); if (result != InteractionResult.PASS) return result; - var level = turtlePlayer.player().level; + var level = turtlePlayer.player().level(); // We special case some items which we allow to place "normally". Yes, this is very ugly. var item = stack.getItem(); @@ -225,18 +226,18 @@ public class TurtlePlaceCommand implements TurtleCommand { var signTile = (SignBlockEntity) tile; var split = Splitter.on('\n').splitToList(message); var firstLine = split.size() <= 2 ? 1 : 0; + + var signText = new SignText(); for (var i = 0; i < 4; i++) { if (i >= firstLine && i < firstLine + split.size()) { var line = split.get(i - firstLine); - signTile.setMessage(i, line.length() > 15 + signText.setMessage(i, line.length() > 15 ? Component.literal(line.substring(0, 15)) : Component.literal(line) ); - } else { - signTile.setMessage(i, Component.literal("")); } } - signTile.setChanged(); + signTile.setText(signText, true); world.sendBlockUpdated(tile.getBlockPos(), tile.getBlockState(), tile.getBlockState(), Block.UPDATE_ALL); } diff --git a/projects/common/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleInventoryCrafting.java b/projects/common/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleInventoryCrafting.java index 9dd345c4a..082980683 100644 --- a/projects/common/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleInventoryCrafting.java +++ b/projects/common/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleInventoryCrafting.java @@ -10,6 +10,7 @@ import dan200.computercraft.shared.turtle.blocks.TurtleBlockEntity; import dan200.computercraft.shared.turtle.core.TurtlePlayer; import net.minecraft.server.level.ServerLevel; import net.minecraft.world.entity.player.Player; +import net.minecraft.world.entity.player.StackedContents; import net.minecraft.world.inventory.CraftingContainer; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.Recipe; @@ -17,20 +18,22 @@ import net.minecraft.world.item.crafting.RecipeType; import net.minecraft.world.level.Level; import javax.annotation.Nullable; +import java.util.AbstractList; import java.util.ArrayList; import java.util.Collections; import java.util.List; -public class TurtleInventoryCrafting extends CraftingContainer { +public class TurtleInventoryCrafting implements CraftingContainer { + public static final int WIDTH = 3; + public static final int HEIGHT = 3; + public static final int SIZE = WIDTH * HEIGHT; + private final ITurtleAccess turtle; private int xStart = 0; private int yStart = 0; @SuppressWarnings("ConstantConditions") public TurtleInventoryCrafting(ITurtleAccess turtle) { - // Passing null in here is evil, but we don't have a container present. We override most methods in order to - // avoid throwing any NPEs. - super(null, 0, 0); this.turtle = turtle; } @@ -96,7 +99,7 @@ public class TurtleInventoryCrafting extends CraftingContainer { // afterwards). if (existing.isEmpty()) { setItem(slot, remainder); - } else if (ItemStack.isSame(existing, remainder) && ItemStack.tagMatches(existing, remainder)) { + } else if (ItemStack.isSameItemSameTags(existing, remainder)) { remainder.grow(existing.getCount()); setItem(slot, remainder); } else { @@ -110,12 +113,12 @@ public class TurtleInventoryCrafting extends CraftingContainer { @Override public int getWidth() { - return 3; + return WIDTH; } @Override public int getHeight() { - return 3; + return HEIGHT; } private int modifyIndex(int index) { @@ -126,35 +129,37 @@ public class TurtleInventoryCrafting extends CraftingContainer { : -1; } - // IInventory implementation + @Override + public boolean isEmpty() { + for (int i = 0; i < SIZE; i++) { + if (!getItem(i).isEmpty()) return false; + } + return true; + } @Override public int getContainerSize() { - return getWidth() * getHeight(); + return SIZE; } @Override public ItemStack getItem(int i) { - i = modifyIndex(i); - return turtle.getInventory().getItem(i); + return turtle.getInventory().getItem(modifyIndex(i)); } @Override public ItemStack removeItemNoUpdate(int i) { - i = modifyIndex(i); - return turtle.getInventory().removeItemNoUpdate(i); + return turtle.getInventory().removeItemNoUpdate(modifyIndex(i)); } @Override public ItemStack removeItem(int i, int size) { - i = modifyIndex(i); - return turtle.getInventory().removeItem(i, size); + return turtle.getInventory().removeItem(modifyIndex(i), size); } @Override public void setItem(int i, ItemStack stack) { - i = modifyIndex(i); - turtle.getInventory().setItem(i, stack); + turtle.getInventory().setItem(modifyIndex(i), stack); } @Override @@ -174,15 +179,34 @@ public class TurtleInventoryCrafting extends CraftingContainer { @Override public boolean canPlaceItem(int i, ItemStack stack) { - i = modifyIndex(i); - return turtle.getInventory().canPlaceItem(i, stack); + return turtle.getInventory().canPlaceItem(modifyIndex(i), stack); } @Override public void clearContent() { - for (var i = 0; i < getContainerSize(); i++) { + for (var i = 0; i < SIZE; i++) { var j = modifyIndex(i); turtle.getInventory().setItem(j, ItemStack.EMPTY); } } + + @Override + public void fillStackedContents(StackedContents contents) { + for (int i = 0; i < SIZE; i++) contents.accountSimpleStack(getItem(i)); + } + + @Override + public List getItems() { + return new AbstractList<>() { + @Override + public ItemStack get(int index) { + return getItem(index); + } + + @Override + public int size() { + return SIZE; + } + }; + } } diff --git a/projects/common/src/main/java/dan200/computercraft/shared/util/DropConsumer.java b/projects/common/src/main/java/dan200/computercraft/shared/util/DropConsumer.java index cbedaeeb5..c287b3891 100644 --- a/projects/common/src/main/java/dan200/computercraft/shared/util/DropConsumer.java +++ b/projects/common/src/main/java/dan200/computercraft/shared/util/DropConsumer.java @@ -33,7 +33,7 @@ public final class DropConsumer { dropConsumer = consumer; remainingDrops = new ArrayList<>(); dropEntity = entity; - dropWorld = entity.level; + dropWorld = entity.level(); dropBounds = new AABB(entity.blockPosition()).inflate(2, 2, 2); } @@ -70,7 +70,7 @@ public final class DropConsumer { public static boolean onEntitySpawn(Entity entity) { // Capture any nearby item spawns - if (dropWorld == entity.getLevel() && entity instanceof ItemEntity + if (dropWorld == entity.level() && entity instanceof ItemEntity && assertNonNull(dropBounds).contains(entity.position())) { handleDrops(((ItemEntity) entity).getItem()); return true; diff --git a/projects/common/src/main/java/dan200/computercraft/shared/util/InventoryUtil.java b/projects/common/src/main/java/dan200/computercraft/shared/util/InventoryUtil.java index 4fd34c316..22b361ff7 100644 --- a/projects/common/src/main/java/dan200/computercraft/shared/util/InventoryUtil.java +++ b/projects/common/src/main/java/dan200/computercraft/shared/util/InventoryUtil.java @@ -90,6 +90,6 @@ public final class InventoryUtil { if (stack1.getItem() != stack2.getItem()) return false; if (stack1.getDamageValue() != stack2.getDamageValue()) return false; if (stack1.getCount() > stack1.getMaxStackSize()) return false; - return ItemStack.tagMatches(stack1, stack2); + return ItemStack.isSameItemSameTags(stack1, stack2); } } diff --git a/projects/common/src/main/java/dan200/computercraft/shared/util/WorldUtil.java b/projects/common/src/main/java/dan200/computercraft/shared/util/WorldUtil.java index b8358cbec..864b2d92d 100644 --- a/projects/common/src/main/java/dan200/computercraft/shared/util/WorldUtil.java +++ b/projects/common/src/main/java/dan200/computercraft/shared/util/WorldUtil.java @@ -35,7 +35,7 @@ public final class WorldUtil { public static boolean isLiquidBlock(Level world, BlockPos pos) { if (!world.isInWorldBounds(pos)) return false; - return world.getBlockState(pos).getMaterial().isLiquid(); + return world.getBlockState(pos).liquid(); } public static boolean isVecInside(VoxelShape shape, Vec3 vec) { diff --git a/projects/common/src/main/resources/pack.mcmeta b/projects/common/src/main/resources/pack.mcmeta index ffdc039dc..3eeeeebbf 100755 --- a/projects/common/src/main/resources/pack.mcmeta +++ b/projects/common/src/main/resources/pack.mcmeta @@ -1,6 +1,6 @@ { "pack": { - "pack_format": 12, + "pack_format": 15, "description": "CC: Tweaked" } } diff --git a/projects/common/src/test/java/dan200/computercraft/TestPlatformHelper.java b/projects/common/src/test/java/dan200/computercraft/TestPlatformHelper.java index 60b016e9c..0d998af47 100644 --- a/projects/common/src/test/java/dan200/computercraft/TestPlatformHelper.java +++ b/projects/common/src/test/java/dan200/computercraft/TestPlatformHelper.java @@ -165,11 +165,9 @@ public class TestPlatformHelper extends AbstractComputerCraftAPI implements Plat throw new UnsupportedOperationException("Cannot interact with the world inside tests"); } - - @Nullable @Override - public ResourceLocation getCreativeTabId(CreativeModeTab tab) { - return null; + public CreativeModeTab.Builder newCreativeModeTab() { + throw new IllegalStateException("Cannot create creative tab inside tests"); } @Override diff --git a/projects/common/src/testMod/java/dan200/computercraft/export/Exporter.java b/projects/common/src/testMod/java/dan200/computercraft/export/Exporter.java index 45d8368b3..266b6c669 100644 --- a/projects/common/src/testMod/java/dan200/computercraft/export/Exporter.java +++ b/projects/common/src/testMod/java/dan200/computercraft/export/Exporter.java @@ -130,7 +130,9 @@ public class Exporter { dump.itemNames.put(location.toString(), stack.getHoverName().getString()); renderer.captureRender(itemDir.resolve(location.getNamespace()).resolve(location.getPath() + ".png"), - () -> Minecraft.getInstance().getItemRenderer().renderAndDecorateFakeItem(transform, stack, 0, 0) + () -> { + // TODO: Minecraft.getInstance().getItemRenderer().ren(transform, stack, 0, 0) + } ); } renderer.clearState(); diff --git a/projects/common/src/testMod/java/dan200/computercraft/export/ImageRenderer.java b/projects/common/src/testMod/java/dan200/computercraft/export/ImageRenderer.java index 538799033..032fc7bb7 100644 --- a/projects/common/src/testMod/java/dan200/computercraft/export/ImageRenderer.java +++ b/projects/common/src/testMod/java/dan200/computercraft/export/ImageRenderer.java @@ -7,6 +7,7 @@ package dan200.computercraft.export; import com.mojang.blaze3d.pipeline.TextureTarget; import com.mojang.blaze3d.platform.NativeImage; import com.mojang.blaze3d.systems.RenderSystem; +import com.mojang.blaze3d.vertex.VertexSorting; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.FogRenderer; import org.joml.Matrix4f; @@ -36,7 +37,7 @@ public class ImageRenderer implements AutoCloseable { public void setupState() { projectionMatrix = RenderSystem.getProjectionMatrix(); - RenderSystem.setProjectionMatrix(new Matrix4f().identity().ortho(0, 16, 0, 16, 1000, 3000)); + RenderSystem.setProjectionMatrix(new Matrix4f().identity().ortho(0, 16, 0, 16, 1000, 3000), VertexSorting.DISTANCE_TO_ORIGIN); var transform = RenderSystem.getModelViewStack(); transform.pushPose(); @@ -48,7 +49,7 @@ public class ImageRenderer implements AutoCloseable { public void clearState() { if (projectionMatrix == null) throw new IllegalStateException("Not currently rendering"); - RenderSystem.setProjectionMatrix(projectionMatrix); + RenderSystem.setProjectionMatrix(projectionMatrix, VertexSorting.DISTANCE_TO_ORIGIN); RenderSystem.getModelViewStack().popPose(); } diff --git a/projects/common/src/testMod/java/dan200/computercraft/gametest/core/CCTestCommand.java b/projects/common/src/testMod/java/dan200/computercraft/gametest/core/CCTestCommand.java index b192d0b7c..754cbe438 100644 --- a/projects/common/src/testMod/java/dan200/computercraft/gametest/core/CCTestCommand.java +++ b/projects/common/src/testMod/java/dan200/computercraft/gametest/core/CCTestCommand.java @@ -58,36 +58,36 @@ class CCTestCommand { .then(literal("marker").executes(context -> { var player = context.getSource().getPlayerOrException(); - var pos = StructureUtils.findNearestStructureBlock(player.blockPosition(), 15, player.getLevel()); + var pos = StructureUtils.findNearestStructureBlock(player.blockPosition(), 15, player.serverLevel()); if (pos == null) return error(context.getSource(), "No nearby test"); - var structureBlock = (StructureBlockEntity) player.getLevel().getBlockEntity(pos); + var structureBlock = (StructureBlockEntity) player.level().getBlockEntity(pos); if (structureBlock == null) return error(context.getSource(), "No nearby structure block"); var info = GameTestRegistry.getTestFunction(structureBlock.getStructurePath()); // Kill the existing armor stand player - .getLevel().getEntities(EntityType.ARMOR_STAND, x -> x.isAlive() && x.getName().getString().equals(info.getTestName())) + .serverLevel().getEntities(EntityType.ARMOR_STAND, x -> x.isAlive() && x.getName().getString().equals(info.getTestName())) .forEach(Entity::kill); // And create a new one var nbt = new CompoundTag(); nbt.putBoolean("Marker", true); nbt.putBoolean("Invisible", true); - var armorStand = assertNonNull(EntityType.ARMOR_STAND.create(player.getLevel())); + var armorStand = assertNonNull(EntityType.ARMOR_STAND.create(player.level())); armorStand.readAdditionalSaveData(nbt); armorStand.copyPosition(player); armorStand.setCustomName(Component.literal(info.getTestName())); - player.getLevel().addFreshEntity(armorStand); + player.level().addFreshEntity(armorStand); return 0; })) .then(literal("give-computer").executes(context -> { var player = context.getSource().getPlayerOrException(); - var pos = StructureUtils.findNearestStructureBlock(player.blockPosition(), 15, player.getLevel()); + var pos = StructureUtils.findNearestStructureBlock(player.blockPosition(), 15, player.serverLevel()); if (pos == null) return error(context.getSource(), "No nearby test"); - var structureBlock = (StructureBlockEntity) player.getLevel().getBlockEntity(pos); + var structureBlock = (StructureBlockEntity) player.level().getBlockEntity(pos); if (structureBlock == null) return error(context.getSource(), "No nearby structure block"); var info = GameTestRegistry.getTestFunction(structureBlock.getStructurePath()); diff --git a/projects/common/src/testMod/kotlin/dan200/computercraft/gametest/Recipe_Test.kt b/projects/common/src/testMod/kotlin/dan200/computercraft/gametest/Recipe_Test.kt index da554f1ec..4113263ca 100644 --- a/projects/common/src/testMod/kotlin/dan200/computercraft/gametest/Recipe_Test.kt +++ b/projects/common/src/testMod/kotlin/dan200/computercraft/gametest/Recipe_Test.kt @@ -13,8 +13,8 @@ import net.minecraft.gametest.framework.GameTestHelper import net.minecraft.nbt.CompoundTag import net.minecraft.world.entity.player.Player import net.minecraft.world.inventory.AbstractContainerMenu -import net.minecraft.world.inventory.CraftingContainer import net.minecraft.world.inventory.MenuType +import net.minecraft.world.inventory.TransientCraftingContainer import net.minecraft.world.item.ItemStack import net.minecraft.world.item.Items import net.minecraft.world.item.crafting.CraftingRecipe @@ -31,7 +31,7 @@ class Recipe_Test { @GameTest(template = Structures.DEFAULT) fun Craft_result_has_nbt(context: GameTestHelper) = context.sequence { thenExecute { - val container = CraftingContainer(DummyMenu, 3, 3) + val container = TransientCraftingContainer(DummyMenu, 3, 3) container.setItem(0, ItemStack(Items.SKELETON_SKULL)) container.setItem(1, ItemStack(ModRegistry.Items.COMPUTER_ADVANCED.get())) diff --git a/projects/common/src/testMod/resources/pack.mcmeta b/projects/common/src/testMod/resources/pack.mcmeta index bb8b4ecc1..6dc8ffa8e 100755 --- a/projects/common/src/testMod/resources/pack.mcmeta +++ b/projects/common/src/testMod/resources/pack.mcmeta @@ -1,6 +1,6 @@ { "pack": { - "pack_format": 12, + "pack_format": 15, "description": "CC: Test" } } diff --git a/projects/fabric/build.gradle.kts b/projects/fabric/build.gradle.kts index 576bac769..fe7f88022 100644 --- a/projects/fabric/build.gradle.kts +++ b/projects/fabric/build.gradle.kts @@ -42,10 +42,13 @@ dependencies { exclude("net.fabricmc", "fabric-loader") exclude("net.fabricmc.fabric-api") } + /* + modClientRuntimeOnly(libs.bundles.externalMods.fabric.runtime) { exclude("net.fabricmc", "fabric-loader") exclude("net.fabricmc.fabric-api") } + */ "modTestWithSodium"(libs.sodium) "modTestWithIris"(libs.iris) diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/decorations/skull_cloudy.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/decorations/skull_cloudy.json index 7a91a3f2b..cf1f52ebf 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/decorations/skull_cloudy.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/decorations/skull_cloudy.json @@ -11,5 +11,6 @@ } }, "requirements": [["has_monitor", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:skull_cloudy"]} + "rewards": {"recipes": ["computercraft:skull_cloudy"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/decorations/skull_dan200.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/decorations/skull_dan200.json index 1e3705a92..36b971447 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/decorations/skull_dan200.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/decorations/skull_dan200.json @@ -11,5 +11,6 @@ } }, "requirements": [["has_computer", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:skull_dan200"]} + "rewards": {"recipes": ["computercraft:skull_dan200"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/cable.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/cable.json index c0ca963cc..d7b112316 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/cable.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/cable.json @@ -12,5 +12,6 @@ "has_the_recipe": {"conditions": {"recipe": "computercraft:cable"}, "trigger": "minecraft:recipe_unlocked"} }, "requirements": [["has_computer", "has_modem", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:cable"]} + "rewards": {"recipes": ["computercraft:cable"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/computer_advanced.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/computer_advanced.json index d06b27bad..20c2b4480 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/computer_advanced.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/computer_advanced.json @@ -11,5 +11,6 @@ } }, "requirements": [["has_components", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:computer_advanced"]} + "rewards": {"recipes": ["computercraft:computer_advanced"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/computer_advanced_upgrade.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/computer_advanced_upgrade.json index 32aa88341..ae3228c53 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/computer_advanced_upgrade.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/computer_advanced_upgrade.json @@ -11,5 +11,6 @@ } }, "requirements": [["has_components", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:computer_advanced_upgrade"]} + "rewards": {"recipes": ["computercraft:computer_advanced_upgrade"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/computer_command.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/computer_command.json index 39bb35ac5..28e9d2f82 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/computer_command.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/computer_command.json @@ -11,5 +11,6 @@ } }, "requirements": [["has_components", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:computer_command"]} + "rewards": {"recipes": ["computercraft:computer_command"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/computer_normal.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/computer_normal.json index b0f09ab45..2a38c3b43 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/computer_normal.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/computer_normal.json @@ -11,5 +11,6 @@ } }, "requirements": [["has_redstone", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:computer_normal"]} + "rewards": {"recipes": ["computercraft:computer_normal"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_1.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_1.json index 6efbaf513..041bf213e 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_1.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_1.json @@ -8,5 +8,6 @@ "has_the_recipe": {"conditions": {"recipe": "computercraft:disk_1"}, "trigger": "minecraft:recipe_unlocked"} }, "requirements": [["has_drive", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:disk_1"]} + "rewards": {"recipes": ["computercraft:disk_1"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_10.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_10.json index 59eb9ab39..30b4d2105 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_10.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_10.json @@ -8,5 +8,6 @@ "has_the_recipe": {"conditions": {"recipe": "computercraft:disk_10"}, "trigger": "minecraft:recipe_unlocked"} }, "requirements": [["has_drive", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:disk_10"]} + "rewards": {"recipes": ["computercraft:disk_10"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_11.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_11.json index 4b85efc3e..69d669473 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_11.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_11.json @@ -8,5 +8,6 @@ "has_the_recipe": {"conditions": {"recipe": "computercraft:disk_11"}, "trigger": "minecraft:recipe_unlocked"} }, "requirements": [["has_drive", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:disk_11"]} + "rewards": {"recipes": ["computercraft:disk_11"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_12.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_12.json index 9c497cee1..281008add 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_12.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_12.json @@ -8,5 +8,6 @@ "has_the_recipe": {"conditions": {"recipe": "computercraft:disk_12"}, "trigger": "minecraft:recipe_unlocked"} }, "requirements": [["has_drive", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:disk_12"]} + "rewards": {"recipes": ["computercraft:disk_12"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_13.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_13.json index 2a469f0b1..2f2ad2540 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_13.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_13.json @@ -8,5 +8,6 @@ "has_the_recipe": {"conditions": {"recipe": "computercraft:disk_13"}, "trigger": "minecraft:recipe_unlocked"} }, "requirements": [["has_drive", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:disk_13"]} + "rewards": {"recipes": ["computercraft:disk_13"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_14.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_14.json index 623a68038..83a078af7 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_14.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_14.json @@ -8,5 +8,6 @@ "has_the_recipe": {"conditions": {"recipe": "computercraft:disk_14"}, "trigger": "minecraft:recipe_unlocked"} }, "requirements": [["has_drive", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:disk_14"]} + "rewards": {"recipes": ["computercraft:disk_14"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_15.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_15.json index 6f237ae70..ec35fc88d 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_15.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_15.json @@ -8,5 +8,6 @@ "has_the_recipe": {"conditions": {"recipe": "computercraft:disk_15"}, "trigger": "minecraft:recipe_unlocked"} }, "requirements": [["has_drive", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:disk_15"]} + "rewards": {"recipes": ["computercraft:disk_15"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_16.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_16.json index 7b8081291..1a660c1a5 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_16.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_16.json @@ -8,5 +8,6 @@ "has_the_recipe": {"conditions": {"recipe": "computercraft:disk_16"}, "trigger": "minecraft:recipe_unlocked"} }, "requirements": [["has_drive", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:disk_16"]} + "rewards": {"recipes": ["computercraft:disk_16"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_2.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_2.json index c3fc5d11c..1ff11cb17 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_2.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_2.json @@ -8,5 +8,6 @@ "has_the_recipe": {"conditions": {"recipe": "computercraft:disk_2"}, "trigger": "minecraft:recipe_unlocked"} }, "requirements": [["has_drive", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:disk_2"]} + "rewards": {"recipes": ["computercraft:disk_2"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_3.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_3.json index ee780b872..baaa5c84f 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_3.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_3.json @@ -8,5 +8,6 @@ "has_the_recipe": {"conditions": {"recipe": "computercraft:disk_3"}, "trigger": "minecraft:recipe_unlocked"} }, "requirements": [["has_drive", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:disk_3"]} + "rewards": {"recipes": ["computercraft:disk_3"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_4.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_4.json index 442b0fc67..943e99b3e 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_4.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_4.json @@ -8,5 +8,6 @@ "has_the_recipe": {"conditions": {"recipe": "computercraft:disk_4"}, "trigger": "minecraft:recipe_unlocked"} }, "requirements": [["has_drive", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:disk_4"]} + "rewards": {"recipes": ["computercraft:disk_4"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_5.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_5.json index d09c33282..66ae8f2b3 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_5.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_5.json @@ -8,5 +8,6 @@ "has_the_recipe": {"conditions": {"recipe": "computercraft:disk_5"}, "trigger": "minecraft:recipe_unlocked"} }, "requirements": [["has_drive", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:disk_5"]} + "rewards": {"recipes": ["computercraft:disk_5"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_6.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_6.json index f697bf18c..8f5132e16 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_6.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_6.json @@ -8,5 +8,6 @@ "has_the_recipe": {"conditions": {"recipe": "computercraft:disk_6"}, "trigger": "minecraft:recipe_unlocked"} }, "requirements": [["has_drive", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:disk_6"]} + "rewards": {"recipes": ["computercraft:disk_6"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_7.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_7.json index 5ebd52ec7..54aa2b0cb 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_7.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_7.json @@ -8,5 +8,6 @@ "has_the_recipe": {"conditions": {"recipe": "computercraft:disk_7"}, "trigger": "minecraft:recipe_unlocked"} }, "requirements": [["has_drive", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:disk_7"]} + "rewards": {"recipes": ["computercraft:disk_7"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_8.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_8.json index 05fcbde12..fa62cc0af 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_8.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_8.json @@ -8,5 +8,6 @@ "has_the_recipe": {"conditions": {"recipe": "computercraft:disk_8"}, "trigger": "minecraft:recipe_unlocked"} }, "requirements": [["has_drive", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:disk_8"]} + "rewards": {"recipes": ["computercraft:disk_8"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_9.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_9.json index 309e0d497..ef0f3c270 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_9.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_9.json @@ -8,5 +8,6 @@ "has_the_recipe": {"conditions": {"recipe": "computercraft:disk_9"}, "trigger": "minecraft:recipe_unlocked"} }, "requirements": [["has_drive", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:disk_9"]} + "rewards": {"recipes": ["computercraft:disk_9"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_drive.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_drive.json index 31ce50828..028e87603 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_drive.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_drive.json @@ -8,5 +8,6 @@ "has_the_recipe": {"conditions": {"recipe": "computercraft:disk_drive"}, "trigger": "minecraft:recipe_unlocked"} }, "requirements": [["has_computer", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:disk_drive"]} + "rewards": {"recipes": ["computercraft:disk_drive"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/monitor_advanced.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/monitor_advanced.json index 7fc8c04f4..9c3d1dcbd 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/monitor_advanced.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/monitor_advanced.json @@ -11,5 +11,6 @@ } }, "requirements": [["has_computer", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:monitor_advanced"]} + "rewards": {"recipes": ["computercraft:monitor_advanced"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/monitor_normal.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/monitor_normal.json index 54c4ca3e6..52a1f2388 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/monitor_normal.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/monitor_normal.json @@ -11,5 +11,6 @@ } }, "requirements": [["has_computer", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:monitor_normal"]} + "rewards": {"recipes": ["computercraft:monitor_normal"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_advanced/computercraft/speaker.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_advanced/computercraft/speaker.json index a140b16db..1bc6a18f6 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_advanced/computercraft/speaker.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_advanced/computercraft/speaker.json @@ -13,5 +13,6 @@ } }, "requirements": [["has_items", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:pocket_advanced/computercraft/speaker"]} + "rewards": {"recipes": ["computercraft:pocket_advanced/computercraft/speaker"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_advanced/computercraft/wireless_modem_advanced.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_advanced/computercraft/wireless_modem_advanced.json index a7b7f80f0..ec0ca1356 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_advanced/computercraft/wireless_modem_advanced.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_advanced/computercraft/wireless_modem_advanced.json @@ -16,5 +16,6 @@ } }, "requirements": [["has_items", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:pocket_advanced/computercraft/wireless_modem_advanced"]} + "rewards": {"recipes": ["computercraft:pocket_advanced/computercraft/wireless_modem_advanced"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_advanced/computercraft/wireless_modem_normal.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_advanced/computercraft/wireless_modem_normal.json index 1e256df89..e7c84103d 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_advanced/computercraft/wireless_modem_normal.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_advanced/computercraft/wireless_modem_normal.json @@ -16,5 +16,6 @@ } }, "requirements": [["has_items", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:pocket_advanced/computercraft/wireless_modem_normal"]} + "rewards": {"recipes": ["computercraft:pocket_advanced/computercraft/wireless_modem_normal"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_computer_advanced.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_computer_advanced.json index 43ddc1ffe..906548693 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_computer_advanced.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_computer_advanced.json @@ -15,5 +15,6 @@ } }, "requirements": [["has_computer", "has_apple", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:pocket_computer_advanced"]} + "rewards": {"recipes": ["computercraft:pocket_computer_advanced"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_computer_advanced_upgrade.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_computer_advanced_upgrade.json index 7277c0833..2203205fe 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_computer_advanced_upgrade.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_computer_advanced_upgrade.json @@ -11,5 +11,6 @@ } }, "requirements": [["has_components", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:pocket_computer_advanced_upgrade"]} + "rewards": {"recipes": ["computercraft:pocket_computer_advanced_upgrade"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_computer_normal.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_computer_normal.json index d471e5d8c..5dcd29e99 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_computer_normal.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_computer_normal.json @@ -15,5 +15,6 @@ } }, "requirements": [["has_computer", "has_apple", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:pocket_computer_normal"]} + "rewards": {"recipes": ["computercraft:pocket_computer_normal"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_normal/computercraft/speaker.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_normal/computercraft/speaker.json index 336423ac1..615d3e25f 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_normal/computercraft/speaker.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_normal/computercraft/speaker.json @@ -13,5 +13,6 @@ } }, "requirements": [["has_items", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:pocket_normal/computercraft/speaker"]} + "rewards": {"recipes": ["computercraft:pocket_normal/computercraft/speaker"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_normal/computercraft/wireless_modem_advanced.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_normal/computercraft/wireless_modem_advanced.json index 4f05e22e5..2f4085006 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_normal/computercraft/wireless_modem_advanced.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_normal/computercraft/wireless_modem_advanced.json @@ -16,5 +16,6 @@ } }, "requirements": [["has_items", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:pocket_normal/computercraft/wireless_modem_advanced"]} + "rewards": {"recipes": ["computercraft:pocket_normal/computercraft/wireless_modem_advanced"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_normal/computercraft/wireless_modem_normal.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_normal/computercraft/wireless_modem_normal.json index 488075e42..491fd13dd 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_normal/computercraft/wireless_modem_normal.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_normal/computercraft/wireless_modem_normal.json @@ -16,5 +16,6 @@ } }, "requirements": [["has_items", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:pocket_normal/computercraft/wireless_modem_normal"]} + "rewards": {"recipes": ["computercraft:pocket_normal/computercraft/wireless_modem_normal"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/printed_book.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/printed_book.json index ab5743fa3..67a2ed56a 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/printed_book.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/printed_book.json @@ -11,5 +11,6 @@ } }, "requirements": [["has_printer", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:printed_book"]} + "rewards": {"recipes": ["computercraft:printed_book"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/printed_pages.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/printed_pages.json index 7ee19a946..4c2115c9e 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/printed_pages.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/printed_pages.json @@ -11,5 +11,6 @@ } }, "requirements": [["has_printer", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:printed_pages"]} + "rewards": {"recipes": ["computercraft:printed_pages"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/printer.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/printer.json index 7760559b5..53794f510 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/printer.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/printer.json @@ -8,5 +8,6 @@ "has_the_recipe": {"conditions": {"recipe": "computercraft:printer"}, "trigger": "minecraft:recipe_unlocked"} }, "requirements": [["has_computer", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:printer"]} + "rewards": {"recipes": ["computercraft:printer"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/speaker.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/speaker.json index a4cfa68a3..c4af541b6 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/speaker.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/speaker.json @@ -8,5 +8,6 @@ "has_the_recipe": {"conditions": {"recipe": "computercraft:speaker"}, "trigger": "minecraft:recipe_unlocked"} }, "requirements": [["has_computer", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:speaker"]} + "rewards": {"recipes": ["computercraft:speaker"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced.json index 25ddb95fd..1fe46c9b6 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced.json @@ -11,5 +11,6 @@ } }, "requirements": [["has_computer", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:turtle_advanced"]} + "rewards": {"recipes": ["computercraft:turtle_advanced"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/computercraft/speaker.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/computercraft/speaker.json index fe5ecf99f..e593bbe53 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/computercraft/speaker.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/computercraft/speaker.json @@ -13,5 +13,6 @@ } }, "requirements": [["has_items", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:turtle_advanced/computercraft/speaker"]} + "rewards": {"recipes": ["computercraft:turtle_advanced/computercraft/speaker"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/computercraft/wireless_modem_advanced.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/computercraft/wireless_modem_advanced.json index c987dd29d..464eff645 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/computercraft/wireless_modem_advanced.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/computercraft/wireless_modem_advanced.json @@ -16,5 +16,6 @@ } }, "requirements": [["has_items", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:turtle_advanced/computercraft/wireless_modem_advanced"]} + "rewards": {"recipes": ["computercraft:turtle_advanced/computercraft/wireless_modem_advanced"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/computercraft/wireless_modem_normal.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/computercraft/wireless_modem_normal.json index 0b7325811..d5ba842ea 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/computercraft/wireless_modem_normal.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/computercraft/wireless_modem_normal.json @@ -16,5 +16,6 @@ } }, "requirements": [["has_items", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:turtle_advanced/computercraft/wireless_modem_normal"]} + "rewards": {"recipes": ["computercraft:turtle_advanced/computercraft/wireless_modem_normal"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/minecraft/crafting_table.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/minecraft/crafting_table.json index 4ec2f683b..8e5349225 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/minecraft/crafting_table.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/minecraft/crafting_table.json @@ -13,5 +13,6 @@ } }, "requirements": [["has_items", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:turtle_advanced/minecraft/crafting_table"]} + "rewards": {"recipes": ["computercraft:turtle_advanced/minecraft/crafting_table"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/minecraft/diamond_axe.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/minecraft/diamond_axe.json index e59726271..7d16aeb75 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/minecraft/diamond_axe.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/minecraft/diamond_axe.json @@ -13,5 +13,6 @@ } }, "requirements": [["has_items", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:turtle_advanced/minecraft/diamond_axe"]} + "rewards": {"recipes": ["computercraft:turtle_advanced/minecraft/diamond_axe"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/minecraft/diamond_hoe.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/minecraft/diamond_hoe.json index 458c5e577..4fc20015c 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/minecraft/diamond_hoe.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/minecraft/diamond_hoe.json @@ -13,5 +13,6 @@ } }, "requirements": [["has_items", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:turtle_advanced/minecraft/diamond_hoe"]} + "rewards": {"recipes": ["computercraft:turtle_advanced/minecraft/diamond_hoe"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/minecraft/diamond_pickaxe.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/minecraft/diamond_pickaxe.json index ed390b830..7a70fc554 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/minecraft/diamond_pickaxe.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/minecraft/diamond_pickaxe.json @@ -13,5 +13,6 @@ } }, "requirements": [["has_items", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:turtle_advanced/minecraft/diamond_pickaxe"]} + "rewards": {"recipes": ["computercraft:turtle_advanced/minecraft/diamond_pickaxe"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/minecraft/diamond_shovel.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/minecraft/diamond_shovel.json index d9d643ce4..89be37705 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/minecraft/diamond_shovel.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/minecraft/diamond_shovel.json @@ -13,5 +13,6 @@ } }, "requirements": [["has_items", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:turtle_advanced/minecraft/diamond_shovel"]} + "rewards": {"recipes": ["computercraft:turtle_advanced/minecraft/diamond_shovel"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/minecraft/diamond_sword.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/minecraft/diamond_sword.json index 095ab5657..94706972b 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/minecraft/diamond_sword.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/minecraft/diamond_sword.json @@ -13,5 +13,6 @@ } }, "requirements": [["has_items", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:turtle_advanced/minecraft/diamond_sword"]} + "rewards": {"recipes": ["computercraft:turtle_advanced/minecraft/diamond_sword"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced_overlays/turtle_rainbow_overlay.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced_overlays/turtle_rainbow_overlay.json index d9edb47a7..0b22bd773 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced_overlays/turtle_rainbow_overlay.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced_overlays/turtle_rainbow_overlay.json @@ -12,5 +12,6 @@ } }, "requirements": [["has_turtle", "has_dye", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:turtle_advanced_overlays/turtle_rainbow_overlay"]} + "rewards": {"recipes": ["computercraft:turtle_advanced_overlays/turtle_rainbow_overlay"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced_overlays/turtle_trans_overlay.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced_overlays/turtle_trans_overlay.json index ec6b8faa7..e118f12c5 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced_overlays/turtle_trans_overlay.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced_overlays/turtle_trans_overlay.json @@ -12,5 +12,6 @@ } }, "requirements": [["has_turtle", "has_dye", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:turtle_advanced_overlays/turtle_trans_overlay"]} + "rewards": {"recipes": ["computercraft:turtle_advanced_overlays/turtle_trans_overlay"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced_upgrade.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced_upgrade.json index f3799e126..f5dd4d1d3 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced_upgrade.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced_upgrade.json @@ -11,5 +11,6 @@ } }, "requirements": [["has_components", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:turtle_advanced_upgrade"]} + "rewards": {"recipes": ["computercraft:turtle_advanced_upgrade"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal.json index 61e6213cc..168e8a9e9 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal.json @@ -11,5 +11,6 @@ } }, "requirements": [["has_computer", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:turtle_normal"]} + "rewards": {"recipes": ["computercraft:turtle_normal"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/computercraft/speaker.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/computercraft/speaker.json index 3559d8032..de0d7cdd7 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/computercraft/speaker.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/computercraft/speaker.json @@ -13,5 +13,6 @@ } }, "requirements": [["has_items", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:turtle_normal/computercraft/speaker"]} + "rewards": {"recipes": ["computercraft:turtle_normal/computercraft/speaker"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/computercraft/wireless_modem_advanced.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/computercraft/wireless_modem_advanced.json index 1c8fdf045..b89ee1be9 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/computercraft/wireless_modem_advanced.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/computercraft/wireless_modem_advanced.json @@ -16,5 +16,6 @@ } }, "requirements": [["has_items", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:turtle_normal/computercraft/wireless_modem_advanced"]} + "rewards": {"recipes": ["computercraft:turtle_normal/computercraft/wireless_modem_advanced"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/computercraft/wireless_modem_normal.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/computercraft/wireless_modem_normal.json index dd96c072f..637cc592f 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/computercraft/wireless_modem_normal.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/computercraft/wireless_modem_normal.json @@ -16,5 +16,6 @@ } }, "requirements": [["has_items", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:turtle_normal/computercraft/wireless_modem_normal"]} + "rewards": {"recipes": ["computercraft:turtle_normal/computercraft/wireless_modem_normal"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/minecraft/crafting_table.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/minecraft/crafting_table.json index ad5023dab..495259756 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/minecraft/crafting_table.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/minecraft/crafting_table.json @@ -13,5 +13,6 @@ } }, "requirements": [["has_items", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:turtle_normal/minecraft/crafting_table"]} + "rewards": {"recipes": ["computercraft:turtle_normal/minecraft/crafting_table"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/minecraft/diamond_axe.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/minecraft/diamond_axe.json index af5bc1f06..89be86b62 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/minecraft/diamond_axe.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/minecraft/diamond_axe.json @@ -13,5 +13,6 @@ } }, "requirements": [["has_items", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:turtle_normal/minecraft/diamond_axe"]} + "rewards": {"recipes": ["computercraft:turtle_normal/minecraft/diamond_axe"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/minecraft/diamond_hoe.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/minecraft/diamond_hoe.json index 72733b768..a2799e005 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/minecraft/diamond_hoe.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/minecraft/diamond_hoe.json @@ -13,5 +13,6 @@ } }, "requirements": [["has_items", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:turtle_normal/minecraft/diamond_hoe"]} + "rewards": {"recipes": ["computercraft:turtle_normal/minecraft/diamond_hoe"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/minecraft/diamond_pickaxe.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/minecraft/diamond_pickaxe.json index 2b64875f6..955d05e97 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/minecraft/diamond_pickaxe.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/minecraft/diamond_pickaxe.json @@ -13,5 +13,6 @@ } }, "requirements": [["has_items", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:turtle_normal/minecraft/diamond_pickaxe"]} + "rewards": {"recipes": ["computercraft:turtle_normal/minecraft/diamond_pickaxe"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/minecraft/diamond_shovel.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/minecraft/diamond_shovel.json index 2df36f6ec..1d8f6d79b 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/minecraft/diamond_shovel.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/minecraft/diamond_shovel.json @@ -13,5 +13,6 @@ } }, "requirements": [["has_items", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:turtle_normal/minecraft/diamond_shovel"]} + "rewards": {"recipes": ["computercraft:turtle_normal/minecraft/diamond_shovel"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/minecraft/diamond_sword.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/minecraft/diamond_sword.json index 38ca7d929..e328d63ad 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/minecraft/diamond_sword.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/minecraft/diamond_sword.json @@ -13,5 +13,6 @@ } }, "requirements": [["has_items", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:turtle_normal/minecraft/diamond_sword"]} + "rewards": {"recipes": ["computercraft:turtle_normal/minecraft/diamond_sword"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal_overlays/turtle_rainbow_overlay.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal_overlays/turtle_rainbow_overlay.json index 4491e3fab..04837d351 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal_overlays/turtle_rainbow_overlay.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal_overlays/turtle_rainbow_overlay.json @@ -12,5 +12,6 @@ } }, "requirements": [["has_turtle", "has_dye", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:turtle_normal_overlays/turtle_rainbow_overlay"]} + "rewards": {"recipes": ["computercraft:turtle_normal_overlays/turtle_rainbow_overlay"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal_overlays/turtle_trans_overlay.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal_overlays/turtle_trans_overlay.json index a2993b8fd..80bf565f7 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal_overlays/turtle_trans_overlay.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal_overlays/turtle_trans_overlay.json @@ -12,5 +12,6 @@ } }, "requirements": [["has_turtle", "has_dye", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:turtle_normal_overlays/turtle_trans_overlay"]} + "rewards": {"recipes": ["computercraft:turtle_normal_overlays/turtle_trans_overlay"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/wired_modem.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/wired_modem.json index 84150e066..15d106669 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/wired_modem.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/wired_modem.json @@ -15,5 +15,6 @@ } }, "requirements": [["has_computer", "has_cable", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:wired_modem"]} + "rewards": {"recipes": ["computercraft:wired_modem"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/wired_modem_full_from.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/wired_modem_full_from.json index c01263d50..c6f39a9db 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/wired_modem_full_from.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/wired_modem_full_from.json @@ -11,5 +11,6 @@ } }, "requirements": [["has_modem", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:wired_modem_full_from"]} + "rewards": {"recipes": ["computercraft:wired_modem_full_from"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/wired_modem_full_to.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/wired_modem_full_to.json index bbf3d594d..4250a54af 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/wired_modem_full_to.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/wired_modem_full_to.json @@ -11,5 +11,6 @@ } }, "requirements": [["has_modem", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:wired_modem_full_to"]} + "rewards": {"recipes": ["computercraft:wired_modem_full_to"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/wireless_modem_advanced.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/wireless_modem_advanced.json index bde8f9ab0..a79d740a6 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/wireless_modem_advanced.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/wireless_modem_advanced.json @@ -15,5 +15,6 @@ } }, "requirements": [["has_computer", "has_wireless", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:wireless_modem_advanced"]} + "rewards": {"recipes": ["computercraft:wireless_modem_advanced"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/wireless_modem_normal.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/wireless_modem_normal.json index 69165dfde..f404da1b7 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/wireless_modem_normal.json +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/redstone/wireless_modem_normal.json @@ -11,5 +11,6 @@ } }, "requirements": [["has_computer", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:wireless_modem_normal"]} + "rewards": {"recipes": ["computercraft:wireless_modem_normal"]}, + "sends_telemetry_event": false } diff --git a/projects/fabric/src/generated/resources/data/computercraft/loot_tables/blocks/computer_advanced.json b/projects/fabric/src/generated/resources/data/computercraft/loot_tables/blocks/computer_advanced.json index cfeeb00d0..a49d76dbe 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/loot_tables/blocks/computer_advanced.json +++ b/projects/fabric/src/generated/resources/data/computercraft/loot_tables/blocks/computer_advanced.json @@ -5,7 +5,7 @@ "bonus_rolls": 0.0, "conditions": [ { - "condition": "minecraft:alternative", + "condition": "minecraft:any_of", "terms": [ {"condition": "computercraft:block_named"}, {"condition": "computercraft:has_id"}, diff --git a/projects/fabric/src/generated/resources/data/computercraft/loot_tables/blocks/computer_command.json b/projects/fabric/src/generated/resources/data/computercraft/loot_tables/blocks/computer_command.json index cfeeb00d0..a49d76dbe 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/loot_tables/blocks/computer_command.json +++ b/projects/fabric/src/generated/resources/data/computercraft/loot_tables/blocks/computer_command.json @@ -5,7 +5,7 @@ "bonus_rolls": 0.0, "conditions": [ { - "condition": "minecraft:alternative", + "condition": "minecraft:any_of", "terms": [ {"condition": "computercraft:block_named"}, {"condition": "computercraft:has_id"}, diff --git a/projects/fabric/src/generated/resources/data/computercraft/loot_tables/blocks/computer_normal.json b/projects/fabric/src/generated/resources/data/computercraft/loot_tables/blocks/computer_normal.json index cfeeb00d0..a49d76dbe 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/loot_tables/blocks/computer_normal.json +++ b/projects/fabric/src/generated/resources/data/computercraft/loot_tables/blocks/computer_normal.json @@ -5,7 +5,7 @@ "bonus_rolls": 0.0, "conditions": [ { - "condition": "minecraft:alternative", + "condition": "minecraft:any_of", "terms": [ {"condition": "computercraft:block_named"}, {"condition": "computercraft:has_id"}, diff --git a/projects/fabric/src/generated/resources/data/computercraft/loot_tables/blocks/turtle_advanced.json b/projects/fabric/src/generated/resources/data/computercraft/loot_tables/blocks/turtle_advanced.json index cfeeb00d0..a49d76dbe 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/loot_tables/blocks/turtle_advanced.json +++ b/projects/fabric/src/generated/resources/data/computercraft/loot_tables/blocks/turtle_advanced.json @@ -5,7 +5,7 @@ "bonus_rolls": 0.0, "conditions": [ { - "condition": "minecraft:alternative", + "condition": "minecraft:any_of", "terms": [ {"condition": "computercraft:block_named"}, {"condition": "computercraft:has_id"}, diff --git a/projects/fabric/src/generated/resources/data/computercraft/loot_tables/blocks/turtle_normal.json b/projects/fabric/src/generated/resources/data/computercraft/loot_tables/blocks/turtle_normal.json index cfeeb00d0..a49d76dbe 100644 --- a/projects/fabric/src/generated/resources/data/computercraft/loot_tables/blocks/turtle_normal.json +++ b/projects/fabric/src/generated/resources/data/computercraft/loot_tables/blocks/turtle_normal.json @@ -5,7 +5,7 @@ "bonus_rolls": 0.0, "conditions": [ { - "condition": "minecraft:alternative", + "condition": "minecraft:any_of", "terms": [ {"condition": "computercraft:block_named"}, {"condition": "computercraft:has_id"}, diff --git a/projects/fabric/src/main/java/dan200/computercraft/data/FabricDataGenerators.java b/projects/fabric/src/main/java/dan200/computercraft/data/FabricDataGenerators.java index 40e5135a8..5409485b6 100644 --- a/projects/fabric/src/main/java/dan200/computercraft/data/FabricDataGenerators.java +++ b/projects/fabric/src/main/java/dan200/computercraft/data/FabricDataGenerators.java @@ -48,7 +48,7 @@ public class FabricDataGenerators implements DataGeneratorEntrypoint { for (var table : tables) { generator.addProvider((FabricDataOutput out) -> new SimpleFabricLootTableProvider(out, table.paramSet()) { @Override - public void accept(BiConsumer exporter) { + public void generate(BiConsumer exporter) { table.provider().get().generate(exporter); } }); diff --git a/projects/fabric/src/main/java/dan200/computercraft/shared/ComputerCraft.java b/projects/fabric/src/main/java/dan200/computercraft/shared/ComputerCraft.java index d4587a7a1..5a35a33ea 100644 --- a/projects/fabric/src/main/java/dan200/computercraft/shared/ComputerCraft.java +++ b/projects/fabric/src/main/java/dan200/computercraft/shared/ComputerCraft.java @@ -26,7 +26,6 @@ import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents; import net.fabricmc.fabric.api.event.lifecycle.v1.ServerTickEvents; import net.fabricmc.fabric.api.event.player.PlayerBlockBreakEvents; import net.fabricmc.fabric.api.event.player.UseBlockCallback; -import net.fabricmc.fabric.api.itemgroup.v1.FabricItemGroup; import net.fabricmc.fabric.api.loot.v2.LootTableEvents; import net.fabricmc.fabric.api.resource.IdentifiableResourceReloadListener; import net.fabricmc.fabric.api.resource.ResourceManagerHelper; @@ -38,6 +37,9 @@ import net.minecraft.server.packs.resources.ResourceManager; import net.minecraft.util.profiling.ProfilerFiller; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.storage.LevelResource; +import net.minecraft.world.level.storage.loot.LootPool; +import net.minecraft.world.level.storage.loot.entries.LootTableReference; +import net.minecraft.world.level.storage.loot.providers.number.ConstantValue; import java.util.concurrent.CompletableFuture; import java.util.concurrent.Executor; @@ -49,7 +51,6 @@ public class ComputerCraft { NetworkHandler.init(); ModRegistry.register(); ModRegistry.registerMainThread(); - ModRegistry.registerCreativeTab(FabricItemGroup.builder(new ResourceLocation(ComputerCraftAPI.MOD_ID, "tab"))).build(); // Register peripherals PeripheralLookup.get().registerForBlockEntity((b, d) -> b.peripheral(), ModRegistry.BlockEntities.COMPUTER_NORMAL.get()); @@ -94,8 +95,10 @@ public class ComputerCraft { UseBlockCallback.EVENT.register(FabricCommonHooks::useOnBlock); LootTableEvents.MODIFY.register((resourceManager, lootManager, id, tableBuilder, source) -> { - var pool = CommonHooks.getExtraLootPool(id); - if (pool != null) tableBuilder.withPool(pool); + if (!id.getNamespace().equals("minecraft") || !CommonHooks.TREASURE_DISK_LOOT_TABLES.contains(id)) return; + tableBuilder.withPool(LootPool.lootPool() + .add(LootTableReference.lootTableReference(CommonHooks.TREASURE_DISK_LOOT)) + .setRolls(ConstantValue.exactly(1))); }); CommonHooks.onDatapackReload((name, listener) -> ResourceManagerHelper.get(PackType.SERVER_DATA).registerReloadListener(new ReloadListener(name, listener))); diff --git a/projects/fabric/src/main/java/dan200/computercraft/shared/platform/PlatformHelperImpl.java b/projects/fabric/src/main/java/dan200/computercraft/shared/platform/PlatformHelperImpl.java index 1cf67972b..4e84e8f1f 100644 --- a/projects/fabric/src/main/java/dan200/computercraft/shared/platform/PlatformHelperImpl.java +++ b/projects/fabric/src/main/java/dan200/computercraft/shared/platform/PlatformHelperImpl.java @@ -23,6 +23,7 @@ import dan200.computercraft.shared.util.InventoryUtil; import net.fabricmc.fabric.api.event.player.AttackEntityCallback; import net.fabricmc.fabric.api.event.player.UseBlockCallback; import net.fabricmc.fabric.api.event.player.UseEntityCallback; +import net.fabricmc.fabric.api.itemgroup.v1.FabricItemGroup; import net.fabricmc.fabric.api.lookup.v1.block.BlockApiCache; import net.fabricmc.fabric.api.lookup.v1.block.BlockApiLookup; import net.fabricmc.fabric.api.object.builder.v1.block.entity.FabricBlockEntityTypeBuilder; @@ -256,10 +257,9 @@ public class PlatformHelperImpl implements PlatformHelper { return fuel == null ? 0 : fuel; } - @Nullable @Override - public ResourceLocation getCreativeTabId(CreativeModeTab tab) { - return tab.getId(); + public CreativeModeTab.Builder newCreativeModeTab() { + return FabricItemGroup.builder(); } @Override @@ -295,24 +295,24 @@ public class PlatformHelperImpl implements PlatformHelper { @Override public InteractionResult canAttackEntity(ServerPlayer player, Entity entity) { - return AttackEntityCallback.EVENT.invoker().interact(player, player.level, InteractionHand.MAIN_HAND, entity, null); + return AttackEntityCallback.EVENT.invoker().interact(player, player.level(), InteractionHand.MAIN_HAND, entity, null); } @Override public boolean interactWithEntity(ServerPlayer player, Entity entity, Vec3 hitPos) { - return UseEntityCallback.EVENT.invoker().interact(player, entity.level, InteractionHand.MAIN_HAND, entity, new EntityHitResult(entity, hitPos)).consumesAction() || + return UseEntityCallback.EVENT.invoker().interact(player, entity.level(), InteractionHand.MAIN_HAND, entity, new EntityHitResult(entity, hitPos)).consumesAction() || entity.interactAt(player, hitPos.subtract(entity.position()), InteractionHand.MAIN_HAND).consumesAction() || player.interactOn(entity, InteractionHand.MAIN_HAND).consumesAction(); } @Override public InteractionResult useOn(ServerPlayer player, ItemStack stack, BlockHitResult hit, Predicate canUseBlock) { - var result = UseBlockCallback.EVENT.invoker().interact(player, player.level, InteractionHand.MAIN_HAND, hit); + var result = UseBlockCallback.EVENT.invoker().interact(player, player.level(), InteractionHand.MAIN_HAND, hit); if (result != InteractionResult.PASS) return result; - var block = player.level.getBlockState(hit.getBlockPos()); + var block = player.level().getBlockState(hit.getBlockPos()); if (!block.isAir() && canUseBlock.test(block)) { - var useResult = block.use(player.level, player, InteractionHand.MAIN_HAND, hit); + var useResult = block.use(player.level(), player, InteractionHand.MAIN_HAND, hit); if (useResult.consumesAction()) return useResult; } diff --git a/projects/fabric/src/main/resources/fabric.mod.json b/projects/fabric/src/main/resources/fabric.mod.json index 189e29bcd..e988c95e8 100644 --- a/projects/fabric/src/main/resources/fabric.mod.json +++ b/projects/fabric/src/main/resources/fabric.mod.json @@ -46,9 +46,9 @@ } ], "depends": { - "fabricloader": ">=0.14.17", - "fabric-api": ">=0.80.0", - "minecraft": ">=1.19.4 <1.20" + "fabricloader": ">=0.14.21", + "fabric-api": ">=0.83.0", + "minecraft": ">=1.20 <1.21" }, "accessWidener": "computercraft.accesswidener" } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/decorations/skull_cloudy.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/decorations/skull_cloudy.json index 7a91a3f2b..cf1f52ebf 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/decorations/skull_cloudy.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/decorations/skull_cloudy.json @@ -11,5 +11,6 @@ } }, "requirements": [["has_monitor", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:skull_cloudy"]} + "rewards": {"recipes": ["computercraft:skull_cloudy"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/decorations/skull_dan200.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/decorations/skull_dan200.json index 1e3705a92..36b971447 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/decorations/skull_dan200.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/decorations/skull_dan200.json @@ -11,5 +11,6 @@ } }, "requirements": [["has_computer", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:skull_dan200"]} + "rewards": {"recipes": ["computercraft:skull_dan200"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/cable.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/cable.json index c0ca963cc..d7b112316 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/cable.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/cable.json @@ -12,5 +12,6 @@ "has_the_recipe": {"conditions": {"recipe": "computercraft:cable"}, "trigger": "minecraft:recipe_unlocked"} }, "requirements": [["has_computer", "has_modem", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:cable"]} + "rewards": {"recipes": ["computercraft:cable"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/computer_advanced.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/computer_advanced.json index a9b1ebb1a..b13ee3519 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/computer_advanced.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/computer_advanced.json @@ -11,5 +11,6 @@ } }, "requirements": [["has_components", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:computer_advanced"]} + "rewards": {"recipes": ["computercraft:computer_advanced"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/computer_advanced_upgrade.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/computer_advanced_upgrade.json index 1ca5940d2..6f425859a 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/computer_advanced_upgrade.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/computer_advanced_upgrade.json @@ -11,5 +11,6 @@ } }, "requirements": [["has_components", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:computer_advanced_upgrade"]} + "rewards": {"recipes": ["computercraft:computer_advanced_upgrade"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/computer_command.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/computer_command.json index 39bb35ac5..28e9d2f82 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/computer_command.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/computer_command.json @@ -11,5 +11,6 @@ } }, "requirements": [["has_components", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:computer_command"]} + "rewards": {"recipes": ["computercraft:computer_command"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/computer_normal.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/computer_normal.json index a9acd2996..c3a34ada1 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/computer_normal.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/computer_normal.json @@ -11,5 +11,6 @@ } }, "requirements": [["has_redstone", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:computer_normal"]} + "rewards": {"recipes": ["computercraft:computer_normal"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_1.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_1.json index 6efbaf513..041bf213e 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_1.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_1.json @@ -8,5 +8,6 @@ "has_the_recipe": {"conditions": {"recipe": "computercraft:disk_1"}, "trigger": "minecraft:recipe_unlocked"} }, "requirements": [["has_drive", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:disk_1"]} + "rewards": {"recipes": ["computercraft:disk_1"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_10.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_10.json index 59eb9ab39..30b4d2105 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_10.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_10.json @@ -8,5 +8,6 @@ "has_the_recipe": {"conditions": {"recipe": "computercraft:disk_10"}, "trigger": "minecraft:recipe_unlocked"} }, "requirements": [["has_drive", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:disk_10"]} + "rewards": {"recipes": ["computercraft:disk_10"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_11.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_11.json index 4b85efc3e..69d669473 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_11.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_11.json @@ -8,5 +8,6 @@ "has_the_recipe": {"conditions": {"recipe": "computercraft:disk_11"}, "trigger": "minecraft:recipe_unlocked"} }, "requirements": [["has_drive", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:disk_11"]} + "rewards": {"recipes": ["computercraft:disk_11"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_12.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_12.json index 9c497cee1..281008add 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_12.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_12.json @@ -8,5 +8,6 @@ "has_the_recipe": {"conditions": {"recipe": "computercraft:disk_12"}, "trigger": "minecraft:recipe_unlocked"} }, "requirements": [["has_drive", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:disk_12"]} + "rewards": {"recipes": ["computercraft:disk_12"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_13.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_13.json index 2a469f0b1..2f2ad2540 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_13.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_13.json @@ -8,5 +8,6 @@ "has_the_recipe": {"conditions": {"recipe": "computercraft:disk_13"}, "trigger": "minecraft:recipe_unlocked"} }, "requirements": [["has_drive", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:disk_13"]} + "rewards": {"recipes": ["computercraft:disk_13"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_14.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_14.json index 623a68038..83a078af7 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_14.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_14.json @@ -8,5 +8,6 @@ "has_the_recipe": {"conditions": {"recipe": "computercraft:disk_14"}, "trigger": "minecraft:recipe_unlocked"} }, "requirements": [["has_drive", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:disk_14"]} + "rewards": {"recipes": ["computercraft:disk_14"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_15.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_15.json index 6f237ae70..ec35fc88d 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_15.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_15.json @@ -8,5 +8,6 @@ "has_the_recipe": {"conditions": {"recipe": "computercraft:disk_15"}, "trigger": "minecraft:recipe_unlocked"} }, "requirements": [["has_drive", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:disk_15"]} + "rewards": {"recipes": ["computercraft:disk_15"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_16.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_16.json index 7b8081291..1a660c1a5 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_16.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_16.json @@ -8,5 +8,6 @@ "has_the_recipe": {"conditions": {"recipe": "computercraft:disk_16"}, "trigger": "minecraft:recipe_unlocked"} }, "requirements": [["has_drive", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:disk_16"]} + "rewards": {"recipes": ["computercraft:disk_16"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_2.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_2.json index c3fc5d11c..1ff11cb17 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_2.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_2.json @@ -8,5 +8,6 @@ "has_the_recipe": {"conditions": {"recipe": "computercraft:disk_2"}, "trigger": "minecraft:recipe_unlocked"} }, "requirements": [["has_drive", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:disk_2"]} + "rewards": {"recipes": ["computercraft:disk_2"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_3.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_3.json index ee780b872..baaa5c84f 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_3.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_3.json @@ -8,5 +8,6 @@ "has_the_recipe": {"conditions": {"recipe": "computercraft:disk_3"}, "trigger": "minecraft:recipe_unlocked"} }, "requirements": [["has_drive", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:disk_3"]} + "rewards": {"recipes": ["computercraft:disk_3"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_4.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_4.json index 442b0fc67..943e99b3e 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_4.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_4.json @@ -8,5 +8,6 @@ "has_the_recipe": {"conditions": {"recipe": "computercraft:disk_4"}, "trigger": "minecraft:recipe_unlocked"} }, "requirements": [["has_drive", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:disk_4"]} + "rewards": {"recipes": ["computercraft:disk_4"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_5.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_5.json index d09c33282..66ae8f2b3 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_5.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_5.json @@ -8,5 +8,6 @@ "has_the_recipe": {"conditions": {"recipe": "computercraft:disk_5"}, "trigger": "minecraft:recipe_unlocked"} }, "requirements": [["has_drive", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:disk_5"]} + "rewards": {"recipes": ["computercraft:disk_5"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_6.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_6.json index f697bf18c..8f5132e16 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_6.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_6.json @@ -8,5 +8,6 @@ "has_the_recipe": {"conditions": {"recipe": "computercraft:disk_6"}, "trigger": "minecraft:recipe_unlocked"} }, "requirements": [["has_drive", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:disk_6"]} + "rewards": {"recipes": ["computercraft:disk_6"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_7.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_7.json index 5ebd52ec7..54aa2b0cb 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_7.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_7.json @@ -8,5 +8,6 @@ "has_the_recipe": {"conditions": {"recipe": "computercraft:disk_7"}, "trigger": "minecraft:recipe_unlocked"} }, "requirements": [["has_drive", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:disk_7"]} + "rewards": {"recipes": ["computercraft:disk_7"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_8.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_8.json index 05fcbde12..fa62cc0af 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_8.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_8.json @@ -8,5 +8,6 @@ "has_the_recipe": {"conditions": {"recipe": "computercraft:disk_8"}, "trigger": "minecraft:recipe_unlocked"} }, "requirements": [["has_drive", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:disk_8"]} + "rewards": {"recipes": ["computercraft:disk_8"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_9.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_9.json index 309e0d497..ef0f3c270 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_9.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_9.json @@ -8,5 +8,6 @@ "has_the_recipe": {"conditions": {"recipe": "computercraft:disk_9"}, "trigger": "minecraft:recipe_unlocked"} }, "requirements": [["has_drive", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:disk_9"]} + "rewards": {"recipes": ["computercraft:disk_9"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_drive.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_drive.json index 31ce50828..028e87603 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_drive.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/disk_drive.json @@ -8,5 +8,6 @@ "has_the_recipe": {"conditions": {"recipe": "computercraft:disk_drive"}, "trigger": "minecraft:recipe_unlocked"} }, "requirements": [["has_computer", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:disk_drive"]} + "rewards": {"recipes": ["computercraft:disk_drive"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/monitor_advanced.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/monitor_advanced.json index 7fc8c04f4..9c3d1dcbd 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/monitor_advanced.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/monitor_advanced.json @@ -11,5 +11,6 @@ } }, "requirements": [["has_computer", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:monitor_advanced"]} + "rewards": {"recipes": ["computercraft:monitor_advanced"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/monitor_normal.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/monitor_normal.json index 54c4ca3e6..52a1f2388 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/monitor_normal.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/monitor_normal.json @@ -11,5 +11,6 @@ } }, "requirements": [["has_computer", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:monitor_normal"]} + "rewards": {"recipes": ["computercraft:monitor_normal"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_advanced/computercraft/speaker.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_advanced/computercraft/speaker.json index a140b16db..1bc6a18f6 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_advanced/computercraft/speaker.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_advanced/computercraft/speaker.json @@ -13,5 +13,6 @@ } }, "requirements": [["has_items", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:pocket_advanced/computercraft/speaker"]} + "rewards": {"recipes": ["computercraft:pocket_advanced/computercraft/speaker"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_advanced/computercraft/wireless_modem_advanced.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_advanced/computercraft/wireless_modem_advanced.json index a7b7f80f0..ec0ca1356 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_advanced/computercraft/wireless_modem_advanced.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_advanced/computercraft/wireless_modem_advanced.json @@ -16,5 +16,6 @@ } }, "requirements": [["has_items", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:pocket_advanced/computercraft/wireless_modem_advanced"]} + "rewards": {"recipes": ["computercraft:pocket_advanced/computercraft/wireless_modem_advanced"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_advanced/computercraft/wireless_modem_normal.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_advanced/computercraft/wireless_modem_normal.json index 1e256df89..e7c84103d 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_advanced/computercraft/wireless_modem_normal.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_advanced/computercraft/wireless_modem_normal.json @@ -16,5 +16,6 @@ } }, "requirements": [["has_items", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:pocket_advanced/computercraft/wireless_modem_normal"]} + "rewards": {"recipes": ["computercraft:pocket_advanced/computercraft/wireless_modem_normal"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_computer_advanced.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_computer_advanced.json index 43ddc1ffe..906548693 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_computer_advanced.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_computer_advanced.json @@ -15,5 +15,6 @@ } }, "requirements": [["has_computer", "has_apple", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:pocket_computer_advanced"]} + "rewards": {"recipes": ["computercraft:pocket_computer_advanced"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_computer_advanced_upgrade.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_computer_advanced_upgrade.json index 4d3e3e4ed..fcada4d59 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_computer_advanced_upgrade.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_computer_advanced_upgrade.json @@ -13,5 +13,6 @@ } }, "requirements": [["has_components", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:pocket_computer_advanced_upgrade"]} + "rewards": {"recipes": ["computercraft:pocket_computer_advanced_upgrade"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_computer_normal.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_computer_normal.json index d471e5d8c..5dcd29e99 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_computer_normal.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_computer_normal.json @@ -15,5 +15,6 @@ } }, "requirements": [["has_computer", "has_apple", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:pocket_computer_normal"]} + "rewards": {"recipes": ["computercraft:pocket_computer_normal"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_normal/computercraft/speaker.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_normal/computercraft/speaker.json index 336423ac1..615d3e25f 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_normal/computercraft/speaker.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_normal/computercraft/speaker.json @@ -13,5 +13,6 @@ } }, "requirements": [["has_items", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:pocket_normal/computercraft/speaker"]} + "rewards": {"recipes": ["computercraft:pocket_normal/computercraft/speaker"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_normal/computercraft/wireless_modem_advanced.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_normal/computercraft/wireless_modem_advanced.json index 4f05e22e5..2f4085006 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_normal/computercraft/wireless_modem_advanced.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_normal/computercraft/wireless_modem_advanced.json @@ -16,5 +16,6 @@ } }, "requirements": [["has_items", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:pocket_normal/computercraft/wireless_modem_advanced"]} + "rewards": {"recipes": ["computercraft:pocket_normal/computercraft/wireless_modem_advanced"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_normal/computercraft/wireless_modem_normal.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_normal/computercraft/wireless_modem_normal.json index 488075e42..491fd13dd 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_normal/computercraft/wireless_modem_normal.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/pocket_normal/computercraft/wireless_modem_normal.json @@ -16,5 +16,6 @@ } }, "requirements": [["has_items", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:pocket_normal/computercraft/wireless_modem_normal"]} + "rewards": {"recipes": ["computercraft:pocket_normal/computercraft/wireless_modem_normal"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/printed_book.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/printed_book.json index ab5743fa3..67a2ed56a 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/printed_book.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/printed_book.json @@ -11,5 +11,6 @@ } }, "requirements": [["has_printer", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:printed_book"]} + "rewards": {"recipes": ["computercraft:printed_book"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/printed_pages.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/printed_pages.json index 7ee19a946..4c2115c9e 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/printed_pages.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/printed_pages.json @@ -11,5 +11,6 @@ } }, "requirements": [["has_printer", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:printed_pages"]} + "rewards": {"recipes": ["computercraft:printed_pages"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/printer.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/printer.json index 7760559b5..53794f510 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/printer.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/printer.json @@ -8,5 +8,6 @@ "has_the_recipe": {"conditions": {"recipe": "computercraft:printer"}, "trigger": "minecraft:recipe_unlocked"} }, "requirements": [["has_computer", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:printer"]} + "rewards": {"recipes": ["computercraft:printer"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/speaker.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/speaker.json index a4cfa68a3..c4af541b6 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/speaker.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/speaker.json @@ -8,5 +8,6 @@ "has_the_recipe": {"conditions": {"recipe": "computercraft:speaker"}, "trigger": "minecraft:recipe_unlocked"} }, "requirements": [["has_computer", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:speaker"]} + "rewards": {"recipes": ["computercraft:speaker"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced.json index 25ddb95fd..1fe46c9b6 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced.json @@ -11,5 +11,6 @@ } }, "requirements": [["has_computer", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:turtle_advanced"]} + "rewards": {"recipes": ["computercraft:turtle_advanced"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/computercraft/speaker.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/computercraft/speaker.json index fe5ecf99f..e593bbe53 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/computercraft/speaker.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/computercraft/speaker.json @@ -13,5 +13,6 @@ } }, "requirements": [["has_items", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:turtle_advanced/computercraft/speaker"]} + "rewards": {"recipes": ["computercraft:turtle_advanced/computercraft/speaker"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/computercraft/wireless_modem_advanced.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/computercraft/wireless_modem_advanced.json index c987dd29d..464eff645 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/computercraft/wireless_modem_advanced.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/computercraft/wireless_modem_advanced.json @@ -16,5 +16,6 @@ } }, "requirements": [["has_items", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:turtle_advanced/computercraft/wireless_modem_advanced"]} + "rewards": {"recipes": ["computercraft:turtle_advanced/computercraft/wireless_modem_advanced"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/computercraft/wireless_modem_normal.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/computercraft/wireless_modem_normal.json index 0b7325811..d5ba842ea 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/computercraft/wireless_modem_normal.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/computercraft/wireless_modem_normal.json @@ -16,5 +16,6 @@ } }, "requirements": [["has_items", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:turtle_advanced/computercraft/wireless_modem_normal"]} + "rewards": {"recipes": ["computercraft:turtle_advanced/computercraft/wireless_modem_normal"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/minecraft/crafting_table.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/minecraft/crafting_table.json index 4ec2f683b..8e5349225 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/minecraft/crafting_table.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/minecraft/crafting_table.json @@ -13,5 +13,6 @@ } }, "requirements": [["has_items", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:turtle_advanced/minecraft/crafting_table"]} + "rewards": {"recipes": ["computercraft:turtle_advanced/minecraft/crafting_table"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/minecraft/diamond_axe.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/minecraft/diamond_axe.json index e59726271..7d16aeb75 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/minecraft/diamond_axe.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/minecraft/diamond_axe.json @@ -13,5 +13,6 @@ } }, "requirements": [["has_items", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:turtle_advanced/minecraft/diamond_axe"]} + "rewards": {"recipes": ["computercraft:turtle_advanced/minecraft/diamond_axe"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/minecraft/diamond_hoe.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/minecraft/diamond_hoe.json index 458c5e577..4fc20015c 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/minecraft/diamond_hoe.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/minecraft/diamond_hoe.json @@ -13,5 +13,6 @@ } }, "requirements": [["has_items", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:turtle_advanced/minecraft/diamond_hoe"]} + "rewards": {"recipes": ["computercraft:turtle_advanced/minecraft/diamond_hoe"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/minecraft/diamond_pickaxe.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/minecraft/diamond_pickaxe.json index ed390b830..7a70fc554 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/minecraft/diamond_pickaxe.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/minecraft/diamond_pickaxe.json @@ -13,5 +13,6 @@ } }, "requirements": [["has_items", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:turtle_advanced/minecraft/diamond_pickaxe"]} + "rewards": {"recipes": ["computercraft:turtle_advanced/minecraft/diamond_pickaxe"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/minecraft/diamond_shovel.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/minecraft/diamond_shovel.json index d9d643ce4..89be37705 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/minecraft/diamond_shovel.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/minecraft/diamond_shovel.json @@ -13,5 +13,6 @@ } }, "requirements": [["has_items", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:turtle_advanced/minecraft/diamond_shovel"]} + "rewards": {"recipes": ["computercraft:turtle_advanced/minecraft/diamond_shovel"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/minecraft/diamond_sword.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/minecraft/diamond_sword.json index 095ab5657..94706972b 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/minecraft/diamond_sword.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced/minecraft/diamond_sword.json @@ -13,5 +13,6 @@ } }, "requirements": [["has_items", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:turtle_advanced/minecraft/diamond_sword"]} + "rewards": {"recipes": ["computercraft:turtle_advanced/minecraft/diamond_sword"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced_overlays/turtle_rainbow_overlay.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced_overlays/turtle_rainbow_overlay.json index f130b5bde..0e19932c6 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced_overlays/turtle_rainbow_overlay.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced_overlays/turtle_rainbow_overlay.json @@ -12,5 +12,6 @@ } }, "requirements": [["has_turtle", "has_dye", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:turtle_advanced_overlays/turtle_rainbow_overlay"]} + "rewards": {"recipes": ["computercraft:turtle_advanced_overlays/turtle_rainbow_overlay"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced_overlays/turtle_trans_overlay.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced_overlays/turtle_trans_overlay.json index 012b9ce3a..05d0d2132 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced_overlays/turtle_trans_overlay.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced_overlays/turtle_trans_overlay.json @@ -12,5 +12,6 @@ } }, "requirements": [["has_turtle", "has_dye", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:turtle_advanced_overlays/turtle_trans_overlay"]} + "rewards": {"recipes": ["computercraft:turtle_advanced_overlays/turtle_trans_overlay"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced_upgrade.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced_upgrade.json index b7b683a03..5ddd9c9cb 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced_upgrade.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_advanced_upgrade.json @@ -11,5 +11,6 @@ } }, "requirements": [["has_components", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:turtle_advanced_upgrade"]} + "rewards": {"recipes": ["computercraft:turtle_advanced_upgrade"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal.json index 61e6213cc..168e8a9e9 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal.json @@ -11,5 +11,6 @@ } }, "requirements": [["has_computer", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:turtle_normal"]} + "rewards": {"recipes": ["computercraft:turtle_normal"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/computercraft/speaker.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/computercraft/speaker.json index 3559d8032..de0d7cdd7 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/computercraft/speaker.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/computercraft/speaker.json @@ -13,5 +13,6 @@ } }, "requirements": [["has_items", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:turtle_normal/computercraft/speaker"]} + "rewards": {"recipes": ["computercraft:turtle_normal/computercraft/speaker"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/computercraft/wireless_modem_advanced.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/computercraft/wireless_modem_advanced.json index 1c8fdf045..b89ee1be9 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/computercraft/wireless_modem_advanced.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/computercraft/wireless_modem_advanced.json @@ -16,5 +16,6 @@ } }, "requirements": [["has_items", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:turtle_normal/computercraft/wireless_modem_advanced"]} + "rewards": {"recipes": ["computercraft:turtle_normal/computercraft/wireless_modem_advanced"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/computercraft/wireless_modem_normal.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/computercraft/wireless_modem_normal.json index dd96c072f..637cc592f 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/computercraft/wireless_modem_normal.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/computercraft/wireless_modem_normal.json @@ -16,5 +16,6 @@ } }, "requirements": [["has_items", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:turtle_normal/computercraft/wireless_modem_normal"]} + "rewards": {"recipes": ["computercraft:turtle_normal/computercraft/wireless_modem_normal"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/minecraft/crafting_table.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/minecraft/crafting_table.json index ad5023dab..495259756 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/minecraft/crafting_table.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/minecraft/crafting_table.json @@ -13,5 +13,6 @@ } }, "requirements": [["has_items", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:turtle_normal/minecraft/crafting_table"]} + "rewards": {"recipes": ["computercraft:turtle_normal/minecraft/crafting_table"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/minecraft/diamond_axe.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/minecraft/diamond_axe.json index af5bc1f06..89be86b62 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/minecraft/diamond_axe.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/minecraft/diamond_axe.json @@ -13,5 +13,6 @@ } }, "requirements": [["has_items", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:turtle_normal/minecraft/diamond_axe"]} + "rewards": {"recipes": ["computercraft:turtle_normal/minecraft/diamond_axe"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/minecraft/diamond_hoe.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/minecraft/diamond_hoe.json index 72733b768..a2799e005 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/minecraft/diamond_hoe.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/minecraft/diamond_hoe.json @@ -13,5 +13,6 @@ } }, "requirements": [["has_items", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:turtle_normal/minecraft/diamond_hoe"]} + "rewards": {"recipes": ["computercraft:turtle_normal/minecraft/diamond_hoe"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/minecraft/diamond_pickaxe.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/minecraft/diamond_pickaxe.json index 2b64875f6..955d05e97 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/minecraft/diamond_pickaxe.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/minecraft/diamond_pickaxe.json @@ -13,5 +13,6 @@ } }, "requirements": [["has_items", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:turtle_normal/minecraft/diamond_pickaxe"]} + "rewards": {"recipes": ["computercraft:turtle_normal/minecraft/diamond_pickaxe"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/minecraft/diamond_shovel.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/minecraft/diamond_shovel.json index 2df36f6ec..1d8f6d79b 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/minecraft/diamond_shovel.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/minecraft/diamond_shovel.json @@ -13,5 +13,6 @@ } }, "requirements": [["has_items", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:turtle_normal/minecraft/diamond_shovel"]} + "rewards": {"recipes": ["computercraft:turtle_normal/minecraft/diamond_shovel"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/minecraft/diamond_sword.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/minecraft/diamond_sword.json index 38ca7d929..e328d63ad 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/minecraft/diamond_sword.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal/minecraft/diamond_sword.json @@ -13,5 +13,6 @@ } }, "requirements": [["has_items", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:turtle_normal/minecraft/diamond_sword"]} + "rewards": {"recipes": ["computercraft:turtle_normal/minecraft/diamond_sword"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal_overlays/turtle_rainbow_overlay.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal_overlays/turtle_rainbow_overlay.json index a6375ccdf..c203f39a2 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal_overlays/turtle_rainbow_overlay.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal_overlays/turtle_rainbow_overlay.json @@ -12,5 +12,6 @@ } }, "requirements": [["has_turtle", "has_dye", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:turtle_normal_overlays/turtle_rainbow_overlay"]} + "rewards": {"recipes": ["computercraft:turtle_normal_overlays/turtle_rainbow_overlay"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal_overlays/turtle_trans_overlay.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal_overlays/turtle_trans_overlay.json index 93e9b00b8..88287c43c 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal_overlays/turtle_trans_overlay.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/turtle_normal_overlays/turtle_trans_overlay.json @@ -12,5 +12,6 @@ } }, "requirements": [["has_turtle", "has_dye", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:turtle_normal_overlays/turtle_trans_overlay"]} + "rewards": {"recipes": ["computercraft:turtle_normal_overlays/turtle_trans_overlay"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/wired_modem.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/wired_modem.json index 84150e066..15d106669 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/wired_modem.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/wired_modem.json @@ -15,5 +15,6 @@ } }, "requirements": [["has_computer", "has_cable", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:wired_modem"]} + "rewards": {"recipes": ["computercraft:wired_modem"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/wired_modem_full_from.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/wired_modem_full_from.json index c01263d50..c6f39a9db 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/wired_modem_full_from.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/wired_modem_full_from.json @@ -11,5 +11,6 @@ } }, "requirements": [["has_modem", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:wired_modem_full_from"]} + "rewards": {"recipes": ["computercraft:wired_modem_full_from"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/wired_modem_full_to.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/wired_modem_full_to.json index bbf3d594d..4250a54af 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/wired_modem_full_to.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/wired_modem_full_to.json @@ -11,5 +11,6 @@ } }, "requirements": [["has_modem", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:wired_modem_full_to"]} + "rewards": {"recipes": ["computercraft:wired_modem_full_to"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/wireless_modem_advanced.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/wireless_modem_advanced.json index bde8f9ab0..a79d740a6 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/wireless_modem_advanced.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/wireless_modem_advanced.json @@ -15,5 +15,6 @@ } }, "requirements": [["has_computer", "has_wireless", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:wireless_modem_advanced"]} + "rewards": {"recipes": ["computercraft:wireless_modem_advanced"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/wireless_modem_normal.json b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/wireless_modem_normal.json index 69165dfde..f404da1b7 100644 --- a/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/wireless_modem_normal.json +++ b/projects/forge/src/generated/resources/data/computercraft/advancements/recipes/redstone/wireless_modem_normal.json @@ -11,5 +11,6 @@ } }, "requirements": [["has_computer", "has_the_recipe"]], - "rewards": {"recipes": ["computercraft:wireless_modem_normal"]} + "rewards": {"recipes": ["computercraft:wireless_modem_normal"]}, + "sends_telemetry_event": false } diff --git a/projects/forge/src/generated/resources/data/computercraft/loot_modifiers/treasure_disk.json b/projects/forge/src/generated/resources/data/computercraft/loot_modifiers/treasure_disk.json new file mode 100644 index 000000000..2a9d2b225 --- /dev/null +++ b/projects/forge/src/generated/resources/data/computercraft/loot_modifiers/treasure_disk.json @@ -0,0 +1,21 @@ +{ + "type": "computercraft:inject_loot_table", + "conditions": [ + { + "condition": "minecraft:any_of", + "terms": [ + {"condition": "forge:loot_table_id", "loot_table_id": "minecraft:chests/simple_dungeon"}, + {"condition": "forge:loot_table_id", "loot_table_id": "minecraft:chests/abandoned_mineshaft"}, + {"condition": "forge:loot_table_id", "loot_table_id": "minecraft:chests/stronghold_corridor"}, + {"condition": "forge:loot_table_id", "loot_table_id": "minecraft:chests/woodland_mansion"}, + {"condition": "forge:loot_table_id", "loot_table_id": "minecraft:chests/stronghold_library"}, + {"condition": "forge:loot_table_id", "loot_table_id": "minecraft:chests/stronghold_crossing"}, + {"condition": "forge:loot_table_id", "loot_table_id": "minecraft:chests/desert_pyramid"}, + {"condition": "forge:loot_table_id", "loot_table_id": "minecraft:chests/jungle_temple"}, + {"condition": "forge:loot_table_id", "loot_table_id": "minecraft:chests/igloo_chest"}, + {"condition": "forge:loot_table_id", "loot_table_id": "minecraft:chests/village/village_cartographer"} + ] + } + ], + "loot_table": "computercraft:treasure_disk" +} diff --git a/projects/forge/src/generated/resources/data/computercraft/loot_tables/blocks/cable.json b/projects/forge/src/generated/resources/data/computercraft/loot_tables/blocks/cable.json index 3095afc7c..bcb2c7dcd 100644 --- a/projects/forge/src/generated/resources/data/computercraft/loot_tables/blocks/cable.json +++ b/projects/forge/src/generated/resources/data/computercraft/loot_tables/blocks/cable.json @@ -30,5 +30,6 @@ "entries": [{"type": "minecraft:item", "name": "computercraft:wired_modem"}], "rolls": 1.0 } - ] + ], + "random_sequence": "computercraft:blocks/cable" } diff --git a/projects/forge/src/generated/resources/data/computercraft/loot_tables/blocks/computer_advanced.json b/projects/forge/src/generated/resources/data/computercraft/loot_tables/blocks/computer_advanced.json index cfeeb00d0..77bfc5d10 100644 --- a/projects/forge/src/generated/resources/data/computercraft/loot_tables/blocks/computer_advanced.json +++ b/projects/forge/src/generated/resources/data/computercraft/loot_tables/blocks/computer_advanced.json @@ -5,7 +5,7 @@ "bonus_rolls": 0.0, "conditions": [ { - "condition": "minecraft:alternative", + "condition": "minecraft:any_of", "terms": [ {"condition": "computercraft:block_named"}, {"condition": "computercraft:has_id"}, @@ -16,5 +16,6 @@ "entries": [{"type": "minecraft:dynamic", "name": "computercraft:computer"}], "rolls": 1.0 } - ] + ], + "random_sequence": "computercraft:blocks/computer_advanced" } diff --git a/projects/forge/src/generated/resources/data/computercraft/loot_tables/blocks/computer_command.json b/projects/forge/src/generated/resources/data/computercraft/loot_tables/blocks/computer_command.json index cfeeb00d0..1b154f86e 100644 --- a/projects/forge/src/generated/resources/data/computercraft/loot_tables/blocks/computer_command.json +++ b/projects/forge/src/generated/resources/data/computercraft/loot_tables/blocks/computer_command.json @@ -5,7 +5,7 @@ "bonus_rolls": 0.0, "conditions": [ { - "condition": "minecraft:alternative", + "condition": "minecraft:any_of", "terms": [ {"condition": "computercraft:block_named"}, {"condition": "computercraft:has_id"}, @@ -16,5 +16,6 @@ "entries": [{"type": "minecraft:dynamic", "name": "computercraft:computer"}], "rolls": 1.0 } - ] + ], + "random_sequence": "computercraft:blocks/computer_command" } diff --git a/projects/forge/src/generated/resources/data/computercraft/loot_tables/blocks/computer_normal.json b/projects/forge/src/generated/resources/data/computercraft/loot_tables/blocks/computer_normal.json index cfeeb00d0..c772439f2 100644 --- a/projects/forge/src/generated/resources/data/computercraft/loot_tables/blocks/computer_normal.json +++ b/projects/forge/src/generated/resources/data/computercraft/loot_tables/blocks/computer_normal.json @@ -5,7 +5,7 @@ "bonus_rolls": 0.0, "conditions": [ { - "condition": "minecraft:alternative", + "condition": "minecraft:any_of", "terms": [ {"condition": "computercraft:block_named"}, {"condition": "computercraft:has_id"}, @@ -16,5 +16,6 @@ "entries": [{"type": "minecraft:dynamic", "name": "computercraft:computer"}], "rolls": 1.0 } - ] + ], + "random_sequence": "computercraft:blocks/computer_normal" } diff --git a/projects/forge/src/generated/resources/data/computercraft/loot_tables/blocks/disk_drive.json b/projects/forge/src/generated/resources/data/computercraft/loot_tables/blocks/disk_drive.json index 463610e17..7a9abc323 100644 --- a/projects/forge/src/generated/resources/data/computercraft/loot_tables/blocks/disk_drive.json +++ b/projects/forge/src/generated/resources/data/computercraft/loot_tables/blocks/disk_drive.json @@ -13,5 +13,6 @@ ], "rolls": 1.0 } - ] + ], + "random_sequence": "computercraft:blocks/disk_drive" } diff --git a/projects/forge/src/generated/resources/data/computercraft/loot_tables/blocks/monitor_advanced.json b/projects/forge/src/generated/resources/data/computercraft/loot_tables/blocks/monitor_advanced.json index dc41695fc..89866e0d8 100644 --- a/projects/forge/src/generated/resources/data/computercraft/loot_tables/blocks/monitor_advanced.json +++ b/projects/forge/src/generated/resources/data/computercraft/loot_tables/blocks/monitor_advanced.json @@ -7,5 +7,6 @@ "entries": [{"type": "minecraft:item", "name": "computercraft:monitor_advanced"}], "rolls": 1.0 } - ] + ], + "random_sequence": "computercraft:blocks/monitor_advanced" } diff --git a/projects/forge/src/generated/resources/data/computercraft/loot_tables/blocks/monitor_normal.json b/projects/forge/src/generated/resources/data/computercraft/loot_tables/blocks/monitor_normal.json index a82a28db3..2e1d7e3c8 100644 --- a/projects/forge/src/generated/resources/data/computercraft/loot_tables/blocks/monitor_normal.json +++ b/projects/forge/src/generated/resources/data/computercraft/loot_tables/blocks/monitor_normal.json @@ -7,5 +7,6 @@ "entries": [{"type": "minecraft:item", "name": "computercraft:monitor_normal"}], "rolls": 1.0 } - ] + ], + "random_sequence": "computercraft:blocks/monitor_normal" } diff --git a/projects/forge/src/generated/resources/data/computercraft/loot_tables/blocks/printer.json b/projects/forge/src/generated/resources/data/computercraft/loot_tables/blocks/printer.json index 4ca01144d..623e860e6 100644 --- a/projects/forge/src/generated/resources/data/computercraft/loot_tables/blocks/printer.json +++ b/projects/forge/src/generated/resources/data/computercraft/loot_tables/blocks/printer.json @@ -13,5 +13,6 @@ ], "rolls": 1.0 } - ] + ], + "random_sequence": "computercraft:blocks/printer" } diff --git a/projects/forge/src/generated/resources/data/computercraft/loot_tables/blocks/speaker.json b/projects/forge/src/generated/resources/data/computercraft/loot_tables/blocks/speaker.json index cd383f39c..5cde768af 100644 --- a/projects/forge/src/generated/resources/data/computercraft/loot_tables/blocks/speaker.json +++ b/projects/forge/src/generated/resources/data/computercraft/loot_tables/blocks/speaker.json @@ -7,5 +7,6 @@ "entries": [{"type": "minecraft:item", "name": "computercraft:speaker"}], "rolls": 1.0 } - ] + ], + "random_sequence": "computercraft:blocks/speaker" } diff --git a/projects/forge/src/generated/resources/data/computercraft/loot_tables/blocks/turtle_advanced.json b/projects/forge/src/generated/resources/data/computercraft/loot_tables/blocks/turtle_advanced.json index cfeeb00d0..dcf875c5e 100644 --- a/projects/forge/src/generated/resources/data/computercraft/loot_tables/blocks/turtle_advanced.json +++ b/projects/forge/src/generated/resources/data/computercraft/loot_tables/blocks/turtle_advanced.json @@ -5,7 +5,7 @@ "bonus_rolls": 0.0, "conditions": [ { - "condition": "minecraft:alternative", + "condition": "minecraft:any_of", "terms": [ {"condition": "computercraft:block_named"}, {"condition": "computercraft:has_id"}, @@ -16,5 +16,6 @@ "entries": [{"type": "minecraft:dynamic", "name": "computercraft:computer"}], "rolls": 1.0 } - ] + ], + "random_sequence": "computercraft:blocks/turtle_advanced" } diff --git a/projects/forge/src/generated/resources/data/computercraft/loot_tables/blocks/turtle_normal.json b/projects/forge/src/generated/resources/data/computercraft/loot_tables/blocks/turtle_normal.json index cfeeb00d0..fcb1d6b00 100644 --- a/projects/forge/src/generated/resources/data/computercraft/loot_tables/blocks/turtle_normal.json +++ b/projects/forge/src/generated/resources/data/computercraft/loot_tables/blocks/turtle_normal.json @@ -5,7 +5,7 @@ "bonus_rolls": 0.0, "conditions": [ { - "condition": "minecraft:alternative", + "condition": "minecraft:any_of", "terms": [ {"condition": "computercraft:block_named"}, {"condition": "computercraft:has_id"}, @@ -16,5 +16,6 @@ "entries": [{"type": "minecraft:dynamic", "name": "computercraft:computer"}], "rolls": 1.0 } - ] + ], + "random_sequence": "computercraft:blocks/turtle_normal" } diff --git a/projects/forge/src/generated/resources/data/computercraft/loot_tables/blocks/wired_modem_full.json b/projects/forge/src/generated/resources/data/computercraft/loot_tables/blocks/wired_modem_full.json index 1858357d0..197f1588e 100644 --- a/projects/forge/src/generated/resources/data/computercraft/loot_tables/blocks/wired_modem_full.json +++ b/projects/forge/src/generated/resources/data/computercraft/loot_tables/blocks/wired_modem_full.json @@ -7,5 +7,6 @@ "entries": [{"type": "minecraft:item", "name": "computercraft:wired_modem_full"}], "rolls": 1.0 } - ] + ], + "random_sequence": "computercraft:blocks/wired_modem_full" } diff --git a/projects/forge/src/generated/resources/data/computercraft/loot_tables/blocks/wireless_modem_advanced.json b/projects/forge/src/generated/resources/data/computercraft/loot_tables/blocks/wireless_modem_advanced.json index 3b125e5a7..4a940818e 100644 --- a/projects/forge/src/generated/resources/data/computercraft/loot_tables/blocks/wireless_modem_advanced.json +++ b/projects/forge/src/generated/resources/data/computercraft/loot_tables/blocks/wireless_modem_advanced.json @@ -7,5 +7,6 @@ "entries": [{"type": "minecraft:item", "name": "computercraft:wireless_modem_advanced"}], "rolls": 1.0 } - ] + ], + "random_sequence": "computercraft:blocks/wireless_modem_advanced" } diff --git a/projects/forge/src/generated/resources/data/computercraft/loot_tables/blocks/wireless_modem_normal.json b/projects/forge/src/generated/resources/data/computercraft/loot_tables/blocks/wireless_modem_normal.json index 071f48592..5e9bbfc9f 100644 --- a/projects/forge/src/generated/resources/data/computercraft/loot_tables/blocks/wireless_modem_normal.json +++ b/projects/forge/src/generated/resources/data/computercraft/loot_tables/blocks/wireless_modem_normal.json @@ -7,5 +7,6 @@ "entries": [{"type": "minecraft:item", "name": "computercraft:wireless_modem_normal"}], "rolls": 1.0 } - ] + ], + "random_sequence": "computercraft:blocks/wireless_modem_normal" } diff --git a/projects/forge/src/generated/resources/data/computercraft/loot_tables/treasure_disk.json b/projects/forge/src/generated/resources/data/computercraft/loot_tables/treasure_disk.json index 0967ef424..8fa406ced 100644 --- a/projects/forge/src/generated/resources/data/computercraft/loot_tables/treasure_disk.json +++ b/projects/forge/src/generated/resources/data/computercraft/loot_tables/treasure_disk.json @@ -1 +1 @@ -{} +{"random_sequence": "computercraft:treasure_disk"} diff --git a/projects/forge/src/generated/resources/data/forge/loot_modifiers/global_loot_modifiers.json b/projects/forge/src/generated/resources/data/forge/loot_modifiers/global_loot_modifiers.json new file mode 100644 index 000000000..e94aa6173 --- /dev/null +++ b/projects/forge/src/generated/resources/data/forge/loot_modifiers/global_loot_modifiers.json @@ -0,0 +1 @@ +{"entries": ["computercraft:treasure_disk"], "replace": false} diff --git a/projects/forge/src/main/java/dan200/computercraft/ComputerCraft.java b/projects/forge/src/main/java/dan200/computercraft/ComputerCraft.java index b47f39772..735b68c35 100644 --- a/projects/forge/src/main/java/dan200/computercraft/ComputerCraft.java +++ b/projects/forge/src/main/java/dan200/computercraft/ComputerCraft.java @@ -12,6 +12,7 @@ import dan200.computercraft.api.network.wired.WiredElement; import dan200.computercraft.api.peripheral.IPeripheral; import dan200.computercraft.api.pocket.PocketUpgradeSerialiser; import dan200.computercraft.api.turtle.TurtleUpgradeSerialiser; +import dan200.computercraft.shared.ForgeModRegistry; import dan200.computercraft.shared.ModRegistry; import dan200.computercraft.shared.config.ConfigSpec; import dan200.computercraft.shared.details.FluidData; @@ -20,10 +21,8 @@ import dan200.computercraft.shared.peripheral.generic.methods.FluidMethods; import dan200.computercraft.shared.peripheral.generic.methods.InventoryMethods; import dan200.computercraft.shared.platform.ForgeConfigFile; import dan200.computercraft.shared.platform.NetworkHandler; -import net.minecraft.resources.ResourceLocation; import net.minecraftforge.common.capabilities.ForgeCapabilities; import net.minecraftforge.common.capabilities.RegisterCapabilitiesEvent; -import net.minecraftforge.event.CreativeModeTabEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.ModLoadingContext; import net.minecraftforge.fml.common.Mod; @@ -38,6 +37,7 @@ import net.minecraftforge.registries.RegistryBuilder; public final class ComputerCraft { public ComputerCraft() { ModRegistry.register(); + ForgeModRegistry.register(); ModLoadingContext.get().registerConfig(ModConfig.Type.SERVER, ((ForgeConfigFile) ConfigSpec.serverSpec).spec()); ModLoadingContext.get().registerConfig(ModConfig.Type.CLIENT, ((ForgeConfigFile) ConfigSpec.clientSpec).spec()); @@ -62,11 +62,6 @@ public final class ComputerCraft { event.register(IPeripheral.class); } - @SubscribeEvent - public static void registerCreativeTab(CreativeModeTabEvent.Register event) { - event.registerCreativeModeTab(new ResourceLocation(ComputerCraftAPI.MOD_ID, "tab"), ModRegistry::registerCreativeTab); - } - @SubscribeEvent public static void init(FMLCommonSetupEvent event) { event.enqueueWork(ModRegistry::registerMainThread); diff --git a/projects/forge/src/main/java/dan200/computercraft/data/Generators.java b/projects/forge/src/main/java/dan200/computercraft/data/Generators.java index 840ae1acd..08a72d4ca 100644 --- a/projects/forge/src/main/java/dan200/computercraft/data/Generators.java +++ b/projects/forge/src/main/java/dan200/computercraft/data/Generators.java @@ -34,6 +34,8 @@ public class Generators { public static void gather(GatherDataEvent event) { var generator = event.getGenerator(); DataProviders.add(new GeneratorFactoryImpl(generator.getVanillaPack(true), event.getExistingFileHelper(), event.getLookupProvider())); + + generator.addProvider(event.includeServer(), LootModifierProvider::new); } private record GeneratorFactoryImpl( diff --git a/projects/forge/src/main/java/dan200/computercraft/data/LootModifierProvider.java b/projects/forge/src/main/java/dan200/computercraft/data/LootModifierProvider.java new file mode 100644 index 000000000..25d6f6f68 --- /dev/null +++ b/projects/forge/src/main/java/dan200/computercraft/data/LootModifierProvider.java @@ -0,0 +1,32 @@ +// SPDX-FileCopyrightText: 2023 The CC: Tweaked Developers +// +// SPDX-License-Identifier: MPL-2.0 + +package dan200.computercraft.data; + +import dan200.computercraft.api.ComputerCraftAPI; +import dan200.computercraft.shared.CommonHooks; +import dan200.computercraft.shared.loot.InjectLootTableModifier; +import net.minecraft.data.PackOutput; +import net.minecraft.world.level.storage.loot.predicates.AnyOfCondition; +import net.minecraft.world.level.storage.loot.predicates.LootItemCondition; +import net.minecraftforge.common.data.GlobalLootModifierProvider; +import net.minecraftforge.common.loot.LootTableIdCondition; + +final class LootModifierProvider extends GlobalLootModifierProvider { + LootModifierProvider(PackOutput output) { + super(output, ComputerCraftAPI.MOD_ID); + } + + @Override + protected void start() { + add("treasure_disk", new InjectLootTableModifier( + new LootItemCondition[]{ + AnyOfCondition.anyOf( + CommonHooks.TREASURE_DISK_LOOT_TABLES.stream().map(LootTableIdCondition::builder).toArray(LootItemCondition.Builder[]::new) + ).build(), + }, + CommonHooks.TREASURE_DISK_LOOT + )); + } +} 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 d5f1a4ed5..dc8c01740 100644 --- a/projects/forge/src/main/java/dan200/computercraft/shared/ForgeCommonHooks.java +++ b/projects/forge/src/main/java/dan200/computercraft/shared/ForgeCommonHooks.java @@ -138,12 +138,6 @@ public class ForgeCommonHooks { } } - @SubscribeEvent - public static void lootLoad(LootTableLoadEvent event) { - var pool = CommonHooks.getExtraLootPool(event.getName()); - if (pool != null) event.getTable().addPool(pool.build()); - } - @SubscribeEvent(priority = EventPriority.HIGHEST) public static void onEntitySpawn(EntityJoinLevelEvent event) { if (CommonHooks.onEntitySpawn(event.getEntity())) event.setCanceled(true); diff --git a/projects/forge/src/main/java/dan200/computercraft/shared/ForgeModRegistry.java b/projects/forge/src/main/java/dan200/computercraft/shared/ForgeModRegistry.java new file mode 100644 index 000000000..fcbff73b2 --- /dev/null +++ b/projects/forge/src/main/java/dan200/computercraft/shared/ForgeModRegistry.java @@ -0,0 +1,31 @@ +// SPDX-FileCopyrightText: 2023 The CC: Tweaked Developers +// +// SPDX-License-Identifier: MPL-2.0 + +package dan200.computercraft.shared; + +import com.mojang.serialization.Codec; +import dan200.computercraft.shared.loot.InjectLootTableModifier; +import dan200.computercraft.shared.platform.PlatformHelper; +import dan200.computercraft.shared.platform.RegistrationHelper; +import dan200.computercraft.shared.platform.RegistryEntry; +import net.minecraftforge.common.loot.IGlobalLootModifier; +import net.minecraftforge.registries.ForgeRegistries; + +/** + * {@link ModRegistry} equivalent for Forge-specific content. + */ +public final class ForgeModRegistry { + private ForgeModRegistry() { + } + + public static final class Codecs { + static final RegistrationHelper> REGISTRY = PlatformHelper.get().createRegistrationHelper(ForgeRegistries.Keys.GLOBAL_LOOT_MODIFIER_SERIALIZERS); + + public static final RegistryEntry> INJECT_LOOT_TABLE = REGISTRY.register("inject_loot_table", InjectLootTableModifier::createCodec); + } + + public static void register() { + Codecs.REGISTRY.register(); + } +} diff --git a/projects/forge/src/main/java/dan200/computercraft/shared/loot/InjectLootTableModifier.java b/projects/forge/src/main/java/dan200/computercraft/shared/loot/InjectLootTableModifier.java new file mode 100644 index 000000000..0bf46f8c6 --- /dev/null +++ b/projects/forge/src/main/java/dan200/computercraft/shared/loot/InjectLootTableModifier.java @@ -0,0 +1,45 @@ +// SPDX-FileCopyrightText: 2023 The CC: Tweaked Developers +// +// SPDX-License-Identifier: MPL-2.0 + +package dan200.computercraft.shared.loot; + +import com.mojang.serialization.Codec; +import com.mojang.serialization.codecs.RecordCodecBuilder; +import dan200.computercraft.shared.ForgeModRegistry; +import it.unimi.dsi.fastutil.objects.ObjectArrayList; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.storage.loot.LootContext; +import net.minecraft.world.level.storage.loot.predicates.LootItemCondition; +import net.minecraftforge.common.loot.LootModifier; + +/** + * A {@link LootModifier} which adds a new loot pool to a piece of loot. + */ +public final class InjectLootTableModifier extends LootModifier { + private final ResourceLocation location; + + public InjectLootTableModifier(LootItemCondition[] conditionsIn, ResourceLocation location) { + super(conditionsIn); + this.location = location; + } + + public static Codec createCodec() { + return RecordCodecBuilder.create(inst -> LootModifier.codecStart(inst).and( + ResourceLocation.CODEC.fieldOf("loot_table").forGetter(m -> m.location) + ).apply(inst, InjectLootTableModifier::new) + ); + } + + @Override + protected ObjectArrayList doApply(ObjectArrayList generatedLoot, LootContext context) { + context.getResolver().getLootTable(location).getRandomItemsRaw(context, generatedLoot::add); + return generatedLoot; + } + + @Override + public Codec codec() { + return ForgeModRegistry.Codecs.INJECT_LOOT_TABLE.get(); + } +} diff --git a/projects/forge/src/main/java/dan200/computercraft/shared/platform/PlatformHelperImpl.java b/projects/forge/src/main/java/dan200/computercraft/shared/platform/PlatformHelperImpl.java index 250ccbc2d..816d21890 100644 --- a/projects/forge/src/main/java/dan200/computercraft/shared/platform/PlatformHelperImpl.java +++ b/projects/forge/src/main/java/dan200/computercraft/shared/platform/PlatformHelperImpl.java @@ -52,7 +52,6 @@ import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.chunk.LevelChunk; import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.Vec3; -import net.minecraftforge.common.CreativeModeTabRegistry; import net.minecraftforge.common.ForgeHooks; import net.minecraftforge.common.Tags; import net.minecraftforge.common.ToolActions; @@ -258,10 +257,10 @@ public class PlatformHelperImpl implements PlatformHelper { return ForgeHooks.getBurnTime(stack, null); } - @Nullable + @Override - public ResourceLocation getCreativeTabId(CreativeModeTab tab) { - return CreativeModeTabRegistry.getName(tab); + public CreativeModeTab.Builder newCreativeModeTab() { + return CreativeModeTab.builder(); } @Override @@ -321,7 +320,7 @@ public class PlatformHelperImpl implements PlatformHelper { @Override public InteractionResult useOn(ServerPlayer player, ItemStack stack, BlockHitResult hit, Predicate canUseBlock) { - var level = player.level; + var level = player.level(); var pos = hit.getBlockPos(); var event = ForgeHooks.onRightClickBlock(player, InteractionHand.MAIN_HAND, pos, hit); if (event.isCanceled()) return event.getCancellationResult(); diff --git a/projects/forge/src/main/resources/META-INF/mods.toml b/projects/forge/src/main/resources/META-INF/mods.toml index be5f02660..0cc783c02 100644 --- a/projects/forge/src/main/resources/META-INF/mods.toml +++ b/projects/forge/src/main/resources/META-INF/mods.toml @@ -3,7 +3,7 @@ # SPDX-License-Identifier: MPL-2.0 modLoader="javafml" -loaderVersion="[45,46)" +loaderVersion="[46,47)" issueTrackerURL="https://github.com/cc-tweaked/CC-Tweaked/issues" logoFile="pack.png" @@ -26,6 +26,6 @@ CC: Tweaked is a fork of ComputerCraft, adding programmable computers, turtles a [[dependencies.computercraft]] modId="forge" mandatory=true - versionRange="[${forgeVersion},46)" + versionRange="[${forgeVersion},47)" ordering="NONE" side="BOTH"