Interface IPlatformHelper
public interface IPlatformHelper
-
Method Summary
Modifier and TypeMethodDescription@Nullable StoredHorseDatagetHorseData(net.minecraft.world.entity.Entity horse) Must never attach data as a side effect: the presence of data is what tells the rest of the mod that a mount is bound, and this is called for arbitrary entities.@Nullable StoredHorseDatagetOrCreateHorseData(net.minecraft.world.entity.Entity horse) Only for the paths about to write a binding.getOwnerData(net.minecraft.world.entity.player.Player player) Per-player horse ownership data.Gets the name of the current platform.booleanisAreaProtected(net.minecraft.world.entity.player.Player player, net.minecraft.world.entity.Entity probe) Asks any installed protection mod whetherplayermay interact withprobeat its current position.booleanCheck 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,B extends net.minecraft.network.FriendlyByteBuf>
voidregisterClientboundPacket(net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<T> type, Class<T> clazz, net.minecraft.network.codec.StreamCodec<B, T> codec, BiConsumer<T, net.minecraft.world.entity.player.Player> handler) void<T extends PacketBase,B extends net.minecraft.network.FriendlyByteBuf>
voidregisterServerboundPacket(net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<T> type, Class<T> clazz, net.minecraft.network.codec.StreamCodec<B, T> codec, BiConsumer<T, net.minecraft.world.entity.player.Player> handler) voidsendPacketToPlayer(PacketBase packet, net.minecraft.server.level.ServerPlayer player) voidsendPacketToPlayersTracking(PacketBase packet, net.minecraft.world.entity.Entity entity) voidsendPacketToServer(PacketBase packet) voidsetHorseData(net.minecraft.world.entity.Entity horse, StoredHorseData data) voidsetOwnerData(net.minecraft.world.entity.player.Player player, HorseOwnerData data)
-
Method Details
-
getPlatformName
String getPlatformName()Gets the name of the current platform. -
isModLoaded
Checks if a mod with the given id is loaded. -
isDevelopmentEnvironment
boolean isDevelopmentEnvironment()Check if the game is currently in a development environment. -
registerConfig
-
registerServerboundPacket
<T extends PacketBase,B extends net.minecraft.network.FriendlyByteBuf> void registerServerboundPacket(net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<T> type, Class<T> clazz, net.minecraft.network.codec.StreamCodec<B, T> codec, BiConsumer<T, net.minecraft.world.entity.player.Player> handler) -
registerClientboundPacket
<T extends PacketBase,B extends net.minecraft.network.FriendlyByteBuf> void registerClientboundPacket(net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<T> type, Class<T> clazz, net.minecraft.network.codec.StreamCodec<B, T> codec, BiConsumer<T, net.minecraft.world.entity.player.Player> handler) -
sendPacketToServer
-
sendPacketToPlayer
-
sendPacketToPlayersTracking
-
getOwnerData
Per-player horse ownership data. Backed by data attachments on Fabric/NeoForge and by a capability on Forge. -
setOwnerData
-
getHorseData
Must never attach data as a side effect: the presence of data is what tells the rest of the mod that a mount is bound, and this is called for arbitrary entities. -
getOrCreateHorseData
Only for the paths about to write a binding. Stillnullon Forge for an entity constructed without the capability. -
setHorseData
-
isAreaProtected
boolean isAreaProtected(net.minecraft.world.entity.player.Player player, net.minecraft.world.entity.Entity probe) Asks any installed protection mod whetherplayermay interact withprobeat its current position. Used to stop horses being called into, or bound inside, claimed regions.- Parameters:
probe- a horse entity positioned where the interaction would happen
-