@@ -250,7 +250,7 @@ func (o *Outbound) InjectConnection(ctx context.Context, conn *bufio.CachedConn,
250250 }
251251 //remoteConn.(*net.TCPConn).SetLinger(0) // for some reason
252252 if metadata .Minecraft .RewrittenDestination == "" {
253- metadata .Minecraft .RewrittenDestination = metadata .Minecraft .OriginDestination
253+ metadata .Minecraft .RewrittenDestination = metadata .Minecraft .CleanOriginDestination ()
254254 }
255255 if metadata .Minecraft .RewrittenPort == 0 {
256256 metadata .Minecraft .RewrittenPort = metadata .Minecraft .OriginPort
@@ -265,10 +265,10 @@ func (o *Outbound) InjectConnection(ctx context.Context, conn *bufio.CachedConn,
265265 hostname = o .config .TargetAddress
266266 }
267267 } else if hostname == "" {
268- hostname = metadata .Minecraft .OriginDestination
268+ hostname = metadata .Minecraft .CleanOriginDestination ()
269269 }
270270 if ! o .config .Minecraft .IgnoreFMLSuffix && metadata .Minecraft .IsFML () {
271- hostname += "\x00 FML \ x00 "
271+ hostname += "\x00 " + metadata . Minecraft . FMLMarkup ()
272272 }
273273 port := metadata .Minecraft .RewrittenPort
274274 if port <= 0 {
@@ -391,10 +391,10 @@ func (o *Outbound) InjectConnection(ctx context.Context, conn *bufio.CachedConn,
391391 hostname = o .config .TargetAddress
392392 }
393393 } else if hostname == "" {
394- hostname = metadata .Minecraft .OriginDestination
394+ hostname = metadata .Minecraft .CleanOriginDestination ()
395395 }
396396 if ! o .config .Minecraft .IgnoreFMLSuffix && metadata .Minecraft .IsFML () {
397- hostname += "\x00 FML \ x00 "
397+ hostname += "\x00 " + metadata . Minecraft . FMLMarkup ()
398398 }
399399 port := metadata .Minecraft .RewrittenPort
400400 if port <= 0 {
0 commit comments