From e4ef92ca2de6e63ff82e11aea6e4e82dfe777611 Mon Sep 17 00:00:00 2001 From: SquidDev Date: Sat, 30 Mar 2019 16:41:45 +0000 Subject: [PATCH] Expose a stub "cctweaked" mod This is largely invisible (it's marked as a child of the main "computercraft" mod), but allows other mods (such as Plethora) to add hard/soft dependencies on CC:T in a user-friendly manner. --- .../java/dan200/computercraft/CCTweaked.java | 30 +++++++++++++++++++ .../dan200/computercraft/ComputerCraft.java | 6 ++-- src/main/resources/mcmod.info | 16 +++++----- 3 files changed, 43 insertions(+), 9 deletions(-) create mode 100644 src/main/java/dan200/computercraft/CCTweaked.java diff --git a/src/main/java/dan200/computercraft/CCTweaked.java b/src/main/java/dan200/computercraft/CCTweaked.java new file mode 100644 index 000000000..1ee227a4d --- /dev/null +++ b/src/main/java/dan200/computercraft/CCTweaked.java @@ -0,0 +1,30 @@ +/* + * This file is part of ComputerCraft - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2019. Do not distribute without permission. + * Send enquiries to dratcliffe@gmail.com + */ + +package dan200.computercraft; + +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.fml.common.network.NetworkCheckHandler; +import net.minecraftforge.fml.relauncher.Side; + +import java.util.Map; + +/** + * A stub mod for CC: Tweaked. This doesn't have any functionality (everything of note is done in + * {@link ComputerCraft}), but people may depend on this if they require CC: Tweaked functionality. + */ +@Mod( + modid = "cctweaked", name = ComputerCraft.NAME, version = ComputerCraft.VERSION, + acceptableRemoteVersions = "*" +) +public class CCTweaked +{ + @NetworkCheckHandler + public boolean onNetworkConnect( Map mods, Side side ) + { + return true; + } +} diff --git a/src/main/java/dan200/computercraft/ComputerCraft.java b/src/main/java/dan200/computercraft/ComputerCraft.java index e33f317c2..c506d8e3d 100644 --- a/src/main/java/dan200/computercraft/ComputerCraft.java +++ b/src/main/java/dan200/computercraft/ComputerCraft.java @@ -91,13 +91,15 @@ import java.util.zip.ZipFile; @Mod( - modid = ComputerCraft.MOD_ID, name = "CC: Tweaked", version = "${version}", + modid = ComputerCraft.MOD_ID, name = ComputerCraft.NAME, version = ComputerCraft.VERSION, guiFactory = "dan200.computercraft.client.gui.GuiConfigCC$Factory", dependencies = "required:forge@[14.23.4.2746,)" ) public class ComputerCraft { public static final String MOD_ID = "computercraft"; + static final String VERSION = "${version}"; + static final String NAME = "CC: Tweaked"; // Configuration options public static final String[] DEFAULT_HTTP_WHITELIST = new String[] { "*" }; @@ -297,7 +299,7 @@ public void onServerStopped( FMLServerStoppedEvent event ) public static String getVersion() { - return "${version}"; + return VERSION; } private static File getBaseDir() diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index b9f123359..cb0499dd9 100644 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -5,17 +5,19 @@ "version" : "${version}", "mcversion" : "${mcversion}", "url" : "https://github.com/SquidDev-CC/CC-Tweaked", - "credits" : "Created by Daniel Ratcliffe (@DanTwoHundred)", + "credits" : "Initially created by Daniel Ratcliffe (@DanTwoHundred)", "authorList" : [ "Daniel Ratcliffe", "Aaron Mills", "SquidDev" ], - "description" : "CC: Tweaked is a fork of ComputerCraft with a focus on more experimental features.", - "logoFile" : "pack.png", - "updateUrl" : "https://github.com/SquidDev-CC/CC-Tweaked", - "parent" : "", - "screenshots": [ - ] + "description" : "CC: Tweaked is a fork of ComputerCraft, adding programmable computers, turtles and more to Minecraft.", + "logoFile" : "pack.png" + }, + { + "modid" : "cctweaked", + "name" : "CC: Tweaked", + "version" : "${version}", + "parent" : "computercraft" } ]