Skip to content

Commit

Permalink
Whoops (#113)
Browse files Browse the repository at this point in the history
  • Loading branch information
enjarai committed Oct 11, 2023
1 parent d521047 commit 817b203
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 15 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
- Fixed compatibility with Equipment Compare. (#89)
- Fixed a crash on dedicated servers. (#113)
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ org.gradle.jvmargs=-Xmx4096M
minecraft_version=1.20

archives_base_name=do-a-barrel-roll
mod_version=3.3.4
mod_version=3.3.5
maven_group=nl.enjarai

yarn_version=1.20+build.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import java.util.List;

public class DoABarrelRollFabricClient implements ClientModInitializer, MixinCanceller {
public class DoABarrelRollFabricClient implements ClientModInitializer {
@Override
public void onInitializeClient() {
DoABarrelRollClient.init();
Expand All @@ -34,14 +34,4 @@ public void onInitializeClient() {
StarFoxUtil.clientTick(client);
});
}

@Override
public boolean shouldCancel(List<String> targetClassNames, String mixinClassName) {
if (mixinClassName.equals("com.anthonyhilyard.equipmentcompare.mixin.KeyMappingMixin") && MixinAnnotationReader.getPriority(mixinClassName) == 1000) {
DoABarrelRoll.LOGGER.warn("Equipment Compare detected, disabling their overly invasive keybinding mixin. Report any relevant issues to them.");
DoABarrelRoll.LOGGER.warn("If the author of Equipment Compare is reading this: see #31 on your github. Once the issue is fixed, you can set the priority of this mixin to anything other than 1000 to stop it being disabled.");
return true;
}
return false;
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
package nl.enjarai.doabarrelroll.fabric;

import com.bawnorton.mixinsquared.api.MixinCanceller;
import com.bawnorton.mixinsquared.tools.MixinAnnotationReader;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents;
import nl.enjarai.doabarrelroll.DoABarrelRoll;
import nl.enjarai.doabarrelroll.config.ModConfigServer;
import nl.enjarai.doabarrelroll.fabric.net.HandshakeServerFabric;

public class DoABarrelRollFabric implements ModInitializer {
import java.util.List;

public class DoABarrelRollFabric implements ModInitializer, MixinCanceller {
@Override
public void onInitialize() {
// Init server and client common code.
Expand All @@ -16,4 +20,14 @@ public void onInitialize() {
// both client and server to ensure everything works in LAN worlds as well.
HandshakeServerFabric.init();
}

@Override
public boolean shouldCancel(List<String> targetClassNames, String mixinClassName) {
if (mixinClassName.equals("com.anthonyhilyard.equipmentcompare.mixin.KeyMappingMixin") && MixinAnnotationReader.getPriority(mixinClassName) == 1000) {
DoABarrelRoll.LOGGER.warn("Equipment Compare detected, disabling their overly invasive keybinding mixin. Report any relevant issues to them.");
DoABarrelRoll.LOGGER.warn("If the author of Equipment Compare is reading this: see #31 on your github. Once the issue is fixed, you can set the priority of this mixin to anything other than 1000 to stop it being disabled.");
return true;
}
return false;
}
}
2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"nl.enjarai.doabarrelroll.compat.controlify.ControlifyCompat"
],
"mixinsquared": [
"nl.enjarai.doabarrelroll.fabric.DoABarrelRollFabricClient"
"nl.enjarai.doabarrelroll.fabric.DoABarrelRollFabric"
]
},

Expand Down

0 comments on commit 817b203

Please sign in to comment.