Fixed chained crafters not taking over the name of the root crafter. Fixes #3418
This commit is contained in:
		@@ -7,6 +7,10 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
## [Unreleased]
 | 
					## [Unreleased]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Fixed
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- Fixed chained crafters not taking over the name of the root crafter.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## [v1.11.1] - 2022-10-30
 | 
					## [v1.11.1] - 2022-10-30
 | 
				
			||||||
 | 
					
 | 
				
			||||||
### Fixed
 | 
					### Fixed
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -86,11 +86,23 @@ public interface ICraftingPatternContainer {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * The name of this container for categorizing in the Crafting Manager GUI.
 | 
					     * The name of this container for categorizing in the Crafting Manager GUI.
 | 
				
			||||||
 | 
					     * Will return the name of the root container if we're in a chained scenario.
 | 
				
			||||||
     *
 | 
					     *
 | 
				
			||||||
     * @return the name of this container
 | 
					     * @return the name of this container
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    Component getName();
 | 
					    Component getName();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * The custom name of this container, as set in an anvil for example.
 | 
				
			||||||
 | 
					     * Can be null.
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
 | 
					     * @return the name of this container
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    @Nullable
 | 
				
			||||||
 | 
					    default Component getCustomName() {
 | 
				
			||||||
 | 
					        return null;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * @return the position of this container
 | 
					     * @return the position of this container
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -297,10 +297,20 @@ public class CrafterNetworkNode extends NetworkNode implements ICraftingPatternC
 | 
				
			|||||||
        return patternsInventory;
 | 
					        return patternsInventory;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @Override
 | 
				
			||||||
 | 
					    @Nullable
 | 
				
			||||||
 | 
					    public Component getCustomName() {
 | 
				
			||||||
 | 
					        return displayName;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public Component getName() {
 | 
					    public Component getName() {
 | 
				
			||||||
        if (displayName != null) {
 | 
					        ICraftingPatternContainer root = getRootContainer();
 | 
				
			||||||
            return displayName;
 | 
					        if (root != null) {
 | 
				
			||||||
 | 
					            Component displayNameOfRoot = root.getCustomName();
 | 
				
			||||||
 | 
					            if (displayNameOfRoot != null) {
 | 
				
			||||||
 | 
					                return displayNameOfRoot;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        BlockEntity facing = getConnectedBlockEntity();
 | 
					        BlockEntity facing = getConnectedBlockEntity();
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user