Skip to content

Commit

Permalink
[1.19.X] Client code cleanup, updates, and other refactors (Minecraft…
Browse files Browse the repository at this point in the history
…Forge#8786)

* Revert "Allow safely registering RenderType predicates at any time (MinecraftForge#8685)"

This reverts commit be72754.

* Renderable API refactors
- Rename "render values" to "context"
- Rename SimpleRenderable to CompositeRenderable to better reflect its use
- Remove IMultipartRenderValues since it doesn't have any real use
- Add extensive customization options to BakedModelRenderable

* ClientRegistry and MinecraftForgeClient refactors
- Add sprite loader manager and registration event
- Add spectator shader manager and registration event
- Add client tooltip factory manager and registration event
- Add recipe book manager and registration event
- Add key mapping registration event
- Remove ClientRegistry, as everything has been moved out of it
- Remove registration methods from MinecraftForgeClient, as they have dedicated events now

* Dimension special effects refactors
- Fold handlers into an extension class and remove public mutable fields
- Add dimension special effects manager and registration event

* HUD overlay refactors
- Rename to IGuiOverlay match vanilla (instead of Ingame)
- Add overlay manager and registration event
- Move vanilla overlays to a standalone enum

* Model loader refactors
- Rename IModelLoader to IGeometryLoader
- Add loader manager and registration event
- Fold all model events into one
- Move registration of additionally loaded models to an event
- Remove ForgeModelBakery and related classes as they served no purpose anymore

* Render properties refactors
- Rename all render properties to client extensions and relocate accordingly
- Move lookups to the respective interfaces

* Model data refactors
- Convert model data to a final class backed by an immutable map and document mutability requirements. This addresses several thread-safety issues in the current implementation which could result in race conditions
- Transfer ownership of the data manager to the client level. This addresses several issues that arise when multiple levels are used at once

* GUI and widget refactors
- Move all widgets to the correct package
- Rename GuiUtils and children to match vanilla naming

* New vertex pipeline API
- Move to vanilla's VertexConsumer
- Roll back recent PR making VertexConsumer format-aware. This is the opposite of what vanilla does, and should not be relevant with the updated lighting pipeline

* Lighting pipeline refactors
- Move to dedicated lighting package
- Separate flat and smooth lighters
- Convert from a vertex pipeline transformer to a pure vertex source (input is baked quads)

* Model geometry API refactors
- Rename IModelGeometry to IUnbakedGeometry
- Rename IModelConfiguration to IGeometryBakingContext
- Rename other elements to match vanilla naming
- Remove current changes to ModelState, as they do not belong there. Transforms should be specified through vanilla's system. ModelState is intended to transfer state from the blockstate JSON
- Remove multipart geometries and geometry parts. After some discussion, these should not be exposed. Instead, geometries should be baked with only the necessary parts enabled

* Make render types a first-class citizen in baked models
- Add named render types (block + entity + fabulous entity)
- Add named render type manager + registration event
- Make BakedModel aware of render types and transfer control over which ones are used to it instead of ItemBlockRenderTypes (fallback)
- (additional) Add concatenated list view. A wrapper for multiple lists that iterates through them in order without the cost of merging them. Useful for merging lists of baked quads

* General event refactors
- Several renames to either match vanilla or improve clarity
- Relocate client chat event dispatching out of common code

* Forge model type refactors
- Rename SeparatePerspectiveModel to SeparateTransformsModel
- Rename ItemModelMesherForge to ForgeItemModelShaper
- Rename DynamicBucketModel to DynamicFluidContainerModel
- Prefix all OBJ-related classes with "Obj" and decouple parsing from construction
- Extract ElementsModel from model loader registry
- Add EmptyModel (baked, unbaked and loader)
- Refactor CompositeModel to take over ItemMultiLayerBakedModel
- Remove FluidModel as it's not used and isn't compatible with the new fluid rendering in modern versions
- Move model loader registration to a proper event handler
- Update names of several JSON fields (backwards-compatible)
- Update datagens to match

* Miscellaneous changes and overlapping patches
- Dispatch all new registration events
- Convert ExtendedServerListData to a record
- Add/remove hooks from ForgeHooksClient as necessary

* Update test mods

* Fix VertexConsumerWrapper returning parent instead of itself

* Additional event cleanup pass

As discussed on Discord:
- Remove "@hidden" and "@see <callsite>" javadoc annotations from all client events and replace them with @ApiStatus.Internal annotation
- Make all events that shouldn't be fired directly into abstract classes with protected constructors
- Another styling pass, just in case (caught some missed classes)

* Add proper deprecation javadocs and de-dupe some vertex consumer code

* Replace sets of chunk render types with a faster BitSet-backed collection

This largely addresses potential performance concerns that using a plain HashSet might involve by making lookups and iteration as linear as they can likely be (aside from using a plain byte/int/long for bit storage). Further performance concerns related to the implementation may be addressed separately, as all the implementation details are hidden from the end user

* Requested changes

- Remove MinecraftForgeClient and move members to Minecraft, IForgeMinecraft and StencilManager
- Allow non-default elements to be passed into VertexConsumer and add support to derived classes
- Move array instantiation out of quad processing in lighting pipeline
- Fix flipped fluid container model
- Set default UV1 to the correct values in the remapping pipeline
- Minor documentation changes

* Add/update EXC entries and fix AT comment

* Add test mod as per Orion's request

* Additional requested changes

* Allow custom model types to request the particle texture to be loaded

* Even more requested changes

* Improve generics in ConcatenatedListView and add missing fallbacks

* Fix fluid render types being bound to the fluid and not its holder

* Remove non-contractual nullability in ChunkRenderTypeSet and add isEmpty

Additionally, introduce chunk render type checks in ItemBlockRenderTypes

Co-authored-by: Dennis C <[email protected]>
  • Loading branch information
amadornes and XFactHD authored Jul 7, 2022
1 parent c2225ab commit 4d074f0
Show file tree
Hide file tree
Showing 295 changed files with 9,819 additions and 11,494 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/com/mojang/blaze3d/vertex/BufferBuilder.java
+++ b/com/mojang/blaze3d/vertex/BufferBuilder.java
@@ -486,4 +_,16 @@
@@ -486,4 +_,13 @@
this.f_166822_ = p_166829_;
}
}
Expand All @@ -13,7 +13,4 @@
+ this.f_85654_ += buffer.limit() / this.f_85658_.m_86020_();
+ this.f_85652_ += buffer.limit();
+ }
+
+ @Override
+ public VertexFormat getVertexFormat() { return this.f_85658_; }
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,18 @@
VertexConsumer m_5483_(double p_85945_, double p_85946_, double p_85947_);

