Use official mappings for in-repo patches, will be converted to SRG during build.

This commit is contained in:
LexManos committed 2023-09-11 14:47:34 -07:00
1 parent 4786fa6f89
commit 40a7998281
641 files changed
+9696 -9678

No files matched your search

@@ -1,52 +1,52 @@
--- a/net/minecraft/server/ReloadableServerResources.java
+++ b/net/minecraft/server/ReloadableServerResources.java
@@ -29,10 +_,10 @@
private static final CompletableFuture<Unit> f_206846_ = CompletableFuture.completedFuture(Unit.INSTANCE);
private final CommandBuildContext.Configurable f_214300_;
private final Commands f_206847_;
- private final RecipeManager f_206848_ = new RecipeManager();
+ private final RecipeManager f_206848_;
private final TagManager f_206849_;
private final LootDataManager f_278467_ = new LootDataManager();
- private final ServerAdvancementManager f_206853_ = new ServerAdvancementManager(this.f_278467_);
+ private final ServerAdvancementManager f_206853_;
private final ServerFunctionLibrary f_206854_;
private static final CompletableFuture<Unit> DATA_RELOAD_INITIAL_TASK = CompletableFuture.completedFuture(Unit.INSTANCE);
private final CommandBuildContext.Configurable commandBuildContext;
private final Commands commands;
- private final RecipeManager recipes = new RecipeManager();
+ private final RecipeManager recipes;
private final TagManager tagManager;
private final LootDataManager lootData = new LootDataManager();
- private final ServerAdvancementManager advancements = new ServerAdvancementManager(this.lootData);
+ private final ServerAdvancementManager advancements;
private final ServerFunctionLibrary functionLibrary;
public ReloadableServerResources(RegistryAccess.Frozen p_206857_, FeatureFlagSet p_250695_, Commands.CommandSelection p_206858_, int p_206859_) {
@@ -41,6 +_,10 @@
this.f_206847_ = new Commands(p_206858_, this.f_214300_);
this.f_214300_.m_254905_(CommandBuildContext.MissingTagAccessPolicy.CREATE_NEW);
this.f_206854_ = new ServerFunctionLibrary(p_206859_, this.f_206847_.m_82094_());
this.commands = new Commands(p_206858_, this.commandBuildContext);
this.commandBuildContext.missingTagAccessPolicy(CommandBuildContext.MissingTagAccessPolicy.CREATE_NEW);
this.functionLibrary = new ServerFunctionLibrary(p_206859_, this.commands.getDispatcher());
+ // Forge: Create context object and pass it to the recipe manager.
+ this.context = new net.minecraftforge.common.crafting.conditions.ConditionContext(this.f_206849_);
+ this.f_206848_ = new RecipeManager(context);
+ this.f_206853_ = new ServerAdvancementManager(this.f_278467_, context);
+ this.context = new net.minecraftforge.common.crafting.conditions.ConditionContext(this.tagManager);
+ this.recipes = new RecipeManager(context);
+ this.advancements = new ServerAdvancementManager(this.lootData, context);
}
public ServerFunctionLibrary m_206860_() {
public ServerFunctionLibrary getFunctionLibrary() {
@@ -69,7 +_,9 @@
public static CompletableFuture<ReloadableServerResources> m_247740_(ResourceManager p_248588_, RegistryAccess.Frozen p_251163_, FeatureFlagSet p_250212_, Commands.CommandSelection p_249301_, int p_251126_, Executor p_249136_, Executor p_249601_) {
public static CompletableFuture<ReloadableServerResources> loadResources(ResourceManager p_248588_, RegistryAccess.Frozen p_251163_, FeatureFlagSet p_250212_, Commands.CommandSelection p_249301_, int p_251126_, Executor p_249136_, Executor p_249601_) {
ReloadableServerResources reloadableserverresources = new ReloadableServerResources(p_251163_, p_250212_, p_249301_, p_251126_);
- return SimpleReloadInstance.m_203834_(p_248588_, reloadableserverresources.m_206890_(), p_249136_, p_249601_, f_206846_, f_206845_.isDebugEnabled()).m_7237_().whenComplete((p_255534_, p_255535_) -> {
+ List<PreparableReloadListener> listeners = new java.util.ArrayList<>(reloadableserverresources.m_206890_());
- return SimpleReloadInstance.create(p_248588_, reloadableserverresources.listeners(), p_249136_, p_249601_, DATA_RELOAD_INITIAL_TASK, LOGGER.isDebugEnabled()).done().whenComplete((p_255534_, p_255535_) -> {
+ List<PreparableReloadListener> listeners = new java.util.ArrayList<>(reloadableserverresources.listeners());
+ listeners.addAll(net.minecraftforge.event.ForgeEventFactory.onResourceReload(reloadableserverresources, p_251163_));
+ return SimpleReloadInstance.m_203834_(p_248588_, listeners, p_249136_, p_249601_, f_206846_, f_206845_.isDebugEnabled()).m_7237_().whenComplete((p_214309_, p_214310_) -> {
reloadableserverresources.f_214300_.m_254905_(CommandBuildContext.MissingTagAccessPolicy.FAIL);
+ return SimpleReloadInstance.create(p_248588_, listeners, p_249136_, p_249601_, DATA_RELOAD_INITIAL_TASK, LOGGER.isDebugEnabled()).done().whenComplete((p_214309_, p_214310_) -> {
reloadableserverresources.commandBuildContext.missingTagAccessPolicy(CommandBuildContext.MissingTagAccessPolicy.FAIL);
}).thenApply((p_214306_) -> {
return reloadableserverresources;
@@ -81,6 +_,7 @@
m_206870_(p_206869_, p_214315_);
updateRegistryTags(p_206869_, p_214315_);
});
Blocks.m_50758_();
Blocks.rebuildCache();
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.TagsUpdatedEvent(p_206869_, false, false));
}
private static <T> void m_206870_(RegistryAccess p_206871_, TagManager.LoadResult<T> p_206872_) {
private static <T> void updateRegistryTags(RegistryAccess p_206871_, TagManager.LoadResult<T> p_206872_) {
@@ -91,5 +_,16 @@
return List.copyOf(p_214312_.getValue());
}));
p_206871_.m_175515_(resourcekey).m_203652_(map);
p_206871_.registryOrThrow(resourcekey).bindTags(map);
+ }
+
+ private final net.minecraftforge.common.crafting.conditions.ICondition.IContext context;