public interface ContainerProviderRegistry
Modifier and Type | Field and Description |
---|---|
static ContainerProviderRegistry |
INSTANCE |
Modifier and Type | Method and Description |
---|---|
void |
openContainer(net.minecraft.util.Identifier identifier,
net.minecraft.entity.player.PlayerEntity player,
Consumer<net.minecraft.network.PacketByteBuf> writer)
Open a modded container.
|
void |
openContainer(net.minecraft.util.Identifier identifier,
net.minecraft.server.network.ServerPlayerEntity player,
Consumer<net.minecraft.network.PacketByteBuf> writer)
Open a modded container.
|
void |
registerFactory(net.minecraft.util.Identifier identifier,
ContainerFactory<net.minecraft.screen.ScreenHandler> factory)
Register a "packet buffer -> container" factory.
|
static final ContainerProviderRegistry INSTANCE
void registerFactory(net.minecraft.util.Identifier identifier, ContainerFactory<net.minecraft.screen.ScreenHandler> factory)
identifier
- a shared identifier, this identifier should also be used to register a container using ScreenProviderRegistry
factory
- the ContainerFactory that should return a new ScreenHandler
void openContainer(net.minecraft.util.Identifier identifier, net.minecraft.server.network.ServerPlayerEntity player, Consumer<net.minecraft.network.PacketByteBuf> writer)
identifier
- the identifier that was used when registering the containerplayer
- the player that should open the containerwriter
- a PacketByteBuf where data can be written to, this data is then accessible by the container factory when creating the container or the guivoid openContainer(net.minecraft.util.Identifier identifier, net.minecraft.entity.player.PlayerEntity player, Consumer<net.minecraft.network.PacketByteBuf> writer)
identifier
- the identifier that was used when registering the containerplayer
- the player that should open the containerwriter
- a PacketByteBuf where data can be written to, this data is then accessible by the container factory when creating the container or the gui