VertexConsumer m_6122_(int p_85973_, int p_85974_, int p_85975_, int p_85976_);
@@ -101,11 +_,12 @@
@@ -64,6 +_,10 @@
}

default void m_85995_(PoseStack.Pose p_85996_, BakedQuad p_85997_, float[] p_85998_, float p_85999_, float p_86000_, float p_86001_, int[] p_86002_, int p_86003_, boolean p_86004_) {
+ putBulkData(p_85996_, p_85997_, p_85998_, p_85999_, p_86000_, p_86001_, 1, p_86002_, p_86003_, p_86004_);
+ }
+
+ default void putBulkData(PoseStack.Pose p_85996_, BakedQuad p_85997_, float[] p_85998_, float p_85999_, float p_86000_, float p_86001_, float alpha, int[] p_86002_, int p_86003_, boolean p_86004_) {
float[] afloat = new float[]{p_85998_[0], p_85998_[1], p_85998_[2], p_85998_[3]};
int[] aint = new int[]{p_86002_[0], p_86002_[1], p_86002_[2], p_86002_[3]};
int[] aint1 = p_85997_.m_111303_();
@@ -101,12 +_,14 @@
f5 = afloat[k] * p_86001_;
}

Expand All @@ -19,7 +30,10 @@
float f10 = bytebuffer.getFloat(20);
Vector4f vector4f = new Vector4f(f, f1, f2, 1.0F);
vector4f.m_123607_(matrix4f);
- this.m_5954_(vector4f.m_123601_(), vector4f.m_123615_(), vector4f.m_123616_(), f3, f4, f5, 1.0F, f9, f10, p_86003_, l, vector3f.m_122239_(), vector3f.m_122260_(), vector3f.m_122269_());
+ applyBakedNormals(vector3f, bytebuffer, p_85996_.m_85864_());
this.m_5954_(vector4f.m_123601_(), vector4f.m_123615_(), vector4f.m_123616_(), f3, f4, f5, 1.0F, f9, f10, p_86003_, l, vector3f.m_122239_(), vector3f.m_122260_(), vector3f.m_122269_());
+ float vertexAlpha = p_86004_ ? alpha * (float) (bytebuffer.get(15) & 255) / 255.0F : alpha;
+ this.m_5954_(vector4f.m_123601_(), vector4f.m_123615_(), vector4f.m_123616_(), f3, f4, f5, vertexAlpha, f9, f10, p_86003_, l, vector3f.m_122239_(), vector3f.m_122260_(), vector3f.m_122269_());
}
} catch (Throwable throwable1) {
if (memorystack != null) {

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
} else if (recipetype == RecipeType.f_44113_) {
return RecipeBookCategories.SMITHING;
} else {
+ RecipeBookCategories categories = net.minecraftforge.client.RecipeBookRegistry.findCategories(recipetype, p_90647_);
+ RecipeBookCategories categories = net.minecraftforge.client.RecipeBookManager.findCategories((RecipeType) recipetype, p_90647_);
+ if (categories != null) return categories;
f_90618_.warn("Unknown recipe category: {}/{}", LogUtils.defer(() -> {
return Registry.f_122864_.m_7981_(p_90647_.m_6671_());
Expand Down
40 changes: 6 additions & 34 deletions patches/minecraft/net/minecraft/client/KeyMapping.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -8,48 +8,20 @@
+public class KeyMapping implements Comparable<KeyMapping>, net.minecraftforge.client.extensions.IForgeKeyMapping {
private static final Map<String, KeyMapping> f_90809_ = Maps.newHashMap();
- private static final Map<InputConstants.Key, KeyMapping> f_90810_ = Maps.newHashMap();
+ private static final net.minecraftforge.client.settings.KeyBindingMap f_90810_ = new net.minecraftforge.client.settings.KeyBindingMap();
+ private static final net.minecraftforge.client.settings.KeyMappingLookup f_90810_ = new net.minecraftforge.client.settings.KeyMappingLookup();
private static final Set<String> f_90811_ = Sets.newHashSet();
public static final String f_167805_ = "key.categories.movement";
public static final String f_167806_ = "key.categories.misc";
@@ -41,7 +_,7 @@
private int f_90818_;

public static void m_90835_(InputConstants.Key p_90836_) {
- KeyMapping keymapping = f_90810_.get(p_90836_);
+ KeyMapping keymapping = f_90810_.lookupActive(p_90836_);
if (keymapping != null) {
++keymapping.f_90818_;
}
@@ -49,7 +_,7 @@
}

public static void m_90837_(InputConstants.Key p_90838_, boolean p_90839_) {
- KeyMapping keymapping = f_90810_.get(p_90838_);
+ for (KeyMapping keymapping : f_90810_.lookupAll(p_90838_))
+ for (KeyMapping keymapping : f_90810_.getAll(p_90838_))
if (keymapping != null) {
keymapping.m_7249_(p_90839_);
}
@@ -73,10 +_,10 @@
}

public static void m_90854_() {
- f_90810_.clear();
+ f_90810_.clearMap();

for(KeyMapping keymapping : f_90809_.values()) {
- f_90810_.put(keymapping.f_90816_, keymapping);
+ f_90810_.addKey(keymapping.f_90816_, keymapping);
}

}
@@ -91,12 +_,12 @@
this.f_90814_ = this.f_90816_;
this.f_90815_ = p_90828_;
f_90809_.put(p_90825_, this);
- f_90810_.put(this.f_90816_, this);
+ f_90810_.addKey(this.f_90816_, this);
f_90811_.add(p_90828_);
@@ -96,7 +_,7 @@
}

public boolean m_90857_() {
Expand Down Expand Up @@ -154,7 +126,7 @@
+ if (this.keyModifier.matches(keyCode))
+ this.keyModifier = net.minecraftforge.client.settings.KeyModifier.NONE;
+ f_90809_.put(description, this);
+ f_90810_.addKey(keyCode, this);
+ f_90810_.put(keyCode, this);
+ f_90811_.add(category);
+ }
+
Expand Down Expand Up @@ -188,9 +160,9 @@
+ this.f_90816_ = keyCode;
+ if (keyModifier.matches(keyCode))
+ keyModifier = net.minecraftforge.client.settings.KeyModifier.NONE;
+ f_90810_.removeKey(this);
+ f_90810_.remove(this);
+ this.keyModifier = keyModifier;
+ f_90810_.addKey(keyCode, this);
+ f_90810_.put(keyCode, this);
+ }
+ /****************** Forge End *****************************/
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
}
}
-
+ net.minecraftforge.client.ForgeHooksClient.fireKeyInput(p_90895_, p_90896_, p_90897_, p_90898_);
+ net.minecraftforge.client.ForgeHooksClient.onKeyInput(p_90895_, p_90896_, p_90897_, p_90898_);
}
}

