Skip to content

Commit 20eac59

Browse files
committed
1.0.3 release, porting over module configuration for mixin stuff into well, here.
1 parent 5362171 commit 20eac59

11 files changed

Lines changed: 82 additions & 18 deletions

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ repositories {
7373
dependencies {
7474

7575
installer('org.mangorage:installer:4.0.20')
76-
bootstrap("org.mangorage:mangobotbootstrap:1.0.45")
76+
bootstrap("org.mangorage:mangobotbootstrap:1.0.46")
7777

7878
plugin("org.mangorage:mangobot:12.0.72")
7979

src/main/java/module-info.java

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
import org.mangorage.mangobotmixin.mixin.core.MangoBotMixinBlackboardImpl;
2-
import org.mangorage.mangobotmixin.mixin.transformer.SpongeMixinClassTransformerImpl;
3-
41
module org.mangorage.mangobotmixin {
52
requires org.mangorage.mangobotcore;
63
requires org.spongepowered.mixin;
@@ -11,15 +8,30 @@
118
exports org.mangorage.mangobotmixin.plugin to org.mangorage.mangobotcore;
129
exports org.mangorage.mangobotmixin.mixin.core to org.spongepowered.mixin, mixinextras.common;
1310
exports org.mangorage.mangobotmixin.mixin to org.spongepowered.mixin, mixinextras.common;
14-
exports org.mangorage.mangobotmixin.mixin.transformer to org.spongepowered.mixin, mixinextras.common;
11+
exports org.mangorage.mangobotmixin.mixin.services to mixinextras.common, org.spongepowered.mixin;
12+
exports org.mangorage.mangobotmixin.services to mixinextras.common, org.spongepowered.mixin, org.mangorage.bootstrap;
13+
1514

15+
// Bootstrap Services
16+
provides org.mangorage.bootstrap.api.module.IModuleConfigurator with org.mangorage.mangobotmixin.services.ModuleConfigService;
17+
provides org.mangorage.bootstrap.api.transformer.IClassTransformer with org.mangorage.mangobotmixin.services.SpongeMixinClassTransformerImpl;
1618

17-
provides org.mangorage.bootstrap.api.transformer.IClassTransformer with SpongeMixinClassTransformerImpl;
18-
provides org.spongepowered.asm.service.IGlobalPropertyService with MangoBotMixinBlackboardImpl;
19+
// MangoBot Services
1920
provides org.mangorage.mangobotcore.plugin.api.Plugin with org.mangorage.mangobotmixin.plugin.MangoBotMixinPlugin;
20-
provides org.mangorage.mangobotcore.plugin.api.IPluginInfoGetter with org.mangorage.mangobotmixin.mixin.MetadataInfoGrabberImpl;
21+
provides org.mangorage.mangobotcore.plugin.api.IPluginInfoGetter with org.mangorage.mangobotmixin.services.MetadataInfoGrabberImpl;
22+
23+
// Mixin Service
24+
provides org.spongepowered.asm.service.IGlobalPropertyService with org.mangorage.mangobotmixin.mixin.services.MangoBotMixinBlackboardImpl;
25+
2126

27+
// Bootstrap Services
2228
uses org.mangorage.bootstrap.api.transformer.IClassTransformer;
23-
uses org.spongepowered.asm.service.IGlobalPropertyService;
29+
uses org.mangorage.bootstrap.api.module.IModuleConfigurator;
30+
31+
// MangoBot Services
2432
uses org.mangorage.mangobotcore.plugin.api.Plugin;
33+
uses org.mangorage.mangobotcore.plugin.api.IPluginInfoGetter;
34+
35+
// Mixin Service
36+
uses org.spongepowered.asm.service.IGlobalPropertyService;
2537
}

src/main/java/org/mangorage/mangobotmixin/mixin/SpongeMixinImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package org.mangorage.mangobotmixin.mixin;
22

33
import com.llamalad7.mixinextras.MixinExtrasBootstrap;
4-
import org.mangorage.mangobotmixin.mixin.core.MangoBotMixinBootstrapImpl;
4+
import org.mangorage.mangobotmixin.mixin.services.MangoBotMixinBootstrapImpl;
55
import org.mangorage.mangobotmixin.mixin.core.MangoBotMixinServiceImpl;
66

77
import org.spongepowered.asm.launch.MixinBootstrap;

src/main/java/org/mangorage/mangobotmixin/mixin/core/MangoBotMixinContainerImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ public String toString() {
4444
return "MixinContainer{name=" + this.getName() + "}";
4545
}
4646

47-
/* package */ static class ResourceContainer extends ContainerHandleURI {
47+
static class ResourceContainer extends ContainerHandleURI {
4848
private final String name;
4949
private final Path path;
5050

51-
/* package */ ResourceContainer(final @NotNull String name, final @NotNull Path path) {
51+
ResourceContainer(final @NotNull String name, final @NotNull Path path) {
5252
super(path.toUri());
5353

5454
this.name = name;

src/main/java/org/mangorage/mangobotmixin/mixin/core/MangoBotMixinServiceImpl.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import org.jetbrains.annotations.NotNull;
44
import org.mangorage.bootstrap.api.loader.IMangoLoader;
55
import org.mangorage.mangobotmixin.mixin.SpongeMixinImpl;
6+
import org.mangorage.mangobotmixin.mixin.services.MangoBotMixinLoggerImpl;
67
import org.objectweb.asm.ClassReader;
78
import org.objectweb.asm.Opcodes;
89
import org.objectweb.asm.tree.ClassNode;

src/main/java/org/mangorage/mangobotmixin/mixin/core/MangoBotMixinBlackboardImpl.java renamed to src/main/java/org/mangorage/mangobotmixin/mixin/services/MangoBotMixinBlackboardImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package org.mangorage.mangobotmixin.mixin.core;
1+
package org.mangorage.mangobotmixin.mixin.services;
22

33
import org.jetbrains.annotations.NotNull;
44
import org.jetbrains.annotations.Nullable;

src/main/java/org/mangorage/mangobotmixin/mixin/core/MangoBotMixinBootstrapImpl.java renamed to src/main/java/org/mangorage/mangobotmixin/mixin/services/MangoBotMixinBootstrapImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package org.mangorage.mangobotmixin.mixin.core;
1+
package org.mangorage.mangobotmixin.mixin.services;
22

33
import org.spongepowered.asm.service.IMixinServiceBootstrap;
44

src/main/java/org/mangorage/mangobotmixin/mixin/core/MangoBotMixinLoggerImpl.java renamed to src/main/java/org/mangorage/mangobotmixin/mixin/services/MangoBotMixinLoggerImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package org.mangorage.mangobotmixin.mixin.core;
1+
package org.mangorage.mangobotmixin.mixin.services;
22

33
import org.spongepowered.asm.logging.ILogger;
44
import org.spongepowered.asm.logging.Level;
@@ -28,7 +28,7 @@ public void catching(Level level, Throwable throwable) {
2828
throwable.printStackTrace();
2929
}
3030

31-
public static void print(String message, Object... args) {
31+
static void print(String message, Object... args) {
3232
for (Object arg : args) {
3333
message = message.replaceFirst("\\{}", arg == null ? "null" : arg.toString());
3434
}

src/main/java/org/mangorage/mangobotmixin/mixin/MetadataInfoGrabberImpl.java renamed to src/main/java/org/mangorage/mangobotmixin/services/MetadataInfoGrabberImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package org.mangorage.mangobotmixin.mixin;
1+
package org.mangorage.mangobotmixin.services;
22

33
import org.mangorage.mangobotcore.plugin.api.IPluginInfoGetter;
44
import org.mangorage.mangobotcore.plugin.api.Metadata;
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
package org.mangorage.mangobotmixin.services;
2+
3+
import org.mangorage.bootstrap.api.module.IModuleConfigurator;
4+
import org.mangorage.bootstrap.api.module.IModuleLayer;
5+
6+
import java.util.List;
7+
8+
public final class ModuleConfigService implements IModuleConfigurator {
9+
@Override
10+
public void configureModuleLayer(IModuleLayer moduleLayer) {
11+
// Common Stuff that both modules need...
12+
moduleLayer.addOpens(
13+
"org.spongepowered.mixin",
14+
List.of(
15+
"org.spongepowered.asm.mixin.transformer"
16+
),
17+
List.of(
18+
"org.mangorage.mangobotmixin",
19+
"mixinextras.common"
20+
)
21+
);
22+
23+
// Stuff that needs to be opened to the one target
24+
moduleLayer.addOpens(
25+
"org.spongepowered.mixin",
26+
List.of(
27+
28+
"org.spongepowered.asm.mixin",
29+
"org.spongepowered.asm.transformers"
30+
),
31+
List.of(
32+
"org.mangorage.mangobotmixin"
33+
)
34+
);
35+
36+
// Stuff that needs to be opened to the one target
37+
moduleLayer.addOpens(
38+
"org.spongepowered.mixin",
39+
List.of(
40+
"org.spongepowered.asm.mixin.transformer.ext.extensions",
41+
"org.spongepowered.asm.mixin.injection.struct",
42+
"org.spongepowered.asm.mixin.transformer.ext",
43+
"org.spongepowered.asm.transformers",
44+
"org.spongepowered.asm.mixin"
45+
),
46+
List.of(
47+
"mixinextras.common"
48+
)
49+
);
50+
}
51+
}

0 commit comments

Comments
 (0)