Files
totem_of_reviving/src/main/java/dev/micle/totemofreviving/TotemOfReviving.java
Michal Niczejewski 60f5d27640 Creative mode tabs:
- Changed translation key for creative mode tab name to follow vanilla.
- Removed old creative mode tab register event handler.
- Created new creative mode tab registration setup.
- Optimized imports.
2024-01-26 21:10:17 +00:00

45 lines
1.2 KiB
Java

package dev.micle.totemofreviving;
import dev.micle.totemofreviving.proxy.IProxy;
import dev.micle.totemofreviving.proxy.Proxy;
import net.minecraft.resources.ResourceLocation;
import net.minecraftforge.fml.DistExecutor;
import net.minecraftforge.fml.ModContainer;
import net.minecraftforge.fml.ModList;
import net.minecraftforge.fml.common.Mod;
import java.util.Optional;
@Mod(TotemOfReviving.MOD_ID)
public final class TotemOfReviving {
public static final String MOD_ID = "totemofreviving";
private static IProxy proxy;
public TotemOfReviving() {
proxy = DistExecutor.safeRunForDist(
() -> Proxy.Client::new,
() -> Proxy.Server::new
);
}
public static ResourceLocation createResourceLocation(String name) {
if (name.contains(":")) {
throw new IllegalArgumentException("Name contains namespace");
}
return new ResourceLocation(MOD_ID, name);
}
public static String getVersion() {
Optional<? extends ModContainer> optional = ModList.get().getModContainerById(MOD_ID);
if (optional.isPresent()) {
return optional.get().getModInfo().getVersion().toString();
}
return "0.0.0";
}
public static IProxy getProxy() {
return proxy;
}
}