Package tschipp.carryon.platform
Class ForgePlatformHelper
java.lang.Object
tschipp.carryon.platform.ForgePlatformHelper
- All Implemented Interfaces:
IPlatformHelper
-
Constructor Summary
Constructors -
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)
-
Constructor Details
-
ForgePlatformHelper
public ForgePlatformHelper()
-
-
Method Details
-
getPlatformName
Description copied from interface:IPlatformHelperGets the name of the current platform- Specified by:
getPlatformNamein interfaceIPlatformHelper- Returns:
- The name of the current platform.
-
isModLoaded
Description copied from interface:IPlatformHelperChecks if a mod with the given id is loaded.- Specified by:
isModLoadedin interfaceIPlatformHelper- Parameters:
modId- The mod to check if it is loaded.- Returns:
- True if the mod is loaded, false otherwise.
-
isDevelopmentEnvironment
public boolean isDevelopmentEnvironment()Description copied from interface:IPlatformHelperCheck if the game is currently in a development environment.- Specified by:
isDevelopmentEnvironmentin interfaceIPlatformHelper- Returns:
- True if in a development environment, false otherwise.
-
registerConfig
- Specified by:
registerConfigin interfaceIPlatformHelper
-
registerServerboundPacket
public <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) - Specified by:
registerServerboundPacketin interfaceIPlatformHelper
-
registerClientboundPacket
public <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) - Specified by:
registerClientboundPacketin interfaceIPlatformHelper
-
sendPacketToServer
- Specified by:
sendPacketToServerin interfaceIPlatformHelper
-
sendPacketToPlayer
public void sendPacketToPlayer(net.minecraft.resources.ResourceLocation id, PacketBase packet, net.minecraft.server.level.ServerPlayer player) - Specified by:
sendPacketToPlayerin interfaceIPlatformHelper
-