Package net.trique.wardentools.platform
Class NeoForgePlatformHelper
java.lang.Object
net.trique.wardentools.platform.NeoForgePlatformHelper
- All Implemented Interfaces:
IPlatformHelper
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> TgetAttachedValue(Object object, 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) static voidsetRegistrar(net.neoforged.neoforge.network.registration.PayloadRegistrar registrar) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.trique.wardentools.platform.services.IPlatformHelper
getEnvironmentName, getOrCreateAttachedValue
-
Constructor Details
-
NeoForgePlatformHelper
public NeoForgePlatformHelper()
-
-
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.
-
setRegistrar
public static void setRegistrar(net.neoforged.neoforge.network.registration.PayloadRegistrar registrar) -
isClient
public boolean isClient()Description copied from interface:IPlatformHelperGets the name of the environment type as a string.- Specified by:
isClientin interfaceIPlatformHelper- Returns:
- The name of the environment type.
-
registerDataAttachment
- Specified by:
registerDataAttachmentin interfaceIPlatformHelper
-
getAttachedValue
- Specified by:
getAttachedValuein interfaceIPlatformHelper
-
setAttachedValue
public <T> void setAttachedValue(Object object, CommonDataAttachment<T> attachment, @Nullable T value) - Specified by:
setAttachedValuein interfaceIPlatformHelper
-
registerClientPlayPacket
public <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) - Specified by:
registerClientPlayPacketin interfaceIPlatformHelper
-
registerServerPlayPacket
public <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) - Specified by:
registerServerPlayPacketin interfaceIPlatformHelper
-
sendToClient
- Specified by:
sendToClientin interfaceIPlatformHelper
-
sendToServer
- Specified by:
sendToServerin interfaceIPlatformHelper
-
getSimpleParticle
public net.minecraft.core.particles.SimpleParticleType getSimpleParticle()- Specified by:
getSimpleParticlein interfaceIPlatformHelper
-