2021-04-13 09:30:45 +02:00
|
|
|
package io.gitlab.jfronny.breakme;
|
|
|
|
|
2022-08-28 16:27:55 +02:00
|
|
|
import io.gitlab.jfronny.commons.log.Logger;
|
2021-04-13 09:30:45 +02:00
|
|
|
import net.fabricmc.api.ModInitializer;
|
|
|
|
import net.minecraft.entity.player.PlayerEntity;
|
|
|
|
|
|
|
|
public class BreakMe implements ModInitializer {
|
|
|
|
public static final String MOD_ID = "breakme";
|
2022-08-28 16:27:55 +02:00
|
|
|
public static final Logger LOGGER = Logger.forName(MOD_ID);
|
2021-04-13 09:30:45 +02:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onInitialize() {
|
2022-02-28 21:44:08 +01:00
|
|
|
LOGGER.warn("Prepare for trouble");
|
2021-04-13 09:30:45 +02:00
|
|
|
}
|
|
|
|
|
2022-02-28 21:44:08 +01:00
|
|
|
public static void tryInvokeCrash(PlayerEntity player) throws Exception {
|
2022-08-28 16:27:55 +02:00
|
|
|
if (BreakMeConfig.event == BreakMeConfig.Cause.All
|
|
|
|
|| BreakMeConfig.event == BreakMeConfig.Cause.Damage
|
|
|
|
|| (BreakMeConfig.event == BreakMeConfig.Cause.Death && player.isDead())) {
|
2022-02-28 21:44:08 +01:00
|
|
|
LOGGER.info("Invoking the crash");
|
2022-12-29 15:51:08 +01:00
|
|
|
BreakMeConfig.method.crash();
|
2021-04-13 09:30:45 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|