Skip to content

Commit

Permalink
Move embeddium hack (#81)
Browse files Browse the repository at this point in the history
* Remove cloud hack

* Remove unnecessary code

* remove mixin option chuck

* Bump deps

---------

Co-authored-by: dima_dencep <[email protected]>
  • Loading branch information
Takkkom and dima-dencep authored Jul 5, 2024
1 parent a26e4c6 commit 012cdef
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 77 deletions.
26 changes: 0 additions & 26 deletions .github/workflows/gradle.yml

This file was deleted.

8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ loom.platform = neoforge
minecraft_version=1.21
yarn_mappings=1.21+build.1
yarn_patch=1.21+build.4
loader_version=21.0.38-beta
loader_version=21.0.57-beta

# Mod Properties
mod_version=0.5.7a
mod_version=0.5.7b
maven_group=com.github.dima_dencep.mods
archives_base_name=rubidium-extra

# Dependencies
nanoliveconfig_version=2.2.0
nanoliveconfig_version=2.3.0
oculus_version=1.20.1-1.6.9
embeddium_version=1.0.3-git-b2dc012+mc1.21
embeddium_version=1.0.5-git-81cc98b+mc1.21
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package me.flashyreese.mods.sodiumextra.client;

import static me.flashyreese.mods.sodiumextra.mixin.SodiumExtraMixinConfigPlugin.EMBEDDIUM_HACKED;

import me.flashyreese.mods.sodiumextra.client.gui.EmbeddiumExtendedOptions;
import me.flashyreese.mods.sodiumextra.client.gui.SodiumExtraGameOptionPages;
import me.flashyreese.mods.sodiumextra.client.gui.SodiumExtraGameOptions;
Expand All @@ -16,6 +14,7 @@
import org.embeddedt.embeddium.api.OptionPageConstructionEvent;
import org.embeddedt.embeddium.api.options.structure.StandardOptions;
import org.embeddedt.embeddium.api.render.chunk.RenderSectionDistanceFilterEvent;
import org.embeddedt.embeddium.api.render.clouds.ModifyCloudRenderingEvent;

@Mod(value = SodiumExtraClientMod.MOD_ID, dist = Dist.CLIENT)
public class SodiumExtraClientMod {
Expand Down Expand Up @@ -59,10 +58,10 @@ public static CaffeineConfig mixinConfig() {
.addMixinOption("render.entity", true)
.addMixinOption("sky", true)
.addMixinOption("sky_colors", true)
.addMixinOption("sodium", true)
//.addMixinOption("sodium", true, true, true)
//.addMixinOption("sodium.accessibility", true) in embeddium
// .addMixinOption("sodium.fog", true) via api
.addMixinOption("sodium.cloud", EMBEDDIUM_HACKED)
//.addMixinOption("sodium.fog", true) via api
//.addMixinOption("sodium.cloud", true) via api
//.addMixinOption("sodium.resolution", true) via api
//.addMixinOption("sodium.scrollable_page", true) in embeddium
//.addMixinOption("sodium.vsync", true) via api
Expand Down Expand Up @@ -116,5 +115,9 @@ public SodiumExtraClientMod() {
RenderSectionDistanceFilterEvent.BUS.addListener(event -> {
event.setFilter(ExtraRenderSectionDistanceFilter.INSTANCE);
});

ModifyCloudRenderingEvent.BUS.addListener(event -> {
event.setCloudRenderDistance(event.getCloudRenderDistance() * SodiumExtraClientMod.options().extraSettings.cloudDistance / 100);
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,6 @@ public static OptionPage extra() {
)
.add(OptionImpl.createBuilder(int.class, sodiumExtraOpts)
.setId(SodiumExtraOptions.Option.EXTRA_CLOUD_DISTANCE)
.setEnabled(SodiumExtraClientMod.mixinConfig().getOptions().get("mixin.sodium.cloud").isEnabled())
.setName(Text.translatable("sodium-extra.option.cloud_distance"))
.setTooltip(Text.translatable("sodium-extra.option.cloud_distance.tooltip"))
.setControl(option -> new SliderControl(option, 100, 300, 10, ControlValueFormatter.percentage()))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,6 @@
public class SodiumExtraMixinConfigPlugin extends AbstractCaffeineConfigMixinPlugin {

private static final String MIXIN_PACKAGE_ROOT = "me.flashyreese.mods.sodiumextra.mixin.";
public static boolean EMBEDDIUM_HACKED = false;

static {
System.setProperty("embeddium.mixinTaintEnforceLevel", "WARN");

for (IExtension extension : MixinInternals.getExtensions().getActiveExtensions()) {
String extensionClass = extension.getClass().getName();

SodiumExtraClientMod.LOGGER.info("Try {}...", extensionClass);

if (extensionClass.contains(".embeddium.")) {
MixinInternals.unregisterExtension(extension);
EMBEDDIUM_HACKED = true;
SodiumExtraClientMod.LOGGER.info("Embeddium hacked!");
break;
}
}

if (!EMBEDDIUM_HACKED) {
SodiumExtraClientMod.LOGGER.error("Embeddium NOT hacked!");
}
}

@Override
protected CaffeineConfig createConfig() {
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion src/main/resources/META-INF/neoforge.mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ side = "BOTH"
[[dependencies.embeddium_extra]]
modId = "embeddium"
type = "required"
versionRange = "[1.0.3+mc1.21,)"
versionRange = "[1.0.4+mc1.21,)"
ordering = "NONE"
side = "CLIENT"

Expand Down
1 change: 0 additions & 1 deletion src/main/resources/sodium-extra.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
"render.entity.MixinPaintingEntityRenderer",
"sky.MixinWorldRenderer",
"sky_colors.MixinBiome",
"sodium.cloud.MixinCloudRenderer",
"stars.MixinWorldRenderer",
"steady_debug_hud.MixinDebugHud",
"sun_moon.MixinWorldRenderer",
Expand Down

0 comments on commit 012cdef

Please sign in to comment.