de.pewpewproject.lasertag.mixin.IntegratedServerLoaderMixin   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 12
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A removeAdviceOnLoad(boolean) 0 8 1
1
package de.pewpewproject.lasertag.mixin;
2
3
import net.minecraft.server.integrated.IntegratedServerLoader;
4
import org.spongepowered.asm.mixin.Mixin;
5
import org.spongepowered.asm.mixin.injection.At;
6
import org.spongepowered.asm.mixin.injection.ModifyVariable;
7
8
/**
9
 * Removes the experimental features warning when re-entering a world
10
 *
11
 * Modified version of <a href="https://github.com/rdvdev2/DisableCustomWorldsAdvice">DisableCustomWorldsAdvice</a>.
12
 */
13
@Mixin(IntegratedServerLoader.class)
14
public class IntegratedServerLoaderMixin {
15
16
    // Set canShowBackupPrompt = false
17
    @ModifyVariable(
18
            method = "start(Lnet/minecraft/client/gui/screen/Screen;Ljava/lang/String;ZZ)V",
19
            at = @At("HEAD"),
20
            argsOnly = true,
21
            index = 4
22
    )
23
    private boolean removeAdviceOnLoad(boolean original) {
24
        return false;
25
    }
26
}
27