From a57cd3f5805c4de6146e3e709398c2622d8cef50 Mon Sep 17 00:00:00 2001 From: Gunther De Wachter Date: Sun, 9 Jul 2017 07:17:24 +0200 Subject: [PATCH] More 1.12 shenanigans. Still far from done. --- .../appeng/api/definitions/IMaterials.java | 2 - .../appeng/bootstrap/IBootstrapComponent.java | 2 +- .../bootstrap/ItemDefinitionBuilder.java | 5 +- .../components/ModelOverrideComponent.java | 5 +- .../bootstrap/components/TesrComponent.java | 2 + .../java/appeng/client/gui/AEBaseGui.java | 1 + src/main/java/appeng/core/AppEng.java | 3 + src/main/java/appeng/core/Registration.java | 87 ++++++++++++------- .../core/api/definitions/ApiMaterials.java | 8 -- .../appeng/items/materials/MaterialType.java | 1 - .../recipes/game/DisassembleRecipe.java | 40 +-------- .../appeng/recipes/game/FacadeRecipe.java | 40 +-------- .../appeng/recipes/game/ShapedRecipe.java | 40 +-------- .../appeng/recipes/game/ShapelessRecipe.java | 40 +-------- 14 files changed, 76 insertions(+), 200 deletions(-) diff --git a/src/api/java/appeng/api/definitions/IMaterials.java b/src/api/java/appeng/api/definitions/IMaterials.java index 54868b1fa..0a4ef10e2 100644 --- a/src/api/java/appeng/api/definitions/IMaterials.java +++ b/src/api/java/appeng/api/definitions/IMaterials.java @@ -111,8 +111,6 @@ public interface IMaterials IItemDefinition matterBall(); - IItemDefinition ironNugget(); - IItemDefinition certusQuartzCrystal(); IItemDefinition certusQuartzCrystalCharged(); diff --git a/src/main/java/appeng/bootstrap/IBootstrapComponent.java b/src/main/java/appeng/bootstrap/IBootstrapComponent.java index 5e1d0cd52..1bdda5e49 100644 --- a/src/main/java/appeng/bootstrap/IBootstrapComponent.java +++ b/src/main/java/appeng/bootstrap/IBootstrapComponent.java @@ -32,7 +32,7 @@ public interface IBootstrapComponent { } - default void modelLoader( Side side ) + default void modelReg( Side side ) { } diff --git a/src/main/java/appeng/bootstrap/ItemDefinitionBuilder.java b/src/main/java/appeng/bootstrap/ItemDefinitionBuilder.java index b4a9ee90f..c723c52de 100644 --- a/src/main/java/appeng/bootstrap/ItemDefinitionBuilder.java +++ b/src/main/java/appeng/bootstrap/ItemDefinitionBuilder.java @@ -31,8 +31,6 @@ import net.minecraft.block.BlockDispenser; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.dispenser.IBehaviorDispenseItem; import net.minecraft.item.Item; -import net.minecraftforge.fml.common.registry.ForgeRegistries; -import net.minecraftforge.fml.common.registry.GameRegistry; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @@ -59,6 +57,8 @@ class ItemDefinitionBuilder implements IItemBuilder private final List> initCallbacks = new ArrayList<>(); + private final List> modelRegCallbacks = new ArrayList<>(); + private final List> postInitCallbacks = new ArrayList<>(); private Supplier dispenserBehaviorSupplier; @@ -165,6 +165,7 @@ class ItemDefinitionBuilder implements IItemBuilder // Register all extra handlers preInitCallbacks.forEach( consumer -> factory.addPreInit( side -> consumer.accept( item ) ) ); initCallbacks.forEach( consumer -> factory.addInit( side -> consumer.accept( item ) ) ); + modelRegCallbacks.forEach(consumer -> factory.addModelReg(side -> consumer.accept( item ) ) ); postInitCallbacks.forEach( consumer -> factory.addPostInit( side -> consumer.accept( item ) ) ); // Register custom dispenser behavior if requested diff --git a/src/main/java/appeng/bootstrap/components/ModelOverrideComponent.java b/src/main/java/appeng/bootstrap/components/ModelOverrideComponent.java index 0384f581d..50dfb702a 100644 --- a/src/main/java/appeng/bootstrap/components/ModelOverrideComponent.java +++ b/src/main/java/appeng/bootstrap/components/ModelOverrideComponent.java @@ -30,6 +30,8 @@ import net.minecraft.client.renderer.block.model.IBakedModel; import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.util.registry.IRegistry; import net.minecraftforge.client.event.ModelBakeEvent; +import net.minecraftforge.client.model.IModel; +import net.minecraftforge.client.model.ModelLoaderRegistry; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.relauncher.Side; @@ -61,7 +63,8 @@ public class ModelOverrideComponent implements PreInitComponent { IRegistry modelRegistry = event.getModelRegistry(); Set keys = Sets.newHashSet( modelRegistry.getKeys() ); - IBakedModel missingModel = modelRegistry.getObject( MODEL_MISSING ); +// IBakedModel missingModel = modelRegistry.getObject( MODEL_MISSING ); + IModel missingModel = ModelLoaderRegistry.getMissingModel(); for( ModelResourceLocation location : keys ) { diff --git a/src/main/java/appeng/bootstrap/components/TesrComponent.java b/src/main/java/appeng/bootstrap/components/TesrComponent.java index 89103a314..42301e7cb 100644 --- a/src/main/java/appeng/bootstrap/components/TesrComponent.java +++ b/src/main/java/appeng/bootstrap/components/TesrComponent.java @@ -31,6 +31,7 @@ import appeng.tile.AEBaseTile; * * @param */ +//public class TesrComponent implements ModelRegComponent public class TesrComponent implements PreInitComponent { @@ -45,6 +46,7 @@ public class TesrComponent implements PreInitComponent } @Override +// public void modelReg( Side side ) public void preInitialize( Side side ) { ClientRegistry.bindTileEntitySpecialRenderer( tileEntityClass, tesr ); diff --git a/src/main/java/appeng/client/gui/AEBaseGui.java b/src/main/java/appeng/client/gui/AEBaseGui.java index d9a5d91ef..c10d049b0 100644 --- a/src/main/java/appeng/client/gui/AEBaseGui.java +++ b/src/main/java/appeng/client/gui/AEBaseGui.java @@ -160,6 +160,7 @@ public abstract class AEBaseGui extends GuiContainer { super.drawDefaultBackground(); super.drawScreen( mouseX, mouseY, btn ); + this.renderHoveredToolTip(mouseX, mouseY); for( final Object c : this.buttonList ) { diff --git a/src/main/java/appeng/core/AppEng.java b/src/main/java/appeng/core/AppEng.java index b0a9ba53a..bc73bd6bf 100644 --- a/src/main/java/appeng/core/AppEng.java +++ b/src/main/java/appeng/core/AppEng.java @@ -141,6 +141,7 @@ public final class AppEng this.configDirectory = new File( event.getModConfigurationDirectory().getPath(), "AppliedEnergistics2" ); this.recipeDirectory = new File( this.configDirectory, "recipes" ); + final File configFile = new File( this.configDirectory, "AppliedEnergistics2.cfg" ); final File facadeFile = new File( this.configDirectory, "Facades.cfg" ); final File versionFile = new File( this.configDirectory, "VersionChecker.cfg" ); @@ -154,6 +155,8 @@ public final class AppEng this.customRecipeConfig = new CustomRecipeForgeConfiguration( recipeConfiguration ); this.exportConfig = new ForgeExportConfig( recipeConfiguration ); + this.registration.setRecipeInformation( recipeDirectory, customRecipeConfig ); + AELog.info( "Pre Initialization ( started )" ); CreativeTab.init(); diff --git a/src/main/java/appeng/core/Registration.java b/src/main/java/appeng/core/Registration.java index 85a9601a2..28cfeef48 100644 --- a/src/main/java/appeng/core/Registration.java +++ b/src/main/java/appeng/core/Registration.java @@ -27,12 +27,14 @@ import java.util.Set; import javax.annotation.Nonnull; -import appeng.util.Platform; +import appeng.items.parts.ItemFacade; +import appeng.recipes.game.DisassembleRecipe; import com.google.common.base.Preconditions; import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraft.item.crafting.IRecipe; +import net.minecraft.util.ResourceLocation; import net.minecraft.world.DimensionType; import net.minecraft.world.biome.Biome; import net.minecraftforge.client.event.ModelRegistryEvent; @@ -111,6 +113,7 @@ import appeng.tile.AEBaseTile; import appeng.worldgen.MeteoriteWorldGen; import appeng.worldgen.QuartzWorldGen; import net.minecraftforge.registries.IForgeRegistry; +import scala.App; public final class Registration { @@ -122,7 +125,14 @@ public final class Registration private static List blocksToRegister = new ArrayList(); private static List itemsToRegister = new ArrayList(); private static List recipesToRegister = new ArrayList(); + private File recipeDirectory; + private CustomRecipeConfig customRecipeConfig; + public void setRecipeInformation ( File f, CustomRecipeConfig f2) + { + this.recipeDirectory = f; + this.customRecipeConfig = f2; + } Registration() { @@ -138,7 +148,6 @@ public final class Registration { if( blocksToRegister == null ) throw new IllegalStateException( "Past the registration phase already!" ); - System.out.println("Adding block : " + b +" -> " + b.getRegistryName()); blocksToRegister.add( b ); } @@ -146,7 +155,6 @@ public final class Registration { if( recipesToRegister == null ) throw new IllegalStateException( "Past the registration phase already!" ); - System.out.println("Adding " + r); recipesToRegister.add( r ); } @@ -154,7 +162,6 @@ public final class Registration { if( itemsToRegister == null ) throw new IllegalStateException( "Past the registration phase already!" ); - System.out.println("Adding item : " + i + " -> " + i.getRegistryName()); itemsToRegister.add( i ); } @@ -284,8 +291,8 @@ public final class Registration // Perform ore camouflage! ItemMaterial.instance.makeUnique(); - final Runnable recipeLoader = new RecipeLoader( recipeDirectory, customRecipeConfig, this.recipeHandler ); - recipeLoader.run(); +// final Runnable recipeLoader = new RecipeLoader( recipeDirectory, customRecipeConfig, this.recipeHandler ); +// recipeLoader.run(); if( Integrations.ic2().isEnabled() ) { @@ -332,53 +339,38 @@ public final class Registration registries.matterCannon().registerAmmo( ammoStack, weight ); } ); - this.recipeHandler.injectRecipes(); + // TODO : 1.12 This is way too late for recipes +// this.recipeHandler.injectRecipes(); final PlayerStatsRegistration registration = new PlayerStatsRegistration( MinecraftForge.EVENT_BUS, AEConfig.instance() ); registration.registerAchievementHandlers(); registration.registerAchievements(); - -// if( AEConfig.instance().isFeatureEnabled( AEFeature.ENABLE_DISASSEMBLY_CRAFTING ) ) -// { -// // TODO : 1.12 Improve -// addRecipeToRegister( new DisassembleRecipe() ); -// RecipeSorter.register( "appliedenergistics2:disassemble", DisassembleRecipe.class, Category.SHAPELESS, "after:minecraft:shapeless" ); -// } -// -// if( AEConfig.instance().isFeatureEnabled( AEFeature.ENABLE_FACADE_CRAFTING ) ) -// { -// definitions.items().facade().maybeItem().ifPresent( facadeItem -> { -// // TODO : 1.12 Improve -// addRecipeToRegister( new FacadeRecipe( (ItemFacade) facadeItem ) ); -// RecipeSorter.register( "appliedenergistics2:facade", FacadeRecipe.class, Category.SHAPED, "after:minecraft:shaped" ); -// } ); -// } } @SubscribeEvent - public void registerBiomes ( RegistryEvent.Register event ) + public void registerBiomes( RegistryEvent.Register event ) { IForgeRegistry registry = event.getRegistry(); this.registerSpatial( false, registry ); } @SubscribeEvent - public void modelRegistryEvent ( ModelRegistryEvent event ) + public void modelRegistryEvent( ModelRegistryEvent event ) { final Api api = Api.INSTANCE; final IPartHelper partHelper = api.partHelper(); final IRegistryContainer registries = api.registries(); ApiDefinitions definitions = api.definitions(); - definitions.getRegistry().getBootstrapComponents().forEach( b -> b.modelLoader( FMLCommonHandler.instance().getEffectiveSide() ) ); + definitions.getRegistry().getBootstrapComponents().forEach( b -> b.modelReg( FMLCommonHandler.instance().getEffectiveSide() ) ); } @SubscribeEvent - public void registerBlocks(RegistryEvent.Register event) + public void registerBlocks( RegistryEvent.Register event ) { IForgeRegistry registry = event.getRegistry(); // TODO : 1.12 Improve - for (Block b : blocksToRegister) + for( Block b : blocksToRegister ) { registry.register( b ); } @@ -386,7 +378,8 @@ public final class Registration } @SubscribeEvent - public void registerItems(RegistryEvent.Register event) { + public void registerItems( RegistryEvent.Register event ) + { IForgeRegistry registry = event.getRegistry(); // TODO : 1.12 Improve @@ -401,9 +394,44 @@ public final class Registration public void registerRecipes(RegistryEvent.Register event) { IForgeRegistry registry = event.getRegistry(); + + Api api = Api.INSTANCE; + ApiDefinitions definitions = api.definitions(); + + final Runnable recipeLoader = new RecipeLoader( recipeDirectory, customRecipeConfig, this.recipeHandler ); + recipeLoader.run(); + + this.recipeHandler.injectRecipes(); + + if( AEConfig.instance().isFeatureEnabled( AEFeature.ENABLE_DISASSEMBLY_CRAFTING ) ) + { + DisassembleRecipe r = new DisassembleRecipe(); + // TODO : 1.12 Improve + addRecipeToRegister( r.setRegistryName( AppEng.MOD_ID.toLowerCase(), "disassemble" ) ); +// RecipeSorter.register( "appliedenergistics2:disassemble", DisassembleRecipe.class, Category.SHAPELESS, "after:minecraft:shapeless" ); + } + + if( AEConfig.instance().isFeatureEnabled( AEFeature.ENABLE_FACADE_CRAFTING ) ) + { + definitions.items().facade().maybeItem().ifPresent( facadeItem -> { + // TODO : 1.12 Improve + FacadeRecipe f = new FacadeRecipe( (ItemFacade) facadeItem ); + addRecipeToRegister( f.setRegistryName( AppEng.MOD_ID.toLowerCase(), "facade" ) ); +// RecipeSorter.register( "appliedenergistics2:facade", FacadeRecipe.class, Category.SHAPED, "after:minecraft:shaped" ); + } ); + } + + int x = 0; // TODO : 1.12 Improve for( IRecipe r : recipesToRegister ) { + // TODO : 1.12 *really* improve. + // Move to json where possible? + if( r.getRegistryName() == null ) + { + r.setRegistryName( new ResourceLocation( AppEng.MOD_ID.toLowerCase(), "recipe_" + x )); + x++; + } registry.register( r ); } recipesToRegister = null; @@ -545,6 +573,7 @@ public final class Registration mr.whiteListTileEntity( net.minecraft.tileentity.TileEntityFlowerPot.class ); mr.whiteListTileEntity( net.minecraft.tileentity.TileEntityNote.class ); mr.whiteListTileEntity( net.minecraft.tileentity.TileEntityHopper.class ); + mr.whiteListTileEntity( net.minecraft.tileentity.TileEntityShulkerBox.class ); /* * Whitelist AE2 diff --git a/src/main/java/appeng/core/api/definitions/ApiMaterials.java b/src/main/java/appeng/core/api/definitions/ApiMaterials.java index 489ac7733..24d47be29 100644 --- a/src/main/java/appeng/core/api/definitions/ApiMaterials.java +++ b/src/main/java/appeng/core/api/definitions/ApiMaterials.java @@ -93,7 +93,6 @@ public final class ApiMaterials implements IMaterials private final IItemDefinition netherQuartzDust; private final IItemDefinition matterBall; - private final IItemDefinition ironNugget; private final IItemDefinition certusQuartzCrystal; private final IItemDefinition certusQuartzCrystalCharged; @@ -182,7 +181,6 @@ public final class ApiMaterials implements IMaterials this.netherQuartzDust = new DamagedItemDefinition( "material.dust.quartz.nether", materials.createMaterial( MaterialType.NetherQuartzDust ) ); this.matterBall = new DamagedItemDefinition( "material.ammo.matter_ball", materials.createMaterial( MaterialType.MatterBall ) ); - this.ironNugget = new DamagedItemDefinition( "material.ammo.nugget.iron", materials.createMaterial( MaterialType.IronNugget ) ); this.certusQuartzCrystal = new DamagedItemDefinition( "material.crystal.quartz.certus", materials.createMaterial( MaterialType.CertusQuartzCrystal ) ); this.certusQuartzCrystalCharged = new DamagedItemDefinition( "material.crystal.quartz.certus.charged", materials.createMaterial( MaterialType.CertusQuartzCrystalCharged ) ); @@ -448,12 +446,6 @@ public final class ApiMaterials implements IMaterials return this.matterBall; } - @Override - public IItemDefinition ironNugget() - { - return this.ironNugget; - } - @Override public IItemDefinition certusQuartzCrystal() { diff --git a/src/main/java/appeng/items/materials/MaterialType.java b/src/main/java/appeng/items/materials/MaterialType.java index d43e577ea..218609442 100644 --- a/src/main/java/appeng/items/materials/MaterialType.java +++ b/src/main/java/appeng/items/materials/MaterialType.java @@ -49,7 +49,6 @@ public enum MaterialType Flour( 4, "material_flour", EnumSet.of( AEFeature.FLOUR ), "dustWheat" ), GoldDust( 51, "material_gold_dust", EnumSet.of( AEFeature.DUSTS ), "dustGold" ), IronDust( 49, "material_iron_dust", EnumSet.of( AEFeature.DUSTS ), "dustIron" ), - IronNugget( 50, "material_iron_nugget", EnumSet.of( AEFeature.NUGGETS ), "nuggetIron" ), Silicon( 5, "material_silicon", EnumSet.of( AEFeature.SILICON ), "itemSilicon" ), MatterBall( 6, "material_matter_ball", EnumSet.of( AEFeature.MATTER_BALL ) ), diff --git a/src/main/java/appeng/recipes/game/DisassembleRecipe.java b/src/main/java/appeng/recipes/game/DisassembleRecipe.java index 66e1b6a03..3bca41a84 100644 --- a/src/main/java/appeng/recipes/game/DisassembleRecipe.java +++ b/src/main/java/appeng/recipes/game/DisassembleRecipe.java @@ -47,7 +47,7 @@ import appeng.api.storage.data.IAEItemStack; import appeng.api.storage.data.IItemList; -public final class DisassembleRecipe implements IRecipe +public final class DisassembleRecipe extends net.minecraftforge.registries.IForgeRegistryEntry.Impl implements IRecipe { private static final ItemStack MISMATCHED_STACK = ItemStack.EMPTY; @@ -179,42 +179,4 @@ public final class DisassembleRecipe implements IRecipe { return ForgeHooks.defaultRecipeGetRemainingItems( inv ); } - - /** - * Sets a unique name for this Item. This should be used for uniquely identify the instance of the Item. - * This is the valid replacement for the atrocious 'getUnlocalizedName().substring(6)' stuff that everyone does. - * Unlocalized names have NOTHING to do with unique identifiers. As demonstrated by vanilla blocks and items. - *