Expand Down
65 changes: 45 additions & 20 deletions patches/minecraft/net/minecraft/client/Minecraft.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
this.m_91271_();
this.f_91036_.m_7217_(this.f_90997_);
this.f_91061_ = new ParticleEngine(this.f_91073_, this.f_90987_);
+ net.minecraftforge.fml.ModLoader.get().postEvent(new net.minecraftforge.client.event.ParticleFactoryRegisterEvent());
+ net.minecraftforge.client.ForgeHooksClient.onRegisterParticleProviders(f_91061_);
this.f_91036_.m_7217_(this.f_91061_);
this.f_91053_ = new PaintingTextureManager(this.f_90987_);
this.f_91036_.m_7217_(this.f_91053_);
Expand All @@ -55,19 +55,27 @@
this.f_91036_.m_7217_(this.f_91047_);
this.f_91036_.m_7217_(this.f_205120_);
- this.f_91065_ = new Gui(this, this.f_90995_);
+ this.f_91065_ = new net.minecraftforge.client.gui.ForgeIngameGui(this);
+ this.f_91065_ = new net.minecraftforge.client.gui.overlay.ForgeGui(this);
+ this.f_91067_.m_91524_(this.f_90990_.m_85439_()); //Forge: Moved below ingameGUI setting to prevent NPEs in handeler.
this.f_91064_ = new DebugRenderer(this);
RenderSystem.m_69900_(this::m_91113_);
if (this.f_91042_.f_83915_ == this.f_90990_.m_85441_() && this.f_91042_.f_83916_ == this.f_90990_.m_85442_()) {
@@ -526,6 +_,11 @@
@@ -526,6 +_,19 @@
TinyFileDialogs.tinyfd_messageBox("Minecraft", stringbuilder.toString(), "ok", "error", false);
}

