diff --git a/patchwork-god-classes/README.md b/patchwork-god-classes/README.md new file mode 100644 index 00000000..2d17ec0e --- /dev/null +++ b/patchwork-god-classes/README.md @@ -0,0 +1,12 @@ +# patchwork-god-classes + +Implementation of ForgeHooks, ForgeHooksClient, ForgeEventFactory, and BasicEventHooks that dispatches to different patchwork modules. + +## Reasoning + +Forge uses these classes from inside their patches in order to keep the size of their patches down. +Patchwork keeps its hooks seperated between modules, however, some mods also use these classes. +Therefore, this module exists to dispatch calls to these classes to the disperate modules that actually implement the relevant methods. + +## TODO + * Implement the methods on these classes that are actually already implemented in Patchwork. diff --git a/patchwork-god-classes/build.gradle b/patchwork-god-classes/build.gradle new file mode 100644 index 00000000..843fce7b --- /dev/null +++ b/patchwork-god-classes/build.gradle @@ -0,0 +1,6 @@ +archivesBaseName = "patchwork-god-classes" +version = getSubprojectVersion(project, "0.1.0") + +dependencies { + compile project(path: ':patchwork-fml', configuration: 'dev') +} diff --git a/patchwork-god-classes/src/main/java/net/minecraftforge/client/ForgeHooksClient.java b/patchwork-god-classes/src/main/java/net/minecraftforge/client/ForgeHooksClient.java new file mode 100644 index 00000000..ef6b02e5 --- /dev/null +++ b/patchwork-god-classes/src/main/java/net/minecraftforge/client/ForgeHooksClient.java @@ -0,0 +1,27 @@ +/* + * Minecraft Forge, Patchwork Project + * Copyright (c) 2016-2020, 2019-2020 + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation version 2.1 + * of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +package net.minecraftforge.client; + +/* + * Note: this class is intended for mod use only, to dispatch to the implementations kept in their own modules. + * Do not keep implementation details here, methods should be thin wrappers around methods in other modules. + */ +public class ForgeHooksClient { +} diff --git a/patchwork-god-classes/src/main/java/net/minecraftforge/common/ForgeHooks.java b/patchwork-god-classes/src/main/java/net/minecraftforge/common/ForgeHooks.java new file mode 100644 index 00000000..ed4d8220 --- /dev/null +++ b/patchwork-god-classes/src/main/java/net/minecraftforge/common/ForgeHooks.java @@ -0,0 +1,27 @@ +/* + * Minecraft Forge, Patchwork Project + * Copyright (c) 2016-2020, 2019-2020 + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation version 2.1 + * of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +package net.minecraftforge.common; + +/* + * Note: this class is intended for mod use only, to dispatch to the implementations kept in their own modules. + * Do not keep implementation details here, methods should be thin wrappers around methods in other modules. + */ +public class ForgeHooks { +} diff --git a/patchwork-god-classes/src/main/java/net/minecraftforge/event/ForgeEventFactory.java b/patchwork-god-classes/src/main/java/net/minecraftforge/event/ForgeEventFactory.java new file mode 100644 index 00000000..f9e54a66 --- /dev/null +++ b/patchwork-god-classes/src/main/java/net/minecraftforge/event/ForgeEventFactory.java @@ -0,0 +1,27 @@ +/* + * Minecraft Forge, Patchwork Project + * Copyright (c) 2016-2020, 2019-2020 + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation version 2.1 + * of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +package net.minecraftforge.event; + +/* + * Note: this class is intended for mod use only, to dispatch to the implementations kept in their own modules. + * Do not keep implementation details here, methods should be thin wrappers around methods in other modules. + */ +public class ForgeEventFactory { +} diff --git a/patchwork-god-classes/src/main/java/net/minecraftforge/fml/hooks/BasicEventHooks.java b/patchwork-god-classes/src/main/java/net/minecraftforge/fml/hooks/BasicEventHooks.java new file mode 100644 index 00000000..cf63ab9d --- /dev/null +++ b/patchwork-god-classes/src/main/java/net/minecraftforge/fml/hooks/BasicEventHooks.java @@ -0,0 +1,27 @@ +/* + * Minecraft Forge, Patchwork Project + * Copyright (c) 2016-2020, 2019-2020 + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation version 2.1 + * of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +package net.minecraftforge.fml.hooks; + +/* + * Note: this class is intended for mod use only, to dispatch to the implementations kept in their own modules. + * Do not keep implementation details here, methods should be thin wrappers around methods in other modules. + */ +public class BasicEventHooks { +} diff --git a/patchwork-god-classes/src/main/resources/assets.patchwork-god-classes/icon.png b/patchwork-god-classes/src/main/resources/assets.patchwork-god-classes/icon.png new file mode 100644 index 00000000..de75d2fb Binary files /dev/null and b/patchwork-god-classes/src/main/resources/assets.patchwork-god-classes/icon.png differ diff --git a/patchwork-god-classes/src/main/resources/fabric.mod.json b/patchwork-god-classes/src/main/resources/fabric.mod.json new file mode 100644 index 00000000..b4741cde --- /dev/null +++ b/patchwork-god-classes/src/main/resources/fabric.mod.json @@ -0,0 +1,25 @@ +{ + "schemaVersion": 1, + "id": "patchwork-god-classes", + "name": "Patchwork God Classes", + "version": "${version}", + "description": "Implements ForgeHooks, ForgeEventFactory, and more.", + "environment": "*", + "license": "LGPL-2.1-only", + "icon": "assets/patchwork-god-classes/icon.png", + "contact": { + "issues": "https://github.com/PatchworkMC/patchwork-api/issues", + "sources": "https://github.com/PatchworkMC/patchwork-api" + }, + "authors": [ + "PatchworkMC" + ], + "depends": { + "fabricloader": ">=0.8.4", + "patchwork-fml": "*" + }, + "custom": { + "modmenu:api": true, + "modmenu:parent": "patchwork" + } +} diff --git a/settings.gradle b/settings.gradle index de8499f9..444b4685 100644 --- a/settings.gradle +++ b/settings.gradle @@ -27,6 +27,7 @@ include 'patchwork-extensions-block' include 'patchwork-extensions-item' include 'patchwork-extensions-shearing' include 'patchwork-fml' +include 'patchwork-god-classes' include 'patchwork-gui' include 'patchwork-level-generators' include 'patchwork-loot'