removeAdviceOnLoad(boolean)   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 8
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 7
dl 0
loc 8
rs 10
c 0
b 0
f 0
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