Refactor feature / module system for 1.21.5 #55
This commit is contained in:
+1
-1
Submodule common updated: dceff0e675...6873f76c43
+1
-1
@@ -19,7 +19,7 @@ import org.saturnclient.impl.features.world.WorldFeatureImpl;
|
|||||||
* inconsistency between modules reading state within the same tick.
|
* inconsistency between modules reading state within the same tick.
|
||||||
*
|
*
|
||||||
* <pre>{@code
|
* <pre>{@code
|
||||||
* ModuleProvider provider = new ModuleProviderFabric(MinecraftClient.getInstance());
|
* FeatureProvider provider = new FeatureProviderFabric(MinecraftClient.getInstance());
|
||||||
* FeatureManager.register(new AutoSprintFeature(provider));
|
* FeatureManager.register(new AutoSprintFeature(provider));
|
||||||
* FeatureManager.register(new CoordinatesFeature(provider));
|
* FeatureManager.register(new CoordinatesFeature(provider));
|
||||||
* // …
|
* // …
|
||||||
|
|||||||
+3
-3
@@ -19,13 +19,13 @@ import org.saturnclient.impl.features.world.WorldFeatureImpl;
|
|||||||
* inconsistency between modules reading state within the same tick.
|
* inconsistency between modules reading state within the same tick.
|
||||||
*
|
*
|
||||||
* <pre>{@code
|
* <pre>{@code
|
||||||
* ModuleProvider provider = new ModuleProviderFabric(MinecraftClient.getInstance());
|
* FeatureProvider provider = new FeatureProviderFabric(MinecraftClient.getInstance());
|
||||||
* FeatureManager.register(new AutoSprintFeature(provider));
|
* FeatureManager.register(new AutoSprintFeature(provider));
|
||||||
* FeatureManager.register(new CoordinatesFeature(provider));
|
* FeatureManager.register(new CoordinatesFeature(provider));
|
||||||
* // …
|
* // …
|
||||||
* }</pre>
|
* }</pre>
|
||||||
*/
|
*/
|
||||||
public class ModuleProviderFabric implements FeatureProvider {
|
public class FeatureProviderFabric implements FeatureProvider {
|
||||||
|
|
||||||
private final PlayerFeature player;
|
private final PlayerFeature player;
|
||||||
private final WorldFeature world;
|
private final WorldFeature world;
|
||||||
@@ -33,7 +33,7 @@ public class ModuleProviderFabric implements FeatureProvider {
|
|||||||
private final RenderFeature render;
|
private final RenderFeature render;
|
||||||
private final NetworkFeature network;
|
private final NetworkFeature network;
|
||||||
|
|
||||||
public ModuleProviderFabric(MinecraftClient mc) {
|
public FeatureProviderFabric(MinecraftClient mc) {
|
||||||
this.player = new PlayerFeatureImpl(mc);
|
this.player = new PlayerFeatureImpl(mc);
|
||||||
this.world = new WorldFeatureImpl(mc);
|
this.world = new WorldFeatureImpl(mc);
|
||||||
this.entity = new EntityFeatureImpl(mc);
|
this.entity = new EntityFeatureImpl(mc);
|
||||||
@@ -11,7 +11,7 @@ import org.saturnclient.cosmetics.Hats;
|
|||||||
import org.saturnclient.cosmetics.Cloaks;
|
import org.saturnclient.cosmetics.Cloaks;
|
||||||
import org.saturnclient.common.provider.Providers;
|
import org.saturnclient.common.provider.Providers;
|
||||||
import org.saturnclient.impl.provider.GLFWProviderImpl;
|
import org.saturnclient.impl.provider.GLFWProviderImpl;
|
||||||
import org.saturnclient.impl.provider.ModuleProviderFabric;
|
import org.saturnclient.impl.provider.FeatureProviderFabric;
|
||||||
import org.saturnclient.impl.provider.RefConstructorImpl;
|
import org.saturnclient.impl.provider.RefConstructorImpl;
|
||||||
import org.saturnclient.impl.provider.SaturnProviderImpl;
|
import org.saturnclient.impl.provider.SaturnProviderImpl;
|
||||||
import org.saturnclient.impl.ui.EntityDrawerImpl;
|
import org.saturnclient.impl.ui.EntityDrawerImpl;
|
||||||
@@ -41,7 +41,7 @@ public class SaturnClient implements ModInitializer {
|
|||||||
Providers.saturn = new SaturnProviderImpl();
|
Providers.saturn = new SaturnProviderImpl();
|
||||||
Providers.refConstructor = new RefConstructorImpl();
|
Providers.refConstructor = new RefConstructorImpl();
|
||||||
Providers.GLFW = new GLFWProviderImpl();
|
Providers.GLFW = new GLFWProviderImpl();
|
||||||
Providers.feature = new ModuleProviderFabric(client);
|
Providers.feature = new FeatureProviderFabric(client);
|
||||||
SkinPreview.DRAWER = new EntityDrawerImpl();
|
SkinPreview.DRAWER = new EntityDrawerImpl();
|
||||||
|
|
||||||
Config.init();
|
Config.init();
|
||||||
|
|||||||
Reference in New Issue
Block a user