Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

Add the patchwork-god-classes module #127

Merged
merged 2 commits into from
Jul 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions patchwork-god-classes/README.md
Original file line number Diff line number Diff line change
@@ -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.
6 changes: 6 additions & 0 deletions patchwork-god-classes/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
archivesBaseName = "patchwork-god-classes"
version = getSubprojectVersion(project, "0.1.0")

dependencies {
compile project(path: ':patchwork-fml', configuration: 'dev')
}
Original file line number Diff line number Diff line change
@@ -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 {
}
Original file line number Diff line number Diff line change
@@ -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 {
}
Original file line number Diff line number Diff line change
@@ -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 {
}
Original file line number Diff line number Diff line change
@@ -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 {
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions patchwork-god-classes/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down