26 lines
924 B
Java
26 lines
924 B
Java
package io.gitlab.jfronny.breakme;
|
|
|
|
import io.gitlab.jfronny.breakme.crash.KnownProviders;
|
|
import io.gitlab.jfronny.commons.log.Logger;
|
|
import net.fabricmc.api.ModInitializer;
|
|
import net.minecraft.entity.player.PlayerEntity;
|
|
|
|
public class BreakMe implements ModInitializer {
|
|
public static final String MOD_ID = "breakme";
|
|
public static final Logger LOGGER = Logger.forName(MOD_ID);
|
|
|
|
@Override
|
|
public void onInitialize() {
|
|
LOGGER.warn("Prepare for trouble");
|
|
}
|
|
|
|
public static void tryInvokeCrash(PlayerEntity player) throws Exception {
|
|
if (BreakMeConfig.event == BreakMeConfig.Cause.All
|
|
|| BreakMeConfig.event == BreakMeConfig.Cause.Damage
|
|
|| (BreakMeConfig.event == BreakMeConfig.Cause.Death && player.isDead())) {
|
|
LOGGER.info("Invoking the crash");
|
|
KnownProviders.PROVIDERS.get(BreakMeConfig.method).crash();
|
|
}
|
|
}
|
|
}
|