Interface IPlatformHelper
- All Known Implementing Classes:
NeoForgePlatformHelper
public interface IPlatformHelper
-
Method Summary
Modifier and TypeMethodDescription<T> TgetAttachedValue(Object object, CommonDataAttachment<T> attachment) default Stringdefault <T> TgetOrCreateAttachedValue(net.minecraft.world.entity.Entity entity, CommonDataAttachment<T> attachment) Gets the name of the current platformnet.minecraft.core.particles.SimpleParticleTypebooleanisClient()Gets the name of the environment type as a string.booleanCheck if the game is currently in a development environment.booleanisModLoaded(String modId) Checks if a mod with the given id is loaded.<MSG extends S2CModPacket<?>>
voidregisterClientPlayPacket(net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<MSG> type, net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, MSG> streamCodec) <T> voidregisterDataAttachment(CommonDataAttachment<T> attachment) <MSG extends C2SModPacket<?>>
voidregisterServerPlayPacket(net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<MSG> type, net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, MSG> streamCodec) voidsendToClient(S2CModPacket<?> msg, net.minecraft.server.level.ServerPlayer player) voidsendToServer(C2SModPacket<?> msg) <T> voidsetAttachedValue(Object object, CommonDataAttachment<T> attachment, T value)
-
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.
-
isClient
boolean isClient()Gets the name of the environment type as a string.- Returns:
- The name of the environment type.
-
getEnvironmentName
-
registerDataAttachment
-
getAttachedValue
-
getOrCreateAttachedValue
default <T> T getOrCreateAttachedValue(net.minecraft.world.entity.Entity entity, CommonDataAttachment<T> attachment) -
setAttachedValue
-
registerClientPlayPacket
<MSG extends S2CModPacket<?>> void registerClientPlayPacket(net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<MSG> type, net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, MSG> streamCodec) -
registerServerPlayPacket
<MSG extends C2SModPacket<?>> void registerServerPlayPacket(net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<MSG> type, net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, MSG> streamCodec) -
sendToClient
-
sendToServer
-
getSimpleParticle
net.minecraft.core.particles.SimpleParticleType getSimpleParticle()
-