Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions minecraft/conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ type Conn struct {
// texturePacksRequired specifies if clients that join must accept the texture pack in order for them to
// be able to join the server. If they don't accept, they can only leave the server.
texturePacksRequired bool
// disableEducationPacks prevents built-in Education Edition packs from being appended to the resource pack stack.
disableEducationPacks bool
// forceDisableVibrantVisuals specifies whether the connection is forced to have vibrant visuals disabled.
forceDisableVibrantVisuals bool
packQueue *resourcePackQueue
Expand Down Expand Up @@ -1141,11 +1143,13 @@ func (conn *Conn) handleResourcePackClientResponse(pk *packet.ResourcePackClient
resourcePack := protocol.StackResourcePack{UUID: pack.UUID().String(), Version: pack.Version()}
pk.TexturePacks = append(pk.TexturePacks, resourcePack)
}
for _, exempted := range exemptedPacks {
pk.TexturePacks = append(pk.TexturePacks, protocol.StackResourcePack{
UUID: exempted.uuid,
Version: exempted.version,
})
if !conn.disableEducationPacks {
for _, exempted := range exemptedPacks {
pk.TexturePacks = append(pk.TexturePacks, protocol.StackResourcePack{
UUID: exempted.uuid,
Version: exempted.version,
})
}
}
if err := conn.WritePacket(pk); err != nil {
return fmt.Errorf("send ResourcePackStack: %w", err)
Expand Down
5 changes: 5 additions & 0 deletions minecraft/listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ type ListenConfig struct {
// TexturePacksRequired specifies if clients that join must accept the texture pack in order for them to
// be able to join the server. If they don't accept, they can only leave the server.
TexturePacksRequired bool
// DisableEducationPacks prevents the built-in Education Edition resource packs from being appended to the
// resource pack stack. These packs include vanilla resources such as the particle atlas and may override
// equivalent resources from a player's global resource packs.
DisableEducationPacks bool
// ForceDisableVibrantVisuals specifies if the server should force disable vibrant visuals for all clients.
ForceDisableVibrantVisuals bool
// FetchResourcePacks determines which resource packs to send to a client based on its identity and client data.
Expand Down Expand Up @@ -468,6 +472,7 @@ func (listener *Listener) createConn(netConn net.Conn) {

conn.packetFunc = listener.cfg.PacketFunc
conn.texturePacksRequired = listener.cfg.TexturePacksRequired
conn.disableEducationPacks = listener.cfg.DisableEducationPacks
conn.forceDisableVibrantVisuals = listener.cfg.ForceDisableVibrantVisuals
conn.resourcePacks = packs
conn.fetchResourcePacks = listener.cfg.FetchResourcePacks
Expand Down
Loading