Interface IPlatformHelper
- All Known Implementing Classes:
ForgePlatformHelper
public interface IPlatformHelper
-
Method Summary
Modifier and TypeMethodDescriptionGets the name of the current platformbooleanCheck if the game is currently in a development environment.booleanisModLoaded(String modId) Checks if a mod with the given id is loaded.<T extends PacketBase>
voidregisterClientboundPacket(net.minecraft.resources.ResourceLocation id, int numericalId, Class<T> clazz, BiConsumer<T, net.minecraft.network.FriendlyByteBuf> writer, Function<net.minecraft.network.FriendlyByteBuf, T> reader, BiConsumer<T, net.minecraft.world.entity.player.Player> handler, Object... args) void<T extends PacketBase>
voidregisterServerboundPacket(net.minecraft.resources.ResourceLocation id, int numericalId, Class<T> clazz, BiConsumer<T, net.minecraft.network.FriendlyByteBuf> writer, Function<net.minecraft.network.FriendlyByteBuf, T> reader, BiConsumer<T, net.minecraft.world.entity.player.Player> handler, Object... args) voidsendPacketToPlayer(net.minecraft.resources.ResourceLocation id, PacketBase packet, net.minecraft.server.level.ServerPlayer player) voidsendPacketToServer(net.minecraft.resources.ResourceLocation id, PacketBase packet)
-
Method Details
-
getPlatformName
String getPlatformName()Gets the name of the current platform- Returns:
- The name of the current platform.
-
isModLoaded
Checks if a mod with the given id is loaded.- Parameters:
modId- The mod to check if it is loaded.- Returns:
- True if the mod is loaded, false otherwise.
-
isDevelopmentEnvironment
boolean isDevelopmentEnvironment()Check if the game is currently in a development environment.- Returns:
- True if in a development environment, false otherwise.
-
registerConfig
-
registerServerboundPacket
<T extends PacketBase> void registerServerboundPacket(net.minecraft.resources.ResourceLocation id, int numericalId, Class<T> clazz, BiConsumer<T, net.minecraft.network.FriendlyByteBuf> writer, Function<net.minecraft.network.FriendlyByteBuf, T> reader, BiConsumer<T, net.minecraft.world.entity.player.Player> handler, Object... args) -
registerClientboundPacket
<T extends PacketBase> void registerClientboundPacket(net.minecraft.resources.ResourceLocation id, int numericalId, Class<T> clazz, BiConsumer<T, net.minecraft.network.FriendlyByteBuf> writer, Function<net.minecraft.network.FriendlyByteBuf, T> reader, BiConsumer<T, net.minecraft.world.entity.player.Player> handler, Object... args) -
sendPacketToServer
-
sendPacketToPlayer
void sendPacketToPlayer(net.minecraft.resources.ResourceLocation id, PacketBase packet, net.minecraft.server.level.ServerPlayer player)
-