+ net.minecraftforge.gametest.ForgeGameTestHooks.registerGametests();
+ net.minecraftforge.fml.ModLoader.get().postEvent(new net.minecraftforge.client.event.RegisterClientReloadListenersEvent(this.f_91036_));
+ net.minecraftforge.fml.ModLoader.get().postEvent(new net.minecraftforge.client.event.EntityRenderersEvent.RegisterLayerDefinitions());
+ net.minecraftforge.fml.ModLoader.get().postEvent(new net.minecraftforge.client.event.EntityRenderersEvent.RegisterRenderers());
+ net.minecraftforge.client.textures.TextureAtlasSpriteLoaderManager.init();
+ net.minecraftforge.client.gui.ClientTooltipComponentManager.init();
+ net.minecraftforge.client.EntitySpectatorShaderManager.init();
+ net.minecraftforge.client.ForgeHooksClient.onRegisterKeyMappings(f_91066_);
+ net.minecraftforge.client.RecipeBookManager.init();
+ net.minecraftforge.client.gui.overlay.GuiOverlayManager.init();
+ net.minecraftforge.client.DimensionSpecialEffectsManager.init();
+ net.minecraftforge.client.NamedRenderTypeManager.init();
+
this.f_90990_.m_85409_(this.f_91066_.m_231817_().m_231551_());
this.f_90990_.m_85424_(this.f_91066_.m_232123_().m_231551_());
Expand Down Expand Up @@ -140,33 +148,38 @@
if (p_91153_ == null && this.f_91073_ == null) {
p_91153_ = new TitleScreen();
} else if (p_91153_ == null && this.f_91074_.m_21224_()) {
@@ -906,6 +_,15 @@
@@ -906,6 +_,19 @@
}
}

