Remove the remnants of the selective reload listener (#8072)

This commit is contained in:
ichttt authored and GitHub committed 2021-11-09 14:30:45 -08:00
1 parent dc9a7f6ad5
commit a784bdb0d0
18 files changed
+16 -131

No files matched your search

@@ -144,14 +144,6 @@
}
}
@@ -779,6 +_,7 @@
return this.m_168019_(false);
}
+ @Deprecated // Forge: Use selective refreshResources method in FMLClientHandler
private CompletableFuture<Void> m_168019_(boolean p_168020_) {
if (this.f_91024_ != null) {
return this.f_91024_;
@@ -876,10 +_,6 @@
f_90982_.error("setScreen called from non-game thread");
}
@@ -501,14 +493,6 @@
}
}
@@ -2318,6 +_,7 @@
return f_90981_;
}
+ @Deprecated // Forge: Use selective scheduleResourceRefresh method in FMLClientHandler
public CompletableFuture<Void> m_91088_() {
return this.m_18691_(() -> this.m_91391_()).thenCompose((p_167945_) -> {
return p_167945_;
@@ -2768,7 +_,7 @@
return this.f_90993_;
}
@@ -1,11 +0,0 @@
--- a/net/minecraft/client/gui/screens/LanguageSelectScreen.java
+++ b/net/minecraft/client/gui/screens/LanguageSelectScreen.java
@@ -36,7 +_,7 @@
if (languageselectscreen$languageselectionlist$entry != null && !languageselectscreen$languageselectionlist$entry.f_96116_.getCode().equals(this.f_96080_.m_118983_().getCode())) {
this.f_96080_.m_118974_(languageselectscreen$languageselectionlist$entry.f_96116_);
this.f_96282_.f_92075_ = languageselectscreen$languageselectionlist$entry.f_96116_.getCode();
- this.f_96541_.m_91391_();
+ net.minecraftforge.client.ForgeHooksClient.refreshResources(this.f_96541_, net.minecraftforge.resource.VanillaResourceType.LANGUAGES);
this.f_96282_.m_92169_();
}
@@ -18,12 +18,3 @@
}
}
@@ -462,7 +_,7 @@
languagemanager.m_118974_(languageinfo);
this.f_100272_.f_91066_.f_92075_ = languageinfo.getCode();
- this.f_100272_.m_91391_();
+ net.minecraftforge.client.ForgeHooksClient.refreshResources(this.f_100272_, net.minecraftforge.resource.VanillaResourceType.LANGUAGES);
this.f_100272_.f_91066_.m_92169_();
}
@@ -67,15 +67,3 @@
this.f_109059_.m_91307_().m_6182_("hand");
if (this.f_109070_) {
RenderSystem.m_69421_(256, Minecraft.f_91002_);
@@ -1151,6 +_,11 @@
public OverlayTexture m_109155_() {
return this.f_109075_;
+ }
+
+ @Override
+ public net.minecraftforge.resource.IResourceType getResourceType() {
+ return net.minecraftforge.resource.VanillaResourceType.SHADERS;
}
@Nullable
@@ -198,15 +198,3 @@
if (j < k) {
j = k;
}
@@ -2748,6 +_,11 @@
@Nullable
public RenderTarget m_109832_() {
return this.f_109417_;
+ }
+
+ @Override
+ public net.minecraftforge.resource.IResourceType getResourceType() {
+ return net.minecraftforge.resource.VanillaResourceType.MODELS;
}
@OnlyIn(Dist.CLIENT)
@@ -64,14 +64,3 @@
}
}
@@ -105,5 +_,10 @@
public void m_6213_(ResourceManager p_110909_) {
this.f_110901_.m_110944_();
+ }
+
+ @Override
+ public net.minecraftforge.resource.IResourceType getResourceType() {
+ return net.minecraftforge.resource.VanillaResourceType.MODELS;
}
}
@@ -76,7 +76,7 @@
this.m_115152_(bufferbuilder, p_115177_ + 2, p_115178_ + 13, 13, 2, 0, 0, 0, 255);
this.m_115152_(bufferbuilder, p_115177_ + 2, p_115178_ + 13, i, 1, j >> 16 & 255, j >> 8 & 255, j & 255, 255);
RenderSystem.m_69478_();
@@ -377,5 +_,14 @@
@@ -377,5 +_,9 @@
public void m_6213_(ResourceManager p_115105_) {
this.f_115095_.m_109403_();
@@ -84,10 +84,5 @@
+
+ public BlockEntityWithoutLevelRenderer getBlockEntityRenderer() {
+ return f_174223_;
+ }
+
+ @Override
+ public net.minecraftforge.resource.IResourceType getResourceType() {
+ return net.minecraftforge.resource.VanillaResourceType.MODELS;
}
}
@@ -1,12 +0,0 @@
--- a/net/minecraft/client/resources/language/LanguageManager.java
+++ b/net/minecraft/client/resources/language/LanguageManager.java
@@ -80,4 +_,9 @@
public LanguageInfo m_118976_(String p_118977_) {
return this.f_118966_.get(p_118977_);
}
+
+ @Override
+ public net.minecraftforge.resource.IResourceType getResourceType() {
+ return net.minecraftforge.resource.VanillaResourceType.LANGUAGES;
+ }
}
@@ -1,14 +0,0 @@
--- a/net/minecraft/client/searchtree/SearchRegistry.java
+++ b/net/minecraft/client/searchtree/SearchRegistry.java
@@ -31,6 +_,11 @@
return (MutableSearchTree<T>)this.f_119944_.get(p_119950_);
}
+ @Override
+ public net.minecraftforge.resource.IResourceType getResourceType() {
+ return net.minecraftforge.resource.VanillaResourceType.LANGUAGES;
+ }
+
@OnlyIn(Dist.CLIENT)
public static class Key<T> {
}
@@ -1,22 +1,12 @@
--- a/net/minecraft/server/packs/resources/ResourceManagerReloadListener.java
+++ b/net/minecraft/server/packs/resources/ResourceManagerReloadListener.java
@@ -5,6 +_,11 @@
import net.minecraft.util.Unit;
import net.minecraft.util.profiling.ProfilerFiller;
+/**
+ * @deprecated Forge: {@link net.minecraftforge.resource.ISelectiveResourceReloadListener}, which selectively allows
+ * individual resource types being reloaded should rather be used where possible.
+ */
+@Deprecated
public interface ResourceManagerReloadListener extends PreparableReloadListener {
default CompletableFuture<Void> m_5540_(PreparableReloadListener.PreparationBarrier p_10752_, ResourceManager p_10753_, ProfilerFiller p_10754_, ProfilerFiller p_10755_, Executor p_10756_, Executor p_10757_) {
return p_10752_.m_6769_(Unit.INSTANCE).thenRunAsync(() -> {
@@ -17,4 +_,9 @@
@@ -17,4 +_,11 @@
}
void m_6213_(ResourceManager p_10758_);
+
+ /** @deprecated Selective reloading is no longer supported due to vanilla now reloading resources in parallel, so this is no longer needed */
+ @Deprecated(since="1.17.1", forRemoval = true)
+ @javax.annotation.Nullable
+ default net.minecraftforge.resource.IResourceType getResourceType() {
+ return null;
@@ -699,6 +699,10 @@ public class ForgeHooksClient
MinecraftForge.EVENT_BUS.post(new InputUpdateEvent(player, movementInput));
}
/**
* @deprecated use {@link Minecraft#reloadResourcePacks()} instead
*/
@Deprecated(since="1.17.1", forRemoval = true)
public static void refreshResources(Minecraft mc, VanillaResourceType... types) {
mc.reloadResourcePacks();
}
@@ -39,8 +39,6 @@ import net.minecraftforge.client.ForgeHooksClient;
import net.minecraftforge.client.model.geometry.IModelGeometry;
import net.minecraftforge.fluids.FluidUtil;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.resource.IResourceType;
import net.minecraftforge.resource.VanillaResourceType;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -48,7 +46,6 @@ import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.*;
import java.util.function.Function;
import java.util.function.Predicate;
import net.minecraft.client.renderer.block.model.ItemOverrides;
import net.minecraft.client.resources.model.BakedModel;
@@ -192,12 +189,6 @@ public final class DynamicBucketModel implements IModelGeometry<DynamicBucketMod
{
INSTANCE;
@Override
public IResourceType getResourceType()
{
return VanillaResourceType.MODELS;
}
@Override
public void onResourceManagerReload(ResourceManager resourceManager)
{
@@ -21,13 +21,8 @@ package net.minecraftforge.client.model;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonObject;
import net.minecraft.server.packs.resources.ResourceManager;
import net.minecraft.server.packs.resources.ResourceManagerReloadListener;
import net.minecraftforge.client.model.geometry.IModelGeometry;
import net.minecraftforge.resource.IResourceType;
import net.minecraftforge.resource.VanillaResourceType;
import java.util.function.Predicate;
public interface IModelLoader<T extends IModelGeometry<T>> extends ResourceManagerReloadListener
{
@@ -46,7 +46,6 @@ import net.minecraft.client.renderer.texture.MissingTextureAtlasSprite;
import com.mojang.blaze3d.vertex.VertexFormatElement;
import net.minecraftforge.client.model.*;
import net.minecraftforge.common.model.*;
import net.minecraftforge.resource.IResourceType;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.tuple.Triple;
import org.apache.logging.log4j.LogManager;
@@ -113,6 +113,8 @@ public class ForgeConfig {
public final BooleanValue experimentalForgeLightPipelineEnabled;
/** @deprecated Selective reloading is no longer supported due to vanilla now reloading resources in parallel */
@Deprecated(since="1.17.1", forRemoval = true)
public final BooleanValue selectiveResourceReloadEnabled;
public final BooleanValue showLoadWarnings;
@@ -21,7 +21,9 @@ package net.minecraftforge.resource;
/**
* Represents a generic type of reloadable resource. Used for resource reload filtering.
* @deprecated Selective reloading is no longer supported due to vanilla now reloading resources in parallel
*/
@Deprecated(since="1.17.1", forRemoval = true)
public interface IResourceType
{
}
@@ -29,8 +29,10 @@ import net.minecraftforge.api.distmarker.OnlyIn;
/**
* Holds methods to create standard predicates to select {@link IResourceType}s that should be reloaded.
* @deprecated Selective reloading is no longer supported due to vanilla now reloading resources in parallel
*/
@OnlyIn(Dist.CLIENT)
@Deprecated(since="1.17.1", forRemoval = true)
public final class ReloadRequirements
{
/**
@@ -22,7 +22,9 @@ package net.minecraftforge.resource;
/**
* An enum of all {@link IResourceType}s used by the Vanilla game. These should be used if handling vanilla-related
* resources.
* @deprecated Selective reloading is no longer supported due to vanilla now reloading resources in parallel
*/
@Deprecated(since="1.17.1", forRemoval = true)
public enum VanillaResourceType implements IResourceType
{
/**