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

Commit 15b9ca9

Browse files
committed
Add the patchwork-event-dispatcher module
1 parent 63da775 commit 15b9ca9

File tree

9 files changed

+152
-0
lines changed

9 files changed

+152
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# patchwork-event-dispatcher
2+
3+
Implementation of ForgeHooks, ForgeHooksClient, ForgeEventFactory, and BasicEventHooks that dispatches to different patchwork modules.
4+
5+
## Reasoning
6+
7+
Forge uses these classes from inside their patches in order to keep the size of their patches down.
8+
Patchwork keeps its hooks seperated between modules, however, some mods also use these classes.
9+
Therefore, this module exists to dispatch calls to these classes to the disperate modules that actually implement the relevant methods.
10+
11+
## TODO
12+
* Implement the methods on these classes that are actually already implemented in Patchwork.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
archivesBaseName = "patchwork-event-dispatcher"
2+
version = getSubprojectVersion(project, "0.1.0")
3+
4+
dependencies {
5+
compile project(path: ':patchwork-fml', configuration: 'dev')
6+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
* Minecraft Forge, Patchwork Project
3+
* Copyright (c) 2016-2020, 2019-2020
4+
*
5+
* This library is free software; you can redistribute it and/or
6+
* modify it under the terms of the GNU Lesser General Public
7+
* License as published by the Free Software Foundation version 2.1
8+
* of the License.
9+
*
10+
* This library is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13+
* Lesser General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU Lesser General Public
16+
* License along with this library; if not, write to the Free Software
17+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18+
*/
19+
20+
package net.minecraftforge.client;
21+
22+
/*
23+
* Note: this class is intended for mod use only, to dispatch to the implementations kept in their own modules.
24+
* Do not keep implementation details here, methods should be thin wrappers around methods in other modules.
25+
*/
26+
public class ForgeHooksClient {
27+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
* Minecraft Forge, Patchwork Project
3+
* Copyright (c) 2016-2020, 2019-2020
4+
*
5+
* This library is free software; you can redistribute it and/or
6+
* modify it under the terms of the GNU Lesser General Public
7+
* License as published by the Free Software Foundation version 2.1
8+
* of the License.
9+
*
10+
* This library is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13+
* Lesser General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU Lesser General Public
16+
* License along with this library; if not, write to the Free Software
17+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18+
*/
19+
20+
package net.minecraftforge.common;
21+
22+
/*
23+
* Note: this class is intended for mod use only, to dispatch to the implementations kept in their own modules.
24+
* Do not keep implementation details here, methods should be thin wrappers around methods in other modules.
25+
*/
26+
public class ForgeHooks {
27+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
* Minecraft Forge, Patchwork Project
3+
* Copyright (c) 2016-2020, 2019-2020
4+
*
5+
* This library is free software; you can redistribute it and/or
6+
* modify it under the terms of the GNU Lesser General Public
7+
* License as published by the Free Software Foundation version 2.1
8+
* of the License.
9+
*
10+
* This library is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13+
* Lesser General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU Lesser General Public
16+
* License along with this library; if not, write to the Free Software
17+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18+
*/
19+
20+
package net.minecraftforge.event;
21+
22+
/*
23+
* Note: this class is intended for mod use only, to dispatch to the implementations kept in their own modules.
24+
* Do not keep implementation details here, methods should be thin wrappers around methods in other modules.
25+
*/
26+
public class ForgeEventFactory {
27+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
* Minecraft Forge, Patchwork Project
3+
* Copyright (c) 2016-2020, 2019-2020
4+
*
5+
* This library is free software; you can redistribute it and/or
6+
* modify it under the terms of the GNU Lesser General Public
7+
* License as published by the Free Software Foundation version 2.1
8+
* of the License.
9+
*
10+
* This library is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13+
* Lesser General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU Lesser General Public
16+
* License along with this library; if not, write to the Free Software
17+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18+
*/
19+
20+
package net.minecraftforge.fml.hooks;
21+
22+
/*
23+
* Note: this class is intended for mod use only, to dispatch to the implementations kept in their own modules.
24+
* Do not keep implementation details here, methods should be thin wrappers around methods in other modules.
25+
*/
26+
public class BasicEventHooks {
27+
}
22.2 KB
Loading
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"schemaVersion": 1,
3+
"id": "patchwork-event-dispatcher",
4+
"name": "Patchwork Event Dispatcher",
5+
"version": "${version}",
6+
"description": "Implements ForgeHooks, ForgeEventFactory, and more.",
7+
"environment": "*",
8+
"license": "LGPL-2.1-only",
9+
"icon": "assets/patchwork-event-dispatcher/icon.png",
10+
"contact": {
11+
"issues": "https://github.com/PatchworkMC/patchwork-api/issues",
12+
"sources": "https://github.com/PatchworkMC/patchwork-api"
13+
},
14+
"authors": [
15+
"PatchworkMC"
16+
],
17+
"depends": {
18+
"fabricloader": ">=0.8.4",
19+
"patchwork-fml": "*"
20+
},
21+
"custom": {
22+
"modmenu:api": true,
23+
"modmenu:parent": "patchwork"
24+
}
25+
}

settings.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ include 'patchwork-capabilities'
1717
include 'patchwork-data-generators'
1818
include 'patchwork-dispatcher'
1919
include 'patchwork-enum-hacks'
20+
include 'patchwork-event-dispatcher'
2021
include 'patchwork-events-entity'
2122
include 'patchwork-events-input'
2223
include 'patchwork-events-lifecycle'

0 commit comments

Comments
 (0)