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

Commit 8a21d78

Browse files
authored
Completely stub all classes in god-classes (#203)
* Fully stub ForgeHooksClient * Fully stub ClientHooks * Reorder BasicEventHooks methods to match Forge. This class is actually fully implemented! * FIXUP! Fix ClientHooks checkstyle. * Fully stub ForgeEventFactory * Fully stub ForgeHooks * Revamp documentation discouraging use of god-classes in other modules.
1 parent 41feaee commit 8a21d78

File tree

7 files changed

+1359
-78
lines changed

7 files changed

+1359
-78
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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.patchworkmc.annotations;
21+
22+
import java.lang.annotation.ElementType;
23+
import java.lang.annotation.Retention;
24+
import java.lang.annotation.RetentionPolicy;
25+
import java.lang.annotation.Target;
26+
27+
/**
28+
* Marks an element as having been manually stubbed.
29+
*/
30+
@Target({ ElementType.METHOD, ElementType.TYPE })
31+
@Retention(RetentionPolicy.CLASS)
32+
public @interface Stubbed {
33+
}

patchwork-god-classes/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
# patchwork-god-classes
22

3-
Implementation of ForgeHooks, ForgeHooksClient, ForgeEventFactory, and BasicEventHooks that dispatches to different patchwork modules.
3+
Implementation of ForgeHooks, ForgeHooksClient, ForgeEventFactory, ClientHooks, and BasicEventHooks that dispatches to different patchwork modules.
44

55
## Reasoning
66

77
Forge uses these classes from inside their patches in order to keep the size of their patches down.
88
Patchwork keeps its hooks seperated between modules, however, some mods also use these classes.
99
Therefore, this module exists to dispatch calls to these classes to the disperate modules that actually implement the relevant methods.
1010

11+
Don't depend on this module from other modules. If you feel the need to do so, something has gone wrong
12+
and implementation details should be moved into its proper module.
13+
1114
## TODO
1215
* Implement the methods on these classes that are actually already implemented in Patchwork.

0 commit comments

Comments
 (0)