|
24 | 24 | */ |
25 | 25 | package org.spongepowered.asm.launch.platform; |
26 | 26 |
|
| 27 | +import org.spongepowered.asm.launch.platform.container.IContainerHandle; |
27 | 28 | import org.spongepowered.asm.util.Constants.ManifestAttributes; |
28 | 29 |
|
29 | 30 | /** |
30 | 31 | * Default platform agent, handles the mixin manifest keys such as |
31 | | - * <tt>MixinConfigs</tt> and <tt>MixinTokenProviders</tt>. |
| 32 | + * <tt>MixinConfigs</tt> and <tt>MixinConnector</tt>. |
| 33 | + * CHANGED BY CLEANROOM: |
| 34 | + * Removed deprecated compatibility level, token providers manifest key support |
| 35 | + * Allow default agent to reject if no relevant manifest attributes are present |
32 | 36 | */ |
33 | 37 | public class MixinPlatformAgentDefault extends MixinPlatformAgentAbstract { |
34 | 38 |
|
| 39 | + private String mixinConfigs, connectorClass; |
| 40 | + |
| 41 | + @Override |
| 42 | + public AcceptResult accept(MixinPlatformManager manager, IContainerHandle handle) { |
| 43 | + this.mixinConfigs = this.handle.getAttribute(ManifestAttributes.MIXINCONFIGS); |
| 44 | + this.connectorClass = this.handle.getAttribute(ManifestAttributes.MIXINCONNECTOR); |
| 45 | + return this.mixinConfigs == null && this.connectorClass == null ? AcceptResult.REJECTED : super.accept(manager, handle); |
| 46 | + } |
| 47 | + |
35 | 48 | @Override |
36 | 49 | public void prepare() { |
37 | | - @SuppressWarnings("deprecation") |
38 | | - String compatibilityLevel = this.handle.getAttribute(ManifestAttributes.COMPATIBILITY); |
39 | | - if (compatibilityLevel != null) { |
40 | | - this.manager.setCompatibilityLevel(compatibilityLevel); |
41 | | - } |
42 | | - |
43 | | - String mixinConfigs = this.handle.getAttribute(ManifestAttributes.MIXINCONFIGS); |
44 | | - if (mixinConfigs != null) { |
45 | | - for (String config : mixinConfigs.split(",")) { |
| 50 | + if (this.mixinConfigs != null) { |
| 51 | + for (String config : this.mixinConfigs.split(",")) { |
46 | 52 | this.manager.addConfig(config.trim(), this.handle); |
47 | 53 | } |
48 | 54 | } |
49 | | - |
50 | | - String tokenProviders = this.handle.getAttribute(ManifestAttributes.TOKENPROVIDERS); |
51 | | - if (tokenProviders != null) { |
52 | | - for (String provider : tokenProviders.split(",")) { |
53 | | - this.manager.addTokenProvider(provider.trim()); |
54 | | - } |
55 | | - } |
56 | | - |
57 | | - String connectorClass = this.handle.getAttribute(ManifestAttributes.MIXINCONNECTOR); |
58 | | - if (connectorClass != null) { |
59 | | - this.manager.addConnector(connectorClass.trim()); |
| 55 | + if (this.connectorClass != null) { |
| 56 | + this.manager.addConnector(this.connectorClass.trim()); |
60 | 57 | } |
61 | 58 | } |
62 | 59 |
|
|
0 commit comments