- * The supplied name will be prefixed with the currently active mod's modId. - * If the supplied name already has a prefix that is different, it will be used and a warning will be logged. - *

- * If a name already exists, or this Item is already registered in a registry, then an IllegalStateException is thrown. - *

- * Returns 'this' to allow for chaining. - * - * @param name Unique registry name - * @return This instance - */ - @Override - public IRecipe setRegistryName(ResourceLocation name) { - return null; - } - - /** - * A unique identifier for this entry, if this entry is registered already it will return it's official registry name. - * Otherwise it will return the name set in setRegistryName(). - * If neither are valid null is returned. - * - * @return Unique identifier or null. - */ - @Nullable - @Override - public ResourceLocation getRegistryName() { - return null; - } - - @Override - public Class getRegistryType() { - return null; - } } \ No newline at end of file diff --git a/src/main/java/appeng/recipes/game/FacadeRecipe.java b/src/main/java/appeng/recipes/game/FacadeRecipe.java index 9eac32213..ea70ddf46 100644 --- a/src/main/java/appeng/recipes/game/FacadeRecipe.java +++ b/src/main/java/appeng/recipes/game/FacadeRecipe.java @@ -36,7 +36,7 @@ import appeng.api.definitions.IDefinitions; import appeng.items.parts.ItemFacade; -public final class FacadeRecipe implements IRecipe +public final class FacadeRecipe extends net.minecraftforge.registries.IForgeRegistryEntry.Impl implements IRecipe { private final IComparableDefinition anchor; private final ItemFacade facade; @@ -96,42 +96,4 @@ public final class FacadeRecipe implements IRecipe { return ForgeHooks.defaultRecipeGetRemainingItems( inv ); } - - /** - * Sets a unique name for this Item. This should be used for uniquely identify the instance of the Item. - * This is the valid replacement for the atrocious 'getUnlocalizedName().substring(6)' stuff that everyone does. - * Unlocalized names have NOTHING to do with unique identifiers. As demonstrated by vanilla blocks and items. - *

- * The supplied name will be prefixed with the currently active mod's modId. - * If the supplied name already has a prefix that is different, it will be used and a warning will be logged. - *

- * If a name already exists, or this Item is already registered in a registry, then an IllegalStateException is thrown. - *

- * Returns 'this' to allow for chaining. - * - * @param name Unique registry name - * @return This instance - */ - @Override - public IRecipe setRegistryName(ResourceLocation name) { - return null; - } - - /** - * A unique identifier for this entry, if this entry is registered already it will return it's official registry name. - * Otherwise it will return the name set in setRegistryName(). - * If neither are valid null is returned. - * - * @return Unique identifier or null. - */ - @Nullable - @Override - public ResourceLocation getRegistryName() { - return null; - } - - @Override - public Class getRegistryType() { - return null; - } } \ No newline at end of file diff --git a/src/main/java/appeng/recipes/game/ShapedRecipe.java b/src/main/java/appeng/recipes/game/ShapedRecipe.java index 9c1cdb299..93e329362 100644 --- a/src/main/java/appeng/recipes/game/ShapedRecipe.java +++ b/src/main/java/appeng/recipes/game/ShapedRecipe.java @@ -38,7 +38,7 @@ import appeng.api.recipes.IIngredient; import javax.annotation.Nullable; -public class ShapedRecipe implements IRecipe, IRecipeBakeable +public class ShapedRecipe extends net.minecraftforge.registries.IForgeRegistryEntry.Impl implements IRecipe, IRecipeBakeable { // Added in for future ease of change, but hard coded for now. private static final int MAX_CRAFT_GRID_WIDTH = 3; @@ -333,42 +333,4 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable { return ForgeHooks.defaultRecipeGetRemainingItems( inv ); } - - /** - * Sets a unique name for this Item. This should be used for uniquely identify the instance of the Item. - * This is the valid replacement for the atrocious 'getUnlocalizedName().substring(6)' stuff that everyone does. - * Unlocalized names have NOTHING to do with unique identifiers. As demonstrated by vanilla blocks and items. - *

- * The supplied name will be prefixed with the currently active mod's modId. - * If the supplied name already has a prefix that is different, it will be used and a warning will be logged. - *

- * If a name already exists, or this Item is already registered in a registry, then an IllegalStateException is thrown. - *

- * Returns 'this' to allow for chaining. - * - * @param name Unique registry name - * @return This instance - */ - @Override - public IRecipe setRegistryName(ResourceLocation name) { - return null; - } - - /** - * A unique identifier for this entry, if this entry is registered already it will return it's official registry name. - * Otherwise it will return the name set in setRegistryName(). - * If neither are valid null is returned. - * - * @return Unique identifier or null. - */ - @Nullable - @Override - public ResourceLocation getRegistryName() { - return null; - } - - @Override - public Class getRegistryType() { - return null; - } } \ No newline at end of file diff --git a/src/main/java/appeng/recipes/game/ShapelessRecipe.java b/src/main/java/appeng/recipes/game/ShapelessRecipe.java index 0ef77fcd7..7f05d4f4f 100644 --- a/src/main/java/appeng/recipes/game/ShapelessRecipe.java +++ b/src/main/java/appeng/recipes/game/ShapelessRecipe.java @@ -37,7 +37,7 @@ import appeng.api.recipes.IIngredient; import javax.annotation.Nullable; -public class ShapelessRecipe implements IRecipe, IRecipeBakeable +public class ShapelessRecipe extends net.minecraftforge.registries.IForgeRegistryEntry.Impl implements IRecipe, IRecipeBakeable { private final ArrayList input = new ArrayList(); @@ -189,42 +189,4 @@ public class ShapelessRecipe implements IRecipe, IRecipeBakeable { return ForgeHooks.defaultRecipeGetRemainingItems( inv ); } - - /** - * Sets a unique name for this Item. This should be used for uniquely identify the instance of the Item. - * This is the valid replacement for the atrocious 'getUnlocalizedName().substring(6)' stuff that everyone does. - * Unlocalized names have NOTHING to do with unique identifiers. As demonstrated by vanilla blocks and items. - *

- * The supplied name will be prefixed with the currently active mod's modId. - * If the supplied name already has a prefix that is different, it will be used and a warning will be logged. - *

- * If a name already exists, or this Item is already registered in a registry, then an IllegalStateException is thrown. - *

- * Returns 'this' to allow for chaining. - * - * @param name Unique registry name - * @return This instance - */ - @Override - public IRecipe setRegistryName(ResourceLocation name) { - return null; - } - - /** - * A unique identifier for this entry, if this entry is registered already it will return it's official registry name. - * Otherwise it will return the name set in setRegistryName(). - * If neither are valid null is returned. - * - * @return Unique identifier or null. - */ - @Nullable - @Override - public ResourceLocation getRegistryName() { - return null; - } - - @Override - public Class getRegistryType() { - return null; - } } \ No newline at end of file