Skip to content

Commit

Permalink
Disable EMC Nameplate changes for singleplayer (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
MrFrydae authored Jun 30, 2024
1 parent 41a13ce commit 8734053
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,18 +1,32 @@
# Gradle files
.gradle/
build/
out/
classes/
*.launch
gradle/wrapper
gradlew
gradlew.bat

# IntelliJ IDEA files
.idea/
*.iml
*.ipr
*.iws
.settings/

# VS Code files
.vscode/

# Eclipse files
bin/
.classpath
.project

# MacOS files
*.DS_Store

# Java files
run/
generated/
.architectury-transformer/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import coffee.waffle.emcutils.Caches;
import coffee.waffle.emcutils.Util;
import net.minecraft.client.MinecraftClient;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.text.Text;
import org.spongepowered.asm.mixin.Mixin;
Expand All @@ -15,6 +16,8 @@
abstract class PlayerEntityMixin {
@Inject(method = "getDisplayName", at = @At("HEAD"), cancellable = true)
private void emcutils$getDisplayName(CallbackInfoReturnable<Text> cir) {
if (MinecraftClient.getInstance().isInSingleplayer()) return; // Don't run anything for singleplayer

if (Util.isOnEMC) {
PlayerEntity e = ((PlayerEntity) (Object) this);

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
org.gradle.jvmargs=-Xmx4G
org.gradle.parallel=true

mod_version=9.0.0
mod_version=9.0.1

0 comments on commit 8734053

Please sign in to comment.