+ net.minecraftforge.client.ForgeHooksClient.clearGuiLayers(this);
+ Screen old = this.f_91080_;
+ net.minecraftforge.client.event.ScreenOpenEvent event = new net.minecraftforge.client.event.ScreenOpenEvent(p_91153_);
+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) return;
+ if (p_91153_ != null) {
+ var event = new net.minecraftforge.client.event.ScreenEvent.Opening(old, p_91153_);
+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) return;
+ p_91153_ = event.getScreen();
+ }
+
+ p_91153_ = event.getScreen();
+ if (old != null && p_91153_ != old)
+ if (old != null && p_91153_ != old) {
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.ScreenEvent.Closing(old));
+ old.m_7861_();
+ }
+
this.f_91080_ = p_91153_;
BufferUploader.m_166835_();
if (p_91153_ != null) {
@@ -1049,11 +_,13 @@
@@ -1049,11 +_,14 @@
RenderSystem.m_69481_();
this.f_91026_.m_7238_();
if (!this.f_91079_) {
+ net.minecraftforge.event.ForgeEventFactory.onRenderTickStart(this.f_91012_ ? this.f_91013_ : this.f_90991_.f_92518_);
+ this.realPartialTick = this.f_91012_ ? this.f_91013_ : this.f_90991_.f_92518_; // Cache this since pause is volatile
+ net.minecraftforge.event.ForgeEventFactory.onRenderTickStart(this.realPartialTick);
this.f_91026_.m_6182_("gameRenderer");
this.f_91063_.m_109093_(this.f_91012_ ? this.f_91013_ : this.f_90991_.f_92518_, i, p_91384_);
this.f_91026_.m_6182_("toasts");
this.f_91003_.m_94920_(new PoseStack());
this.f_91026_.m_7238_();
+ net.minecraftforge.event.ForgeEventFactory.onRenderTickEnd(this.f_91012_ ? this.f_91013_ : this.f_90991_.f_92518_);
+ net.minecraftforge.event.ForgeEventFactory.onRenderTickEnd(this.realPartialTick);
}

if (this.f_91056_ != null) {
Expand Down Expand Up @@ -197,7 +210,7 @@
BlockPos blockpos = blockhitresult.m_82425_();
- if (!this.f_91073_.m_8055_(blockpos).m_60795_()) {
+ if (!this.f_91073_.m_46859_(blockpos)) {
+ net.minecraftforge.client.event.InputEvent.ClickInputEvent inputEvent = net.minecraftforge.client.ForgeHooksClient.onClickInput(0, this.f_91066_.f_92096_, InteractionHand.MAIN_HAND);
+ var inputEvent = net.minecraftforge.client.ForgeHooksClient.onClickInput(0, this.f_91066_.f_92096_, InteractionHand.MAIN_HAND);
+ if (inputEvent.isCanceled()) {
+ if (inputEvent.shouldSwingHand()) {
+ this.f_91061_.addBlockHitEffects(blockpos, blockhitresult);
Expand All @@ -218,7 +231,7 @@
} else {
boolean flag = false;
- switch (this.f_91077_.m_6662_()) {
+ net.minecraftforge.client.event.InputEvent.ClickInputEvent inputEvent = net.minecraftforge.client.ForgeHooksClient.onClickInput(0, this.f_91066_.f_92096_, InteractionHand.MAIN_HAND);
+ var inputEvent = net.minecraftforge.client.ForgeHooksClient.onClickInput(0, this.f_91066_.f_92096_, InteractionHand.MAIN_HAND);
+ HitResult.Type hitType = this.f_91077_.m_6662_();
+ if(this.f_91077_ instanceof EntityHitResult entityHit) { // Forge: Perform attack range checks here, instead of in GameRenderer#pick, so extended-reach interactions work.
+ if(!f_91074_.canHit(entityHit.m_82443_(), 0)) hitType = HitResult.Type.MISS; // No padding in client code.
Expand Down Expand Up @@ -251,7 +264,7 @@
}

for(InteractionHand interactionhand : InteractionHand.values()) {
+ net.minecraftforge.client.event.InputEvent.ClickInputEvent inputEvent = net.minecraftforge.client.ForgeHooksClient.onClickInput(1, this.f_91066_.f_92095_, interactionhand);
+ var inputEvent = net.minecraftforge.client.ForgeHooksClient.onClickInput(1, this.f_91066_.f_92095_, interactionhand);
+ if (inputEvent.isCanceled()) {
+ if (inputEvent.shouldSwingHand()) this.f_91074_.m_6674_(interactionhand);
+ return;
Expand Down Expand Up @@ -441,18 +454,30 @@
}

private static Supplier<PackResources> m_91330_(Supplier<PackResources> p_91331_) {
@@ -2660,6 +_,14 @@

public void m_91312_(int p_91313_) {
@@ -2662,6 +_,14 @@
this.f_91051_.m_119410_(p_91313_);
+ }
+
}
+ public ItemColors getItemColors() {
+ return this.f_91041_;
+ }
+
+ public SearchRegistry getSearchTreeManager() {
+ return this.f_90997_;
+ }
+
public EntityModelSet m_167973_() {
return this.f_167844_;
}
@@ -2719,4 +_,11 @@

public EntityModelSet m_167973_() {
public abstract boolean m_142594_(boolean p_168035_);
}
+
+ // FORGE START
+ private float realPartialTick;
+ public float getPartialTick() {
+ return realPartialTick;
+ }
+ // FORGE END
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
this.f_91510_ = -1;
}

+ if (net.minecraftforge.client.ForgeHooksClient.onRawMouseClicked(p_91532_, p_91533_, p_91534_)) return;
+ if (net.minecraftforge.client.ForgeHooksClient.onMouseButtonPre(p_91532_, p_91533_, p_91534_)) return;
boolean[] aboolean = new boolean[]{false};
if (this.f_91503_.m_91265_() == null) {
if (this.f_91503_.f_91080_ == null) {
Expand Down Expand Up @@ -35,7 +35,7 @@
}
}
-
+ net.minecraftforge.client.ForgeHooksClient.fireMouseInput(p_91532_, p_91533_, p_91534_);
+ net.minecraftforge.client.ForgeHooksClient.onMouseButtonPost(p_91532_, p_91533_, p_91534_);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,16 @@
public static final List<RecipeBookCategories> f_92258_ = ImmutableList.of(FURNACE_SEARCH, FURNACE_FOOD, FURNACE_BLOCKS, FURNACE_MISC);
public static final List<RecipeBookCategories> f_92259_ = ImmutableList.of(CRAFTING_SEARCH, CRAFTING_EQUIPMENT, CRAFTING_BUILDING_BLOCKS, CRAFTING_MISC, CRAFTING_REDSTONE);
- public static final Map<RecipeBookCategories, List<RecipeBookCategories>> f_92260_ = ImmutableMap.of(CRAFTING_SEARCH, ImmutableList.of(CRAFTING_EQUIPMENT, CRAFTING_BUILDING_BLOCKS, CRAFTING_MISC, CRAFTING_REDSTONE), FURNACE_SEARCH, ImmutableList.of(FURNACE_FOOD, FURNACE_BLOCKS, FURNACE_MISC), BLAST_FURNACE_SEARCH, ImmutableList.of(BLAST_FURNACE_BLOCKS, BLAST_FURNACE_MISC), SMOKER_SEARCH, ImmutableList.of(SMOKER_FOOD));
+ public static final Map<RecipeBookCategories, List<RecipeBookCategories>> f_92260_ = net.minecraftforge.client.RecipeBookRegistry.AGGREGATE_CATEGORIES_VIEW;
+ public static final Map<RecipeBookCategories, List<RecipeBookCategories>> f_92260_ = net.minecraftforge.client.RecipeBookManager.getAggregateCategories();
private final List<ItemStack> f_92261_;

private RecipeBookCategories(ItemStack... p_92267_) {
@@ -54,11 +_,17 @@
@@ -54,11 +_,15 @@
case SMOKER:
return f_92256_;
default:
+ if (net.minecraftforge.client.RecipeBookRegistry.TYPE_TO_CATEGORIES_VIEW.containsKey(p_92270_))
+ return net.minecraftforge.client.RecipeBookRegistry.TYPE_TO_CATEGORIES_VIEW.get(p_92270_);
return ImmutableList.of();
- return ImmutableList.of();
+ return net.minecraftforge.client.RecipeBookManager.getCustomCategoriesOrEmpty(p_92270_);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
if (blockcolor != null) {
return blockcolor.m_92566_(p_92583_, (BlockAndTintGetter)null, (BlockPos)null, 0);
} else {
@@ -87,13 +_,13 @@
@@ -87,13 +_,15 @@
}

public int m_92577_(BlockState p_92578_, @Nullable BlockAndTintGetter p_92579_, @Nullable BlockPos p_92580_, int p_92581_) {
Expand All @@ -33,6 +33,8 @@
return blockcolor == null ? -1 : blockcolor.m_92566_(p_92578_, p_92579_, p_92580_, p_92581_);
}

+ /** @deprecated Register via {@link net.minecraftforge.client.event.RegisterColorHandlersEvent.Block} */
+ @Deprecated
public void m_92589_(BlockColor p_92590_, Block... p_92591_) {
for(Block block : p_92591_) {
- this.f_92571_.m_122664_(p_92590_, Registry.f_122824_.m_7447_(block));
Expand Down
Loading

0 comments on commit 4d074f0

Please sign in to comment.