Package net.minecraft.server.network
Class ServerTextFilter
java.lang.Object
net.minecraft.server.network.ServerTextFilter
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
LegacyTextFilter
,PlayerSafetyServiceTextFilter
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
protected static interface
protected class
protected static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ServerTextFilter.MessageEncoder
private final URL
(package private) final ServerTextFilter.IgnoreStrategy
protected static final org.slf4j.Logger
private static final ThreadFactory
private static final AtomicInteger
(package private) final ExecutorService
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
ServerTextFilter
(URL p_365184_, ServerTextFilter.MessageEncoder p_364370_, ServerTextFilter.IgnoreStrategy p_362863_, ExecutorService p_361317_) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
protected int
createContext
(com.mojang.authlib.GameProfile p_364881_) static ServerTextFilter
createFromConfig
(DedicatedServerProperties p_360477_) protected static ExecutorService
createWorkerPool
(int p_365438_) protected void
drainStream
(InputStream p_364540_) protected abstract FilteredText
filterText
(String p_361873_, ServerTextFilter.IgnoreStrategy p_364388_, com.google.gson.JsonObject p_365044_) protected static URL
getEndpoint
(URI p_362537_, com.google.gson.JsonObject p_363488_, String p_362892_, String p_363642_) protected static String
getEndpointFromConfig
(com.google.gson.JsonObject p_364584_, String p_360874_, String p_364672_) protected HttpURLConnection
getURLConnection
(URL p_364237_) protected HttpURLConnection
makeRequest
(com.google.gson.JsonObject p_365284_, URL p_360402_) protected FilterMask
parseMask
(String p_360987_, com.google.gson.JsonArray p_362850_, ServerTextFilter.IgnoreStrategy p_361890_) private com.google.gson.JsonObject
processRequestResponse
(com.google.gson.JsonObject p_360751_, URL p_364299_) protected CompletableFuture
<FilteredText> requestMessageProcessing
(com.mojang.authlib.GameProfile p_362002_, String p_365325_, ServerTextFilter.IgnoreStrategy p_363966_, Executor p_363262_) protected abstract void
setAuthorizationProperty
(HttpURLConnection p_361800_)
-
Field Details
-
LOGGER
protected static final org.slf4j.Logger LOGGER -
WORKER_COUNT
-
THREAD_FACTORY
-
chatEndpoint
-
chatEncoder
-
chatIgnoreStrategy
-
workerPool
-
-
Constructor Details
-
ServerTextFilter
protected ServerTextFilter(URL p_365184_, ServerTextFilter.MessageEncoder p_364370_, ServerTextFilter.IgnoreStrategy p_362863_, ExecutorService p_361317_)
-
-
Method Details
-
createWorkerPool
-
getEndpoint
protected static URL getEndpoint(URI p_362537_, @Nullable com.google.gson.JsonObject p_363488_, String p_362892_, String p_363642_) throws MalformedURLException - Throws:
MalformedURLException
-
getEndpointFromConfig
-
createFromConfig
-
requestMessageProcessing
protected CompletableFuture<FilteredText> requestMessageProcessing(com.mojang.authlib.GameProfile p_362002_, String p_365325_, ServerTextFilter.IgnoreStrategy p_363966_, Executor p_363262_) -
filterText
protected abstract FilteredText filterText(String p_361873_, ServerTextFilter.IgnoreStrategy p_364388_, com.google.gson.JsonObject p_365044_) -
parseMask
protected FilterMask parseMask(String p_360987_, com.google.gson.JsonArray p_362850_, ServerTextFilter.IgnoreStrategy p_361890_) -
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-
drainStream
- Throws:
IOException
-
processRequestResponse
private com.google.gson.JsonObject processRequestResponse(com.google.gson.JsonObject p_360751_, URL p_364299_) throws IOException - Throws:
IOException
-
makeRequest
protected HttpURLConnection makeRequest(com.google.gson.JsonObject p_365284_, URL p_360402_) throws IOException - Throws:
IOException
-
setAuthorizationProperty
-
connectionReadTimeout
protected int connectionReadTimeout() -
getURLConnection
- Throws:
IOException
-
createContext
-