diff --git a/minecraft/conn.go b/minecraft/conn.go index ae21444b1..d5e8f67d7 100644 --- a/minecraft/conn.go +++ b/minecraft/conn.go @@ -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 @@ -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) diff --git a/minecraft/listener.go b/minecraft/listener.go index 47809f0ef..d08f06ffa 100644 --- a/minecraft/listener.go +++ b/minecraft/listener.go @@ -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. @@ -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