Basic JEI integration is back

This commit is contained in:
Sebastian Hartte
2020-06-10 20:27:19 +02:00
parent 19e7fd3544
commit 8ccc114f92
280 changed files with 1945 additions and 1374 deletions
-1
View File
@@ -68,7 +68,6 @@ sourceSets {
api
main {
java {
exclude 'appeng/recipes/handlers/**'
exclude 'appeng/worldgen/**'
exclude 'appeng/spatial/StorageChunkProvider.java'
exclude 'appeng/spatial/StorageHelper.java'
@@ -35,10 +35,7 @@ import net.minecraft.util.ResourceLocation;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import java.util.HashMap;
import java.util.Map;
import java.util.function.BiFunction;
import java.util.function.Function;
import java.util.function.Predicate;
@@ -51,9 +48,6 @@ class BlockRendering implements IBlockRendering
@OnlyIn( Dist.CLIENT )
private IBlockColor blockColor;
@OnlyIn( Dist.CLIENT )
private Map<String, IUnbakedModel> builtInModels = new HashMap<>();
@OnlyIn( Dist.CLIENT )
private RenderType renderType;
@@ -76,13 +70,6 @@ class BlockRendering implements IBlockRendering
return this;
}
@Override
public IBlockRendering builtInModel( String name, IUnbakedModel model )
{
this.builtInModels.put( name, model );
return this;
}
@Override
public IBlockRendering renderType(RenderType type) {
this.renderType = type;
@@ -108,8 +95,6 @@ class BlockRendering implements IBlockRendering
factory.addModelOverride( block.getRegistryName().getPath(), ( l, m ) -> new AutoRotatingBakedModel( m ) );
}
this.builtInModels.forEach( factory::addBuiltInModel );
// TODO : 1.12
if( this.blockColor != null )
{
@@ -30,7 +30,6 @@ import java.util.function.BiFunction;
import java.util.function.Function;
import java.util.function.Supplier;
import appeng.bootstrap.components.BuiltInModelComponent;
import appeng.bootstrap.components.ModelOverrideComponent;
import appeng.tile.AEBaseTile;
import net.minecraft.block.Block;
@@ -42,17 +41,10 @@ import net.minecraft.entity.EntityType;
import net.minecraft.item.Item;
import net.minecraft.tileentity.TileEntityType;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import appeng.api.definitions.IItemDefinition;
import appeng.api.util.AEColor;
import appeng.api.util.AEColoredItemDefinition;
import appeng.api.features.AEFeature;
import appeng.core.features.ActivityState;
import appeng.core.features.ColoredItemDefinition;
import appeng.core.features.ItemStackSrc;
import appeng.util.Platform;
@@ -66,9 +58,6 @@ public class FeatureFactory
@OnlyIn( Dist.CLIENT )
private ModelOverrideComponent modelOverrideComponent;
@OnlyIn( Dist.CLIENT )
private BuiltInModelComponent builtInModelComponent;
public FeatureFactory()
{
this.defaultFeatures = new AEFeature[] { AEFeature.CORE };
@@ -78,8 +67,6 @@ public class FeatureFactory
{
this.modelOverrideComponent = new ModelOverrideComponent();
this.addBootstrapComponent( this.modelOverrideComponent );
this.builtInModelComponent = new BuiltInModelComponent();
this.addBootstrapComponent( this.builtInModelComponent );
}
}
@@ -90,7 +77,6 @@ public class FeatureFactory
if( Platform.hasClientClasses() )
{
this.modelOverrideComponent = parent.modelOverrideComponent;
this.builtInModelComponent = parent.builtInModelComponent;
}
}
@@ -131,12 +117,6 @@ public class FeatureFactory
this.bootstrapComponents.computeIfAbsent( eventType, c -> new ArrayList<IBootstrapComponent>() ).add( component );
}
@OnlyIn( Dist.CLIENT )
void addBuiltInModel( String path, IUnbakedModel model )
{
this.builtInModelComponent.addModel( path, model );
}
@OnlyIn( Dist.CLIENT )
void addModelOverride( String resourcePath, BiFunction<ResourceLocation, IBakedModel, IBakedModel> customizer )
{
@@ -47,12 +47,6 @@ public interface IBlockRendering
@OnlyIn( Dist.CLIENT )
IBlockRendering blockColor( IBlockColor blockColor );
/**
* Registers a built-in model under the given resource path.
*/
@OnlyIn( Dist.CLIENT )
IBlockRendering builtInModel( String name, IUnbakedModel model );
@OnlyIn( Dist.CLIENT )
IBlockRendering renderType(RenderType type);
@@ -23,8 +23,6 @@ import java.util.Arrays;
import java.util.Collection;
import net.minecraft.client.renderer.color.IItemColor;
import net.minecraft.client.renderer.model.IUnbakedModel;
import net.minecraft.client.renderer.model.ModelResourceLocation;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
@@ -36,29 +34,6 @@ import net.minecraftforge.api.distmarker.OnlyIn;
public interface IItemRendering
{
/**
* Registers a custom item mesh definition that will be used to dynamically determine the
* item model to be used for rendering by inspecting the item stack (i.e. for NBT data).
* Please
*/
//FIXME @OnlyIn( Dist.CLIENT )
//FIXME IItemRendering meshDefinition( ItemMeshDefinition meshDefinition );
/**
* Registers an item model for meta=0, see {@link #model(int, ModelResourceLocation)}.
*/
@OnlyIn( Dist.CLIENT )
default IItemRendering model( ModelResourceLocation model )
{
return this.model( 0, model );
}
/**
* Registers an item model for a given meta.
*/
@OnlyIn( Dist.CLIENT )
IItemRendering model( int meta, ModelResourceLocation model );
/**
* Convenient override for {@link #variants(Collection)}.
*/
@@ -72,8 +47,6 @@ public interface IItemRendering
* Registers the item variants of this item. This are all models that need to be loaded for this item.
* This has no direct effect on rendering, but is used to load models that are used for example by
* the ItemMeshDefinition.
*
* Models registered via {@link #model(int, ModelResourceLocation)} are automatically added here.
*/
@OnlyIn( Dist.CLIENT )
IItemRendering variants( Collection<ResourceLocation> resources );
@@ -85,10 +58,4 @@ public interface IItemRendering
@OnlyIn( Dist.CLIENT )
IItemRendering color( IItemColor itemColor );
/**
* Registers a built-in model under the given resource path.
*/
@OnlyIn( Dist.CLIENT )
IItemRendering builtInModel( String name, IUnbakedModel model );
}
@@ -29,7 +29,4 @@ public interface IModelRegistry
{
void registerItemVariants( Item item, ResourceLocation... names );
void setCustomModelResourceLocation( Item item, int metadata, ModelResourceLocation model );
// FIXME void setCustomMeshDefinition( Item item, ItemMeshDefinition meshDefinition );
}
@@ -20,29 +20,16 @@ package appeng.bootstrap;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import com.google.common.collect.ImmutableMap;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.color.IItemColor;
import net.minecraft.client.renderer.model.IUnbakedModel;
import net.minecraft.client.renderer.model.ModelResourceLocation;
import net.minecraft.item.BlockItem;
import net.minecraft.item.Item;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import appeng.bootstrap.components.ItemColorComponent;
import appeng.bootstrap.components.ItemMeshDefinitionComponent;
import appeng.bootstrap.components.ItemModelComponent;
import appeng.bootstrap.components.ItemVariantsComponent;
@@ -52,36 +39,9 @@ class ItemRendering implements IItemRendering
@OnlyIn( Dist.CLIENT )
private IItemColor itemColor;
// FIXME
// @OnlyIn( Dist.CLIENT )
// private ItemMeshDefinition itemMeshDefinition;
@OnlyIn( Dist.CLIENT )
private Map<Integer, ModelResourceLocation> itemModels = new HashMap<>();
@OnlyIn( Dist.CLIENT )
private Set<ResourceLocation> variants = new HashSet<>();
@OnlyIn( Dist.CLIENT )
private Map<String, IUnbakedModel> builtInModels = new HashMap<>();
// FIXME
// @Override
// @OnlyIn( Dist.CLIENT )
// public IItemRendering meshDefinition( ItemMeshDefinition meshDefinition )
// {
// this.itemMeshDefinition = meshDefinition;
// return this;
// }
@Override
@OnlyIn( Dist.CLIENT )
public IItemRendering model( int meta, ModelResourceLocation model )
{
this.itemModels.put( meta, model );
return this;
}
@Override
public IItemRendering variants( Collection<ResourceLocation> resources )
{
@@ -97,65 +57,14 @@ class ItemRendering implements IItemRendering
return this;
}
@Override
public IItemRendering builtInModel( String name, IUnbakedModel model )
{
this.builtInModels.put( name, model );
return this;
}
void apply( FeatureFactory factory, Item item )
{
//FIXME if( this.itemMeshDefinition != null )
//FIXME {
//FIXME factory.addBootstrapComponent( new ItemMeshDefinitionComponent( item, this.itemMeshDefinition ) );
//FIXME }
if( !this.itemModels.isEmpty() )
{
factory.addBootstrapComponent( new ItemModelComponent( item, this.itemModels ) );
}
Set<ResourceLocation> resources = new HashSet<>( this.variants );
// Register a default item model if neither items by meta nor an item mesh definition exist
if( /* FIXME this.itemMeshDefinition == null && */ this.itemModels.isEmpty() )
{
// ModelResourceLocation model;
//
// // For block items, the default will try to use the default state of the associated block
// if( item instanceof BlockItem )
// {
// Block block = ( (BlockItem) item ).getBlock();
//
// // We can only do this once the blocks are actually registered...
// model = new ModelResourceLocation(
// new ResourceLocation(
// block.getRegistryName().getNamespace(),
// "block/" + block.getRegistryName().getPath()
// )
// , "inventory" );
// }
// else
// {
// model = new ModelResourceLocation( item.getRegistryName(), "inventory" );
// }
// factory.addBootstrapComponent( new ItemModelComponent( item, ImmutableMap.of( 0, model ) ) );
}
// TODO : 1.12
this.builtInModels.forEach( factory::addBuiltInModel );
if( !resources.isEmpty() )
{
factory.addBootstrapComponent( new ItemVariantsComponent( item, resources ) );
}
// FIXME else if( this.itemMeshDefinition != null )
// FIXME {
// FIXME // Adding an empty variant list here will prevent Vanilla from trying to load the default item model in this
// FIXME // case
// FIXME factory.addBootstrapComponent( new ItemVariantsComponent( item, Collections.emptyList() ) );
// FIXME }
if( this.itemColor != null )
{
@@ -1,59 +0,0 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Applied Energistics 2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
*/
package appeng.bootstrap.components;
import java.util.Map;
import javax.annotation.Nonnull;
import net.minecraft.client.renderer.model.ModelResourceLocation;
import net.minecraft.item.Item;
import net.minecraftforge.api.distmarker.Dist;
import appeng.bootstrap.IModelRegistry;
/**
* Registers the models that should by used for an item, including the ability to
* distinguish by meta.
*/
public class ItemModelComponent implements IModelRegistrationComponent
{
private final Item item;
private final Map<Integer, ModelResourceLocation> modelsByMeta;
public ItemModelComponent( @Nonnull Item item, @Nonnull Map<Integer, ModelResourceLocation> modelsByMeta )
{
this.item = item;
this.modelsByMeta = modelsByMeta;
}
@Override
public void modelRegistration( Dist dist, IModelRegistry registry )
{
this.modelsByMeta.forEach( ( meta, model ) ->
{
registry.setCustomModelResourceLocation( this.item, meta, model );
} );
}
}
@@ -0,0 +1,19 @@
package appeng.core;
import appeng.recipes.handlers.GrinderRecipe;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.item.crafting.IRecipeType;
import net.minecraft.util.ResourceLocation;
public class AERecipeType<T extends IRecipe<?>> implements IRecipeType<T> {
private final String id;
public AERecipeType(ResourceLocation registryName) {
this.id = registryName.toString();
}
@Override
public String toString() {
return id;
}
}
+2
View File
@@ -30,6 +30,7 @@ import appeng.bootstrap.components.IClientSetupComponent;
import appeng.bootstrap.components.IInitComponent;
import appeng.bootstrap.components.IPostInitComponent;
import appeng.bootstrap.components.ItemColorComponent;
import appeng.capabilities.Capabilities;
import appeng.client.ClientHelper;
import appeng.client.render.DummyFluidItemModel;
import appeng.client.render.SimpleModelLoader;
@@ -162,6 +163,7 @@ public final class AppEng
definitions.getRegistry().getBootstrapComponents( IInitComponent.class ).forEachRemaining(IInitComponent::initialize);
definitions.getRegistry().getBootstrapComponents( IPostInitComponent.class ).forEachRemaining(IPostInitComponent::postInitialize);
Capabilities.register();
Registration.setupInternalRegistries();
Registration.postInit();
+11 -41
View File
@@ -22,7 +22,6 @@ package appeng.core;
import appeng.api.AEApi;
import appeng.api.config.Upgrades;
import appeng.api.definitions.IBlocks;
import appeng.api.definitions.IDefinitions;
import appeng.api.definitions.IItems;
import appeng.api.definitions.IParts;
import appeng.api.features.IRegistryContainer;
@@ -36,9 +35,9 @@ import appeng.api.networking.security.ISecurityGrid;
import appeng.api.networking.spatial.ISpatialCache;
import appeng.api.networking.storage.IStorageGrid;
import appeng.api.networking.ticking.ITickManager;
import appeng.bootstrap.ICriterionTriggerRegistry;
import appeng.bootstrap.IModelRegistry;
import appeng.bootstrap.components.*;
import appeng.capabilities.Capabilities;
import appeng.client.gui.implementations.GuiCellWorkbench;
import appeng.client.gui.implementations.GuiChest;
import appeng.client.gui.implementations.GuiCondenser;
@@ -72,7 +71,6 @@ import appeng.client.gui.implementations.GuiUpgradeable;
import appeng.client.gui.implementations.GuiVibrationChamber;
import appeng.client.gui.implementations.GuiWireless;
import appeng.client.gui.implementations.GuiWirelessTerm;
import appeng.client.render.cablebus.CableBusModel;
import appeng.client.render.effects.*;
import appeng.client.render.model.BiometricCardModel;
import appeng.client.render.model.DriveModel;
@@ -96,20 +94,19 @@ import appeng.fluids.registries.BasicFluidCellGuiHandler;
import appeng.me.cache.*;
import appeng.recipes.conditions.FeaturesEnabled;
import appeng.recipes.game.DisassembleRecipe;
import appeng.recipes.handlers.GrinderRecipe;
import appeng.recipes.handlers.GrinderRecipeSerializer;
import appeng.server.AECommand;
import appeng.tile.AEBaseTile;
import net.minecraft.advancements.CriteriaTriggers;
import net.minecraft.advancements.ICriterionInstance;
import net.minecraft.advancements.ICriterionTrigger;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.ScreenManager;
import net.minecraft.client.renderer.ItemModelMesher;
import net.minecraft.client.renderer.model.ModelResourceLocation;
import net.minecraft.entity.EntityType;
import net.minecraft.inventory.container.ContainerType;
import net.minecraft.item.Item;
import net.minecraft.item.crafting.IRecipeSerializer;
import net.minecraft.item.crafting.IRecipeType;
import net.minecraft.particles.ParticleType;
import net.minecraft.tileentity.TileEntityType;
import net.minecraft.util.ResourceLocation;
@@ -118,9 +115,9 @@ import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.client.event.*;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.common.crafting.CraftingHelper;
import net.minecraftforge.common.crafting.conditions.IConditionSerializer;
import net.minecraftforge.common.extensions.IForgeContainerType;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.eventbus.api.Event;
import net.minecraftforge.fml.DistExecutor;
import net.minecraftforge.fml.event.server.FMLServerStartingEvent;
import net.minecraftforge.fml.loading.FMLEnvironment;
@@ -128,8 +125,6 @@ import net.minecraftforge.fml.network.IContainerFactory;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.IForgeRegistry;
import java.lang.reflect.Method;
final class Registration
{
@@ -143,23 +138,7 @@ final class Registration
// int storageDimensionID;
// Biome storageBiome;
AdvancementTriggers advancementTriggers;
//
// void preInitialize( final FMLPreInitializationEvent event )
// {
// Capabilities.register();
//
// final Api api = AEApi.instance();
// final IRecipeHandlerRegistry recipeRegistry = api.registries().recipes();
// this.registerCraftHandlers( recipeRegistry );
//
// MinecraftForge.EVENT_BUS.register( OreDictionaryHandler.INSTANCE );
//
// ApiDefinitions definitions = api.definitions();
//
// // Register
// definitions.getRegistry().getBootstrapComponents( IPreInitComponent.class ).forEachRemaining( b -> b.preInitialize( event.getSide() ) );
// }
//
// private void registerSpatialBiome( IForgeRegistry<Biome> registry )
// {
// if( !AEConfig.instance().isFeatureEnabled( AEFeature.SPATIAL_IO ) )
@@ -209,11 +188,6 @@ final class Registration
// this.storageDimensionID = config.getStorageDimensionID();
//
// DimensionManager.registerDimension( this.storageDimensionID, this.storageDimensionType );
// }
//
// private void registerCraftHandlers( final IRecipeHandlerRegistry registry )
// {
// registry.addNewSubItemResolver( new AEItemResolver() );
// }
public static void setupInternalRegistries()
@@ -264,15 +238,9 @@ final class Registration
final IModelRegistry registry = new IModelRegistry() {
@Override
public void registerItemVariants(Item item, ResourceLocation... names) {
// FIXME REMOVE OR IMPL
}
@Override
public void setCustomModelResourceLocation(Item item, int metadata, ModelResourceLocation model) {
// FIXME: this does not actually work
ItemModelMesher mesher = Minecraft.getInstance().getItemRenderer().getItemModelMesher();
mesher.register(item, model);
}
};
final Dist dist = FMLEnvironment.dist;
definitions.getRegistry().getBootstrapComponents( IModelRegistrationComponent.class ).forEachRemaining(b -> b.modelRegistration( dist, registry ) );
@@ -611,7 +579,6 @@ final class Registration
ContainerOpener.addOpener(type, opener);
return type;
}
public void registerRecipeSerializers( RegistryEvent.Register<IRecipeSerializer<?>> event )
{
IForgeRegistry<IRecipeSerializer<?>> r = event.getRegistry();
@@ -619,8 +586,11 @@ final class Registration
// TODO: Do not use the internal API
final ApiDefinitions definitions = Api.INSTANCE.definitions();
GrinderRecipe.TYPE = new AERecipeType<>(GrinderRecipeSerializer.INSTANCE.getRegistryName());
r.registerAll(
DisassembleRecipe.SERIALIZER
DisassembleRecipe.SERIALIZER,
GrinderRecipeSerializer.INSTANCE
// FacadeRecipe.getSerializer( (ItemFacade) definitions.items().facade().item() ) FIXME reimplement facades
// this.factories.put( new ResourceLocation( AppEng.MOD_ID, "inscriber" ), new InscriberHandler() ); FIXME re-implement machine recipes
// this.factories.put( new ResourceLocation( AppEng.MOD_ID, "smelt" ), new SmeltingHandler() );
@@ -310,6 +310,10 @@ public final class ApiItems implements IItems
private static AEColoredItemDefinition createPaintBalls(FeatureFactory registry, String idSuffix, boolean lumen) {
ColoredItemDefinition colors = new ColoredItemDefinition();
for (AEColor color : AEColor.values()) {
if (color == AEColor.TRANSPARENT) {
continue; // Fluix paintballs don't exist
}
String id = color.registryPrefix + idSuffix;
IItemDefinition paintBall = registry.item(id, props -> new ItemPaintBall(props, color, lumen))
.features(AEFeature.PAINT_BALLS)
@@ -16,16 +16,23 @@
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
*/
package appeng.bootstrap.components;
package appeng.integration;
import net.minecraftforge.api.distmarker.Dist;
import appeng.bootstrap.IBootstrapComponent;
@FunctionalInterface
public interface IPreInitComponent extends IBootstrapComponent
public interface IIntegrationModule
{
void preInitialize( Dist dist );
default boolean isEnabled()
{
return true;
}
class Stub implements IIntegrationModule
{
@Override
public boolean isEnabled()
{
return false;
}
}
}
@@ -0,0 +1,43 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Applied Energistics 2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
*/
package appeng.integration.abstraction;
import appeng.integration.IIntegrationModule;
/**
* Abstracts access to the JEI API functionality.
*/
public interface IJEI extends IIntegrationModule
{
default String getSearchText()
{
return "";
}
default void setSearchText( String searchText )
{
}
class Stub extends IIntegrationModule.Stub implements IJEI
{
}
}
@@ -0,0 +1,213 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Applied Energistics 2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
*/
package appeng.integration.modules.jei;
import appeng.api.AEApi;
import appeng.api.config.CondenserOutput;
import appeng.api.definitions.IMaterials;
import appeng.api.implementations.items.IStorageComponent;
import appeng.core.Api;
import appeng.core.AppEng;
import appeng.tile.misc.TileCondenser;
import com.google.common.base.Splitter;
import mezz.jei.api.constants.VanillaTypes;
import mezz.jei.api.gui.IRecipeLayout;
import mezz.jei.api.gui.drawable.IDrawable;
import mezz.jei.api.gui.drawable.IDrawableAnimated;
import mezz.jei.api.gui.drawable.IDrawableStatic;
import mezz.jei.api.gui.ingredient.IGuiItemStackGroup;
import mezz.jei.api.helpers.IGuiHelper;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.category.IRecipeCategory;
import net.minecraft.client.resources.I18n;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.client.gui.HoverChecker;
import java.util.*;
class CondenserCategory implements IRecipeCategory<CondenserOutput>
{
public static final ResourceLocation UID = new ResourceLocation(AppEng.MOD_ID, "condenser");
private final String localizedName;
private final IDrawable background;
private final IDrawable iconTrash;
private final IDrawableAnimated progress;
private final IDrawable iconButton;
private final IDrawable icon;
private final HoverChecker buttonHoverChecker;
private final Map<CondenserOutput, IDrawable> buttonIcons;
public CondenserCategory( IGuiHelper guiHelper )
{
this.localizedName = I18n.format( "gui.appliedenergistics2.Condenser" );
this.icon = guiHelper.createDrawableIngredient(Api.INSTANCE.definitions().blocks().condenser().stack(1));
ResourceLocation location = new ResourceLocation( AppEng.MOD_ID, "textures/guis/condenser.png" );
this.background = guiHelper.createDrawable( location, 50, 25, 94, 48 );
ResourceLocation statesLocation = new ResourceLocation( AppEng.MOD_ID, "textures/guis/states.png" );
this.iconTrash = guiHelper.drawableBuilder( statesLocation, 241, 81, 14, 14 )
.addPadding(28, 0, 2, 0)
.build();
this.iconButton = guiHelper.drawableBuilder( statesLocation, 240, 240, 16, 16 )
.addPadding(28, 0, 78, 0)
.build();
IDrawableStatic progressDrawable = guiHelper.drawableBuilder( location, 178, 25, 6, 18 )
.addPadding(0, 0, 70, 0)
.build();
this.progress = guiHelper.createAnimatedDrawable( progressDrawable, 40, IDrawableAnimated.StartDirection.BOTTOM, false );
this.buttonIcons = new EnumMap<>(CondenserOutput.class);
this.buttonIcons.put(CondenserOutput.MATTER_BALLS, guiHelper.drawableBuilder( statesLocation, 16, 112, 14, 14 ).addPadding(28, 0, 78, 0).build());
this.buttonIcons.put(CondenserOutput.SINGULARITY, guiHelper.drawableBuilder( statesLocation, 32, 112, 14, 14).addPadding(28, 0, 78, 0).build());
this.buttonHoverChecker = new HoverChecker( 28, 28 + 16, 78, 78 + 16, 0 );
}
private ItemStack getOutput( CondenserOutput recipe )
{
switch( recipe )
{
case MATTER_BALLS:
return Api.INSTANCE.definitions().materials().matterBall().stack(1);
case SINGULARITY:
return Api.INSTANCE.definitions().materials().singularity().stack(1);
default:
return ItemStack.EMPTY;
}
}
@Override
public ResourceLocation getUid()
{
return CondenserCategory.UID;
}
@Override
public Class<? extends CondenserOutput> getRecipeClass() {
return CondenserOutput.class;
}
@Override
public String getTitle()
{
return this.localizedName;
}
@Override
public IDrawable getBackground()
{
return this.background;
}
@Override
public IDrawable getIcon() {
return icon;
}
@Override
public void setIngredients(CondenserOutput recipe, IIngredients ingredients) {
ingredients.setOutput(VanillaTypes.ITEM, getOutput(recipe) );
}
@Override
public void draw(CondenserOutput recipe, double mouseX, double mouseY) {
this.progress.draw();
this.iconTrash.draw();
this.iconButton.draw();
IDrawable buttonIcon = this.buttonIcons.get(recipe);
if (buttonIcon != null) {
buttonIcon.draw();
}
}
@Override
public void setRecipe(IRecipeLayout recipeLayout, CondenserOutput output, IIngredients ingredients )
{
IGuiItemStackGroup itemStacks = recipeLayout.getItemStacks();
itemStacks.init( 0, false, 54, 26 );
// Get all storage cells and cycle them through a fake input slot
itemStacks.init( 1, true, 50, 0 );
itemStacks.set( 1, this.getViableStorageComponents( output ) );
// This only sets the output
itemStacks.set( ingredients );
}
private List<ItemStack> getViableStorageComponents(CondenserOutput condenserOutput )
{
IMaterials materials = AEApi.instance().definitions().materials();
List<ItemStack> viableComponents = new ArrayList<>();
materials.cell1kPart().maybeStack( 1 ).ifPresent( itemStack -> this.addViableComponent( condenserOutput, viableComponents, itemStack ) );
materials.cell4kPart().maybeStack( 1 ).ifPresent( itemStack -> this.addViableComponent( condenserOutput, viableComponents, itemStack ) );
materials.cell16kPart().maybeStack( 1 ).ifPresent( itemStack -> this.addViableComponent( condenserOutput, viableComponents, itemStack ) );
materials.cell64kPart().maybeStack( 1 ).ifPresent( itemStack -> this.addViableComponent( condenserOutput, viableComponents, itemStack ) );
return viableComponents;
}
private void addViableComponent(CondenserOutput condenserOutput, List<ItemStack> viableComponents, ItemStack itemStack )
{
IStorageComponent comp = (IStorageComponent) itemStack.getItem();
int storage = comp.getBytes( itemStack ) * TileCondenser.BYTE_MULTIPLIER;
if( storage >= condenserOutput.requiredPower )
{
viableComponents.add( itemStack );
}
}
@Override
public List<String> getTooltipStrings(CondenserOutput output, double mouseX, double mouseY) {
if( this.buttonHoverChecker.checkHover( (int) mouseX, (int) mouseY ) )
{
String key;
switch( output )
{
case MATTER_BALLS:
key = "gui.tooltips.appliedenergistics2.MatterBalls";
break;
case SINGULARITY:
key = "gui.tooltips.appliedenergistics2.Singularity";
break;
default:
return Collections.emptyList();
}
return Splitter.on( "\\n" ).splitToList( I18n.format( key, output.requiredPower ) );
}
return Collections.emptyList();
}
}
@@ -0,0 +1,149 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Applied Energistics 2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
*/
package appeng.integration.modules.jei;
import appeng.core.Api;
import appeng.core.AppEng;
import appeng.recipes.handlers.GrinderOptionalResult;
import appeng.recipes.handlers.GrinderRecipe;
import mezz.jei.api.constants.VanillaTypes;
import mezz.jei.api.gui.IRecipeLayout;
import mezz.jei.api.gui.drawable.IDrawable;
import mezz.jei.api.gui.ingredient.IGuiItemStackGroup;
import mezz.jei.api.helpers.IGuiHelper;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.category.IRecipeCategory;
import net.minecraft.client.resources.I18n;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import java.awt.*;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
class GrinderRecipeCategory implements IRecipeCategory<GrinderRecipe>
{
public static final ResourceLocation UID = new ResourceLocation(AppEng.MOD_ID, "grinder");
private final String localizedName;
private final IDrawable background;
private final IDrawable icon;
public GrinderRecipeCategory( IGuiHelper guiHelper )
{
this.localizedName = I18n.format( "tile.appliedenergistics2.grindstone.name" );
ResourceLocation location = new ResourceLocation( AppEng.MOD_ID, "textures/guis/grinder.png" );
this.background = guiHelper.createDrawable( location, 11, 16, 154, 70 );
this.icon = guiHelper.createDrawableIngredient(Api.INSTANCE.definitions().blocks().grindstone().stack(1));
}
@Override
public ResourceLocation getUid()
{
return GrinderRecipeCategory.UID;
}
@Override
public String getTitle()
{
return this.localizedName;
}
@Override
public IDrawable getBackground()
{
return this.background;
}
@Override
public void setRecipe(IRecipeLayout recipeLayout, GrinderRecipe recipe, IIngredients ingredients )
{
IGuiItemStackGroup itemStacks = recipeLayout.getItemStacks();
itemStacks.init( 0, true, 0, 0 );
itemStacks.init( 1, false, 100, 46 );
itemStacks.init( 2, false, 118, 46 );
itemStacks.init( 3, false, 136, 46 );
itemStacks.set( ingredients );
}
@Override
public Class<? extends GrinderRecipe> getRecipeClass() {
return GrinderRecipe.class;
}
@Override
public IDrawable getIcon() {
return icon;
}
@Override
public void setIngredients(GrinderRecipe recipe, IIngredients ingredients) {
ingredients.setInputIngredients(Collections.singletonList(recipe.getIngredient()));
List<ItemStack> outputs = new ArrayList<>( 3 );
outputs.add( recipe.getRecipeOutput() );
for (GrinderOptionalResult optionalResult : recipe.getOptionalResults()) {
outputs.add(optionalResult.getResult());
}
ingredients.setOutputs( VanillaTypes.ITEM, outputs );
}
// FIXME USE SPECIAL INGREDIENT TYPE
// FIXME @Override
// FIXME public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY )
// FIXME {
// FIXME
// FIXME FontRenderer fr = Minecraft.getMinecraft().fontRenderer;
// FIXME
// FIXME int x = 118;
// FIXME
// FIXME final float scale = 0.85f;
// FIXME final float invScale = 1 / scale;
// FIXME GlStateManager.scale( scale, scale, 1 );
// FIXME
// FIXME if( this.recipe.getOptionalOutput() != null )
// FIXME {
// FIXME String text = String.format( "%d%%", (int) ( this.recipe.getOptionalChance() * 100 ) );
// FIXME float width = fr.getStringWidth( text ) * scale;
// FIXME int xScaled = Math.round( ( x + ( 18 - width ) / 2 ) * invScale );
// FIXME fr.drawString( text, xScaled, (int) ( 65 * invScale ), Color.gray.getRGB() );
// FIXME x += 18;
// FIXME }
// FIXME
// FIXME if( this.recipe.getSecondOptionalOutput() != null )
// FIXME {
// FIXME String text = String.format( "%d%%", (int) ( this.recipe.getSecondOptionalChance() * 100 ) );
// FIXME float width = fr.getStringWidth( text ) * scale;
// FIXME int xScaled = Math.round( ( x + ( 18 - width ) / 2 ) * invScale );
// FIXME fr.drawString( text, xScaled, (int) ( 65 * invScale ), Color.gray.getRGB() );
// FIXME }
// FIXME
// FIXME GlStateManager.scale( invScale, invScale, 1 );
// FIXME }
}
@@ -0,0 +1,127 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Applied Energistics 2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
*/
package appeng.integration.modules.jei;
import appeng.core.Api;
import appeng.core.AppEng;
import appeng.recipes.handlers.InscriberRecipe;
import mezz.jei.api.constants.VanillaTypes;
import mezz.jei.api.gui.*;
import mezz.jei.api.gui.drawable.IDrawable;
import mezz.jei.api.gui.drawable.IDrawableAnimated;
import mezz.jei.api.gui.drawable.IDrawableStatic;
import mezz.jei.api.gui.ingredient.IGuiItemStackGroup;
import mezz.jei.api.helpers.IGuiHelper;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.category.IRecipeCategory;
import net.minecraft.client.resources.I18n;
import net.minecraft.util.ResourceLocation;
class InscriberRecipeCategory implements IRecipeCategory<InscriberRecipe>
{
private static final int SLOT_INPUT_TOP = 0;
private static final int SLOT_INPUT_MIDDLE = 1;
private static final int SLOT_INPUT_BOTTOM = 2;
private static final int SLOT_OUTPUT = 3;
static final ResourceLocation UID = new ResourceLocation(AppEng.MOD_ID, "appliedenergistics2.inscriber");
private final IDrawable background;
private final String localizedName;
private final IDrawableAnimated progress;
private final IDrawable icon;
public InscriberRecipeCategory( IGuiHelper guiHelper )
{
ResourceLocation location = new ResourceLocation( AppEng.MOD_ID, "textures/guis/inscriber.png" );
this.background = guiHelper.createDrawable( location, 44, 15, 97, 64 );
this.localizedName = I18n.format( "tile.appliedenergistics2.inscriber.name" );
IDrawableStatic progressDrawable = guiHelper.drawableBuilder( location, 135, 177, 6, 18 )
.addPadding(24, 0, 91, 0)
.build();
this.progress = guiHelper.createAnimatedDrawable( progressDrawable, 40, IDrawableAnimated.StartDirection.BOTTOM, false );
this.icon = guiHelper.createDrawableIngredient(Api.INSTANCE.definitions().blocks().inscriber().stack(1));
}
@Override
public ResourceLocation getUid()
{
return UID;
}
@Override
public String getTitle()
{
return this.localizedName;
}
@Override
public IDrawable getBackground()
{
return this.background;
}
@Override
public void setRecipe(IRecipeLayout recipeLayout, InscriberRecipe recipeWrapper, IIngredients ingredients )
{
IGuiItemStackGroup itemStacks = recipeLayout.getItemStacks();
itemStacks.init( SLOT_INPUT_TOP, true, 0, 0 );
itemStacks.init( SLOT_INPUT_MIDDLE, true, 18, 23 );
itemStacks.init( SLOT_INPUT_BOTTOM, true, 0, 46 );
itemStacks.init( SLOT_OUTPUT, false, 68, 24 );
itemStacks.set( ingredients );
}
@Override
public Class<? extends InscriberRecipe> getRecipeClass() {
return InscriberRecipe.class;
}
@Override
public IDrawable getIcon() {
return this.icon;
}
@Override
public void setIngredients(InscriberRecipe recipe, IIngredients ingredients) {
// FIXME List<List<ItemStack>> inputSlots = new ArrayList<>( 3 );
// FIXME inputSlots.add( Collections.singletonList( recipe.getTopOptional() ) );
// FIXME inputSlots.add( recipe.getInputs() );
// FIXME inputSlots.add( Collections.singletonList( recipe.getBottomOptional() ) );
// FIXME ingredients.setInputLists(VanillaTypes.ITEM, inputSlots );
ingredients.setOutput( VanillaTypes.ITEM, recipe.getOutput() );
}
@Override
public void draw(InscriberRecipe recipe, double mouseX, double mouseY) {
this.progress.draw();
}
}
@@ -16,37 +16,43 @@
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
*/
package appeng.bootstrap.components;
package appeng.integration.modules.jei;
import com.google.common.base.Preconditions;
import net.minecraft.client.renderer.model.IUnbakedModel;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import appeng.integration.abstraction.IJEI;
import java.util.HashMap;
import java.util.Map;
@OnlyIn( Dist.CLIENT )
public class BuiltInModelComponent implements IPreInitComponent
public class JEIModule implements IJEI
{
private final Map<String, IUnbakedModel> builtInModels = new HashMap<>();
private IJEI jei = new IJEI.Stub();
private boolean hasInitialized = false;
public void addModel( String path, IUnbakedModel model )
public void setJei( IJEI jei )
{
Preconditions.checkState( !this.hasInitialized );
this.builtInModels.put( path, model );
this.jei = jei;
}
public IJEI getJei()
{
return this.jei;
}
@Override
public void preInitialize( Dist dist )
public String getSearchText()
{
this.hasInitialized = true;
//
// BuiltInModelLoader loader = new BuiltInModelLoader( this.builtInModels );
// ModelLoaderRegistry.registerLoader( loader );
return this.jei.getSearchText();
}
@Override
public void setSearchText( String searchText )
{
this.jei.setSearchText( searchText );
}
@Override
public boolean isEnabled()
{
return this.jei.isEnabled();
}
}
@@ -0,0 +1,190 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Applied Energistics 2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
*/
package appeng.integration.modules.jei;
import appeng.api.AEApi;
import appeng.api.config.CondenserOutput;
import appeng.api.definitions.IDefinitions;
import appeng.api.definitions.IItemDefinition;
import appeng.api.definitions.IMaterials;
import appeng.api.features.AEFeature;
import appeng.container.implementations.ContainerCraftingTerm;
import appeng.container.implementations.ContainerPatternTerm;
import appeng.core.AEConfig;
import appeng.core.AppEng;
import appeng.core.localization.GuiText;
import appeng.recipes.handlers.GrinderRecipe;
import com.google.common.collect.ImmutableList;
import mezz.jei.api.IModPlugin;
import mezz.jei.api.JeiPlugin;
import mezz.jei.api.constants.VanillaRecipeCategoryUid;
import mezz.jei.api.constants.VanillaTypes;
import mezz.jei.api.registration.*;
import mezz.jei.api.runtime.IJeiRuntime;
import net.minecraft.client.Minecraft;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.RecipeManager;
import net.minecraft.util.ResourceLocation;
import java.util.Optional;
@JeiPlugin
public class JEIPlugin implements IModPlugin
{
private static final ResourceLocation ID = new ResourceLocation(AppEng.MOD_ID, "core");
@Override
public ResourceLocation getPluginUid() {
return ID;
}
@Override
public void registerItemSubtypes( ISubtypeRegistration subtypeRegistry )
{
final Optional<Item> maybeFacade = AEApi.instance().definitions().items().facade().maybeItem();
maybeFacade.ifPresent( subtypeRegistry::useNbtForSubtypes );
}
@Override
public void registerCategories( IRecipeCategoryRegistration registry )
{
registry.addRecipeCategories( new GrinderRecipeCategory( registry.getJeiHelpers().getGuiHelper() ),
new CondenserCategory( registry.getJeiHelpers().getGuiHelper() ),
new InscriberRecipeCategory( registry.getJeiHelpers().getGuiHelper() ) );
}
@Override
public void registerRecipeTransferHandlers(IRecipeTransferRegistration registration) {
// Allow recipe transfer from JEI to crafting and pattern terminal
registration
.addRecipeTransferHandler( new RecipeTransferHandler<>( ContainerCraftingTerm.class ),
VanillaRecipeCategoryUid.CRAFTING );
registration
.addRecipeTransferHandler( new RecipeTransferHandler<>( ContainerPatternTerm.class ),
VanillaRecipeCategoryUid.CRAFTING );
}
@Override
public void registerRecipes(IRecipeRegistration registration) {
IDefinitions definitions = AEApi.instance().definitions();
// FIXME Optional<Item> itemFacade = definitions.items().facade().maybeItem();
// FIXME Optional<ItemStack> cableAnchor = definitions.parts().cableAnchor().maybeStack( 1 );
// FIXME if( itemFacade.isPresent() && cableAnchor.isPresent() && AEConfig.instance().isFeatureEnabled( AEFeature.ENABLE_FACADE_CRAFTING ) )
// FIXME {
// FIXME registration.addRecipeRegistryPlugin( new FacadeRegistryPlugin( (ItemFacade) itemFacade.get(), cableAnchor.get() ) );
// FIXME }
ItemStack condenser = definitions.blocks().condenser().maybeStack( 1 ).orElse( ItemStack.EMPTY );
if(!condenser.isEmpty()) {
ItemStack matterBall = definitions.materials().matterBall().maybeStack(1).orElse(ItemStack.EMPTY);
if (!matterBall.isEmpty()) {
registration.addRecipes(ImmutableList.of(CondenserOutput.MATTER_BALLS), CondenserCategory.UID);
}
ItemStack singularity = definitions.materials().singularity().maybeStack(1).orElse(ItemStack.EMPTY);
if (!singularity.isEmpty()) {
registration.addRecipes(ImmutableList.of(CondenserOutput.SINGULARITY), CondenserCategory.UID);
}
}
RecipeManager recipeManager = Minecraft.getInstance().world.getRecipeManager();
registration.addRecipes(recipeManager.getRecipes(GrinderRecipe.TYPE).values(), GrinderRecipeCategory.UID);
// FIXME registration.addRecipes( recipeManager.getRecipes(InscriberRecipe.TYPE), InscriberRecipeCategory.UID );
registration.addRecipes(ImmutableList.of(CondenserOutput.MATTER_BALLS, CondenserOutput.SINGULARITY), CondenserCategory.UID);
}
@Override
public void registerRecipeCatalysts(IRecipeCatalystRegistration registration) {
IDefinitions definitions = AEApi.instance().definitions();
ItemStack grindstone = definitions.blocks().grindstone().maybeStack( 1 ).orElse( ItemStack.EMPTY );
if( !grindstone.isEmpty() )
{
registration.addRecipeCatalyst( grindstone, GrinderRecipeCategory.UID );
}
definitions.blocks().condenser().maybeStack( 1 ).ifPresent(condenser -> {
registration.addRecipeCatalyst(condenser, CondenserCategory.UID);
});
// Register the inscriber as the crafting item for the inscription category
definitions.blocks().inscriber().maybeStack( 1 ).ifPresent( inscriber ->
{
registration.addRecipeCatalyst( inscriber, InscriberRecipeCategory.UID );
} );
}
private void registerDescriptions(IDefinitions definitions, IRecipeRegistration registry )
{
IMaterials materials = definitions.materials();
final String message;
if( AEConfig.instance().isFeatureEnabled( AEFeature.CERTUS_QUARTZ_WORLD_GEN ) )
{
message = GuiText.ChargedQuartz.getLocal() + "\n\n" + GuiText.ChargedQuartzFind.getLocal();
}
else
{
message = GuiText.ChargedQuartzFind.getLocal();
}
this.addDescription( registry, materials.certusQuartzCrystalCharged(), message );
if( AEConfig.instance().isFeatureEnabled( AEFeature.METEORITE_WORLD_GEN ) )
{
this.addDescription( registry, materials.logicProcessorPress(), GuiText.inWorldCraftingPresses.getLocal() );
this.addDescription( registry, materials.calcProcessorPress(), GuiText.inWorldCraftingPresses.getLocal() );
this.addDescription( registry, materials.engProcessorPress(), GuiText.inWorldCraftingPresses.getLocal() );
}
if( AEConfig.instance().isFeatureEnabled( AEFeature.IN_WORLD_FLUIX ) )
{
this.addDescription( registry, materials.fluixCrystal(), GuiText.inWorldFluix.getLocal() );
}
if( AEConfig.instance().isFeatureEnabled( AEFeature.IN_WORLD_SINGULARITY ) )
{
this.addDescription( registry, materials.qESingularity(), GuiText.inWorldSingularity.getLocal() );
}
if( AEConfig.instance().isFeatureEnabled( AEFeature.IN_WORLD_PURIFICATION ) )
{
this.addDescription( registry, materials.purifiedCertusQuartzCrystal(), GuiText.inWorldPurificationCertus.getLocal() );
this.addDescription( registry, materials.purifiedNetherQuartzCrystal(), GuiText.inWorldPurificationNether.getLocal() );
this.addDescription( registry, materials.purifiedFluixCrystal(), GuiText.inWorldPurificationFluix.getLocal() );
}
}
private void addDescription(IRecipeRegistration registry, IItemDefinition itemDefinition, String message )
{
itemDefinition.maybeStack( 1 ).ifPresent( itemStack -> registry.addIngredientInfo( itemStack, VanillaTypes.ITEM, message ) );
}
@Override
public void onRuntimeAvailable( IJeiRuntime jeiRuntime )
{
// FIXME JEIModule jeiModule = (JEIModule) Integrations.jei();
// FIXME jeiModule.setJei( new JeiRuntimeAdapter( jeiRuntime ) );
}
}
@@ -0,0 +1,53 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Applied Energistics 2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
*/
package appeng.integration.modules.jei;
import appeng.integration.abstraction.IJEI;
import com.google.common.base.Strings;
import mezz.jei.api.runtime.IJeiRuntime;
class JeiRuntimeAdapter implements IJEI
{
private final IJeiRuntime runtime;
JeiRuntimeAdapter( IJeiRuntime jeiRuntime )
{
this.runtime = jeiRuntime;
}
@Override
public boolean isEnabled()
{
return true;
}
@Override
public String getSearchText()
{
return Strings.nullToEmpty( this.runtime.getIngredientFilter().getFilterText() );
}
@Override
public void setSearchText( String searchText )
{
this.runtime.getIngredientFilter().setFilterText( Strings.nullToEmpty( searchText ) );
}
}
@@ -0,0 +1,131 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Applied Energistics 2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
*/
package appeng.integration.modules.jei;
import appeng.container.slot.SlotCraftingMatrix;
import appeng.container.slot.SlotFakeCraftingMatrix;
import appeng.core.AELog;
import appeng.core.sync.network.NetworkHandler;
import appeng.core.sync.packets.PacketJEIRecipe;
import appeng.util.Platform;
import mezz.jei.api.gui.IRecipeLayout;
import mezz.jei.api.gui.ingredient.IGuiIngredient;
import mezz.jei.api.recipe.transfer.IRecipeTransferError;
import mezz.jei.api.recipe.transfer.IRecipeTransferHandler;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.inventory.container.Container;
import net.minecraft.inventory.container.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.nbt.ListNBT;
import javax.annotation.Nullable;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
class RecipeTransferHandler<T extends Container> implements IRecipeTransferHandler<T>
{
private final Class<T> containerClass;
RecipeTransferHandler( Class<T> containerClass )
{
this.containerClass = containerClass;
}
@Override
public Class<T> getContainerClass()
{
return this.containerClass;
}
@Nullable
@Override
public IRecipeTransferError transferRecipe(T container, IRecipeLayout recipeLayout, PlayerEntity player, boolean maxTransfer, boolean doTransfer) {
if( !doTransfer )
{
return null;
}
Map<Integer, ? extends IGuiIngredient<ItemStack>> ingredients = recipeLayout.getItemStacks().getGuiIngredients();
final CompoundNBT recipe = new CompoundNBT();
int slotIndex = 0;
for( Map.Entry<Integer, ? extends IGuiIngredient<ItemStack>> ingredientEntry : ingredients.entrySet() )
{
IGuiIngredient<ItemStack> ingredient = ingredientEntry.getValue();
if( !ingredient.isInput() )
{
continue;
}
for( final Slot slot : container.inventorySlots )
{
if( slot instanceof SlotCraftingMatrix || slot instanceof SlotFakeCraftingMatrix)
{
if( slot.getSlotIndex() == slotIndex )
{
final ListNBT tags = new ListNBT();
final List<ItemStack> list = new ArrayList<>();
final ItemStack displayed = ingredient.getDisplayedIngredient();
// prefer currently displayed item
if( displayed != null && !displayed.isEmpty() )
{
list.add( displayed );
}
// prefer pure crystals.
for( ItemStack stack : ingredient.getAllIngredients() )
{
if( Platform.isRecipePrioritized( stack ) )
{
list.add( 0, stack );
}
else
{
list.add( stack );
}
}
for( final ItemStack is : list )
{
final CompoundNBT tag = new CompoundNBT();
is.write( tag );
tags.add( tag );
}
recipe.put( "#" + slot.getSlotIndex(), tags );
break;
}
}
}
slotIndex++;
}
NetworkHandler.instance().sendToServer( new PacketJEIRecipe( recipe ) );
return null;
}
}
@@ -1,49 +0,0 @@
package appeng.recipes.handlers;
import com.google.gson.JsonObject;
import net.minecraft.item.ItemStack;
import net.minecraft.util.JSONUtils;
import net.minecraftforge.common.crafting.CraftingHelper;
import net.minecraftforge.common.crafting.JsonContext;
import appeng.api.AEApi;
import appeng.api.features.IGrinderRecipeBuilder;
import appeng.api.features.IGrinderRegistry;
import appeng.recipes.IAERecipeFactory;
import appeng.recipes.factories.recipes.PartRecipeFactory;
public class GrinderHandler implements IAERecipeFactory
{
@Override
public void register( JsonObject json, JsonContext ctx )
{
// TODO only primary for now
JsonObject result = JSONUtils.getJsonObject( json, "result" );
ItemStack primary = PartRecipeFactory.getResult( result, ctx, "primary" );
ItemStack[] input = CraftingHelper.getIngredient( json.get( "input" ), ctx ).getMatchingStacks();
int turns = 5;
if( json.has( "turns" ) )
{
turns = JSONUtils.getInt( json, "turns" );
}
final IGrinderRegistry reg = AEApi.instance().registries().grinder();
for( int i = 0; i < input.length; ++i )
{
final IGrinderRecipeBuilder builder = reg.builder();
builder.withOutput( primary );
builder.withInput( input[i] );
builder.withTurns( turns );
reg.addRecipe( builder.build() );
}
}
}
@@ -0,0 +1,27 @@
package appeng.recipes.handlers;
import net.minecraft.item.ItemStack;
/**
* Describes an optional result of a grinder recipe.
*/
public class GrinderOptionalResult {
private final float chance;
private final ItemStack result;
public GrinderOptionalResult(float chance, ItemStack result) {
this.chance = chance;
this.result = result;
}
/**
* Chance to occur from 0 (0%) to 1 (100%).
*/
public float getChance() {
return chance;
}
public ItemStack getResult() {
return result;
}
}
@@ -0,0 +1,86 @@
package appeng.recipes.handlers;
import com.google.common.collect.ImmutableList;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.item.crafting.IRecipeSerializer;
import net.minecraft.item.crafting.IRecipeType;
import net.minecraft.item.crafting.Ingredient;
import net.minecraft.util.NonNullList;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import java.util.List;
public class GrinderRecipe implements IRecipe<IInventory> {
public static IRecipeType<GrinderRecipe> TYPE;
private final ResourceLocation id;
private final String group;
private final Ingredient ingredient;
private final ItemStack result;
private final List<GrinderOptionalResult> optionalResults;
private final int turns;
public GrinderRecipe(ResourceLocation id, String group, Ingredient ingredient, ItemStack result, int turns, List<GrinderOptionalResult> optionalResults) {
this.id = id;
this.group = group;
this.ingredient = ingredient;
this.result = result;
this.turns = turns;
this.optionalResults = ImmutableList.copyOf(optionalResults);
}
@Override
public boolean matches(IInventory inv, World worldIn) {
return this.ingredient.test(inv.getStackInSlot(0));
}
@Override
public ItemStack getCraftingResult(IInventory inv) {
// FIXME: What about secondary output
return this.result.copy();
}
@Override
public boolean canFit(int width, int height) {
return true;
}
@Override
public ItemStack getRecipeOutput() {
return result;
}
@Override
public ResourceLocation getId() {
return id;
}
@Override
public IRecipeSerializer<?> getSerializer() {
return GrinderRecipeSerializer.INSTANCE;
}
@Override
public IRecipeType<?> getType() {
return TYPE;
}
public Ingredient getIngredient() {
return ingredient;
}
@Override
public NonNullList<Ingredient> getIngredients() {
NonNullList<Ingredient> nonnulllist = NonNullList.create();
nonnulllist.add(this.ingredient);
return nonnulllist;
}
public List<GrinderOptionalResult> getOptionalResults() {
return optionalResults;
}
}
@@ -0,0 +1,69 @@
package appeng.recipes.handlers;
import appeng.core.AppEng;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipeSerializer;
import net.minecraft.item.crafting.Ingredient;
import net.minecraft.item.crafting.ShapedRecipe;
import net.minecraft.network.PacketBuffer;
import net.minecraft.util.JSONUtils;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.registries.ForgeRegistryEntry;
import javax.annotation.Nullable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class GrinderRecipeSerializer extends ForgeRegistryEntry<IRecipeSerializer<?>> implements IRecipeSerializer<GrinderRecipe> {
public static final GrinderRecipeSerializer INSTANCE = new GrinderRecipeSerializer();
static {
INSTANCE.setRegistryName(AppEng.MOD_ID, "grinder");
}
private GrinderRecipeSerializer() {
}
@Override
public GrinderRecipe read(ResourceLocation recipeId, JsonObject json) {
String group = JSONUtils.getString(json, "group", "");
Ingredient ingredient = Ingredient.deserialize(JSONUtils.getJsonObject(json, "input"));
JsonObject result = JSONUtils.getJsonObject(json, "result");
ItemStack primaryResult = ShapedRecipe.deserializeItem(JSONUtils.getJsonObject(result, "primary"));
JsonArray optionalResultsJson = JSONUtils.getJsonArray(result, "optional", null);
List<GrinderOptionalResult> optionalResults = Collections.emptyList();
if (optionalResultsJson != null) {
optionalResults = new ArrayList<>(optionalResultsJson.size());
for (JsonElement optionalResultJson : optionalResultsJson) {
if (!optionalResultJson.isJsonObject()) {
throw new IllegalStateException("Entry in optional result list should be an object.");
}
ItemStack optionalResultItem = ShapedRecipe.deserializeItem(optionalResultJson.getAsJsonObject());
float optionalChance = JSONUtils.getFloat(optionalResultJson.getAsJsonObject(), "chance", 1.0f);
optionalResults.add(new GrinderOptionalResult(optionalChance, optionalResultItem));
}
}
int turns = JSONUtils.getInt(json, "turns", 8);
return new GrinderRecipe(recipeId, group, ingredient, primaryResult, turns, optionalResults);
}
@Nullable
@Override
public GrinderRecipe read(ResourceLocation recipeId, PacketBuffer buffer) {
return null;
}
@Override
public void write(PacketBuffer buffer, GrinderRecipe recipe) {
}
}
@@ -2,70 +2,55 @@
package appeng.recipes.handlers;
import java.util.Arrays;
import java.util.List;
import com.google.gson.JsonObject;
import net.minecraft.item.ItemStack;
import net.minecraft.util.JSONUtils;
import net.minecraftforge.common.crafting.CraftingHelper;
import net.minecraftforge.common.crafting.JsonContext;
import appeng.api.AEApi;
import appeng.api.features.IInscriberRecipeBuilder;
import appeng.api.features.IInscriberRegistry;
import appeng.api.features.InscriberProcessType;
import appeng.recipes.IAERecipeFactory;
import appeng.recipes.factories.recipes.PartRecipeFactory;
public class InscriberHandler implements IAERecipeFactory
public class InscriberHandler
{
@Override
public void register( JsonObject json, JsonContext ctx )
{
ItemStack result = PartRecipeFactory.getResult( json, ctx );
String mode = JSONUtils.getString( json, "mode" );
JsonObject ingredients = JSONUtils.getJsonObject( json, "ingredients" );
List<ItemStack> middle = Arrays.asList( CraftingHelper.getIngredient( ingredients.get( "middle" ), ctx ).getMatchingStacks() );
ItemStack[] top = new ItemStack[] { null };
if( ingredients.has( "top" ) )
{
top = CraftingHelper.getIngredient( JSONUtils.getJsonObject( ingredients, "top" ), ctx ).getMatchingStacks();
}
ItemStack[] bottom = new ItemStack[] { null };
if( ingredients.has( "bottom" ) )
{
bottom = CraftingHelper.getIngredient( JSONUtils.getJsonObject( ingredients, "bottom" ), ctx ).getMatchingStacks();
}
final IInscriberRegistry reg = AEApi.instance().registries().inscriber();
for( int i = 0; i < top.length; ++i )
{
for( int j = 0; j < bottom.length; ++j )
{
final IInscriberRecipeBuilder builder = reg.builder();
builder.withOutput( result );
builder.withProcessType( "press".equals( mode ) ? InscriberProcessType.PRESS : InscriberProcessType.INSCRIBE );
builder.withInputs( middle );
if( top[i] != null )
{
builder.withTopOptional( top[i] );
}
if( bottom[j] != null )
{
builder.withBottomOptional( bottom[j] );
}
reg.addRecipe( builder.build() );
}
}
}
// @Override
// public void register( JsonObject json, JsonContext ctx )
// {
// ItemStack result = PartRecipeFactory.getResult( json, ctx );
// String mode = JSONUtils.getString( json, "mode" );
//
// JsonObject ingredients = JSONUtils.getJsonObject( json, "ingredients" );
//
// List<ItemStack> middle = Arrays.asList( CraftingHelper.getIngredient( ingredients.get( "middle" ), ctx ).getMatchingStacks() );
// ItemStack[] top = new ItemStack[] { null };
// if( ingredients.has( "top" ) )
// {
// top = CraftingHelper.getIngredient( JSONUtils.getJsonObject( ingredients, "top" ), ctx ).getMatchingStacks();
// }
//
// ItemStack[] bottom = new ItemStack[] { null };
// if( ingredients.has( "bottom" ) )
// {
// bottom = CraftingHelper.getIngredient( JSONUtils.getJsonObject( ingredients, "bottom" ), ctx ).getMatchingStacks();
// }
//
// final IInscriberRegistry reg = AEApi.instance().registries().inscriber();
// for( int i = 0; i < top.length; ++i )
// {
// for( int j = 0; j < bottom.length; ++j )
// {
// final IInscriberRecipeBuilder builder = reg.builder();
// builder.withOutput( result );
// builder.withProcessType( "press".equals( mode ) ? InscriberProcessType.PRESS : InscriberProcessType.INSCRIBE );
// builder.withInputs( middle );
//
// if( top[i] != null )
// {
// builder.withTopOptional( top[i] );
// }
// if( bottom[j] != null )
// {
// builder.withBottomOptional( bottom[j] );
// }
//
// reg.addRecipe( builder.build() );
// }
// }
// }
//
}
@@ -0,0 +1,90 @@
package appeng.recipes.handlers;
import appeng.api.features.InscriberProcessType;
import com.google.common.collect.ImmutableList;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.item.crafting.IRecipeSerializer;
import net.minecraft.item.crafting.IRecipeType;
import net.minecraft.item.crafting.Ingredient;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import java.util.List;
public class InscriberRecipe implements IRecipe<IInventory> {
public static IRecipeType<InscriberRecipe> TYPE;
private final ResourceLocation id;
private final String group;
private List<Ingredient> inputs;
private ItemStack output;
private ItemStack topOptional;
private ItemStack bottomOptional;
private InscriberProcessType type;
public InscriberRecipe(ResourceLocation id, String group, List<Ingredient> inputs, ItemStack output, ItemStack topOptional, ItemStack bottomOptional, InscriberProcessType type) {
this.id = id;
this.group = group;
this.inputs = inputs;
this.output = output;
this.topOptional = topOptional;
this.bottomOptional = bottomOptional;
this.type = type;
}
@Override
public boolean matches(IInventory inv, World worldIn) {
return false;
}
@Override
public ItemStack getCraftingResult(IInventory inv) {
return null;
}
@Override
public boolean canFit(int width, int height) {
return false;
}
@Override
public ItemStack getRecipeOutput() {
return null;
}
@Override
public ResourceLocation getId() {
return null;
}
@Override
public IRecipeSerializer<?> getSerializer() {
return null;
}
@Override
public IRecipeType<?> getType() {
return TYPE;
}
public List<Ingredient> getInputs() {
return inputs;
}
public ItemStack getOutput() {
return output;
}
public ItemStack getTopOptional() {
return topOptional;
}
public ItemStack getBottomOptional() {
return bottomOptional;
}
}
+12 -11
View File
@@ -22,6 +22,7 @@ package appeng.util;
import appeng.api.AEApi;
import appeng.api.config.*;
import appeng.api.definitions.IItemDefinition;
import appeng.api.definitions.IMaterials;
import appeng.api.features.AEFeature;
import appeng.api.implementations.items.IAEItemPowerStorage;
import appeng.api.implementations.items.IAEWrench;
@@ -1562,15 +1563,15 @@ public class Platform
// // p.addStat( achievement, 1 );
// // }
// // }
//
// public static boolean isRecipePrioritized( final ItemStack what )
// {
// final IMaterials materials = AEApi.instance().definitions().materials();
//
// boolean isPurified = materials.purifiedCertusQuartzCrystal().isSameAs( what );
// isPurified |= materials.purifiedFluixCrystal().isSameAs( what );
// isPurified |= materials.purifiedNetherQuartzCrystal().isSameAs( what );
//
// return isPurified;
// }
public static boolean isRecipePrioritized( final ItemStack what )
{
final IMaterials materials = AEApi.instance().definitions().materials();
boolean isPurified = materials.purifiedCertusQuartzCrystal().isSameAs( what );
isPurified |= materials.purifiedFluixCrystal().isSameAs( what );
isPurified |= materials.purifiedNetherQuartzCrystal().isSameAs( what );
return isPurified;
}
}
@@ -10,3 +10,6 @@ protected net.minecraft.client.particle.RedstoneParticle <init>(Lnet/minecraft/w
# We need to change yPos of existing slots to resize the container
public-f net.minecraft.inventory.container.Slot field_75221_f # yPos
# For JEI registration
public net.minecraft.item.crafting.RecipeManager func_215366_a(Lnet/minecraft/item/crafting/IRecipeType;)Ljava/util/Map; # getRecipes
@@ -1,7 +1,6 @@
{
"result": {
"item": "minecraft:quartz_block",
"data": 0
"item": "minecraft:quartz_block"
},
"type": "minecraft:crafting_shaped",
"pattern": [
@@ -12,7 +12,7 @@
"item": "minecraft:iron_ingot"
},
"a": {
"item": "appliedenergistics2:certus_quartz_crystal_charged"
"item": "appliedenergistics2:charged_certus_quartz_crystal"
}
}
}
@@ -1,16 +0,0 @@
{
"result": {
"item": "appliedenergistics2:chiseled_quartz_slab",
"data": 0,
"count": 6
},
"type": "minecraft:crafting_shaped",
"pattern": [
"aaa"
],
"key": {
"a": {
"item": "appliedenergistics2:chiseled_quartz_block"
}
}
}
@@ -1,16 +0,0 @@
{
"result": {
"item": "appliedenergistics2:fluix_slab",
"data": 0,
"count": 6
},
"type": "minecraft:crafting_shaped",
"pattern": [
"aaa"
],
"key": {
"a": {
"item": "appliedenergistics2:fluix_block"
}
}
}
@@ -1,16 +0,0 @@
{
"result": {
"item": "appliedenergistics2:quartz_slab",
"data": 0,
"count": 6
},
"type": "minecraft:crafting_shaped",
"pattern": [
"aaa"
],
"key": {
"a": {
"item": "appliedenergistics2:quartz_block"
}
}
}
@@ -1,16 +0,0 @@
{
"result": {
"item": "appliedenergistics2:quartz_pillar_slab",
"data": 0,
"count": 6
},
"type": "minecraft:crafting_shaped",
"pattern": [
"aaa"
],
"key": {
"a": {
"item": "appliedenergistics2:quartz_pillar"
}
}
}
@@ -1,16 +0,0 @@
{
"result": {
"item": "appliedenergistics2:sky_stone_slab",
"data": 0,
"count": 6
},
"type": "minecraft:crafting_shaped",
"pattern": [
"aaa"
],
"key": {
"a": {
"item": "appliedenergistics2:sky_stone_block"
}
}
}
@@ -1,16 +0,0 @@
{
"result": {
"item": "appliedenergistics2:sky_stone_brick_slab",
"data": 0,
"count": 6
},
"type": "minecraft:crafting_shaped",
"pattern": [
"aaa"
],
"key": {
"a": {
"item": "appliedenergistics2:sky_stone_brick"
}
}
}
@@ -1,16 +0,0 @@
{
"result": {
"item": "appliedenergistics2:sky_stone_small_brick_slab",
"data": 0,
"count": 6
},
"type": "minecraft:crafting_shaped",
"pattern": [
"aaa"
],
"key": {
"a": {
"item": "appliedenergistics2:sky_stone_small_brick"
}
}
}
@@ -1,16 +0,0 @@
{
"result": {
"item": "appliedenergistics2:smooth_sky_stone_slab",
"data": 0,
"count": 6
},
"type": "minecraft:crafting_shaped",
"pattern": [
"aaa"
],
"key": {
"a": {
"item": "appliedenergistics2:smooth_sky_stone_block"
}
}
}
@@ -1,17 +0,0 @@
{
"result": {
"item": "appliedenergistics2:chiseled_quartz_stairs",
"count": 4
},
"type": "minecraft:crafting_shaped",
"pattern": [
"a ",
"aa ",
"aaa"
],
"key": {
"a": {
"item": "appliedenergistics2:chiseled_quartz_block"
}
}
}
@@ -1,17 +0,0 @@
{
"result": {
"item": "appliedenergistics2:fluix_stairs",
"count": 4
},
"type": "minecraft:crafting_shaped",
"pattern": [
"a ",
"aa ",
"aaa"
],
"key": {
"a": {
"item": "appliedenergistics2:fluix_block"
}
}
}
@@ -1,17 +0,0 @@
{
"result": {
"item": "appliedenergistics2:quartz_stairs",
"count": 4
},
"type": "minecraft:crafting_shaped",
"pattern": [
"a ",
"aa ",
"aaa"
],
"key": {
"a": {
"item": "appliedenergistics2:quartz_block"
}
}
}
@@ -1,17 +0,0 @@
{
"result": {
"item": "appliedenergistics2:quartz_pillar_stairs",
"count": 4
},
"type": "minecraft:crafting_shaped",
"pattern": [
"a ",
"aa ",
"aaa"
],
"key": {
"a": {
"item": "appliedenergistics2:quartz_pillar"
}
}
}
@@ -1,17 +0,0 @@
{
"result": {
"item": "appliedenergistics2:sky_stone_stairs",
"count": 4
},
"type": "minecraft:crafting_shaped",
"pattern": [
"a ",
"aa ",
"aaa"
],
"key": {
"a": {
"item": "appliedenergistics2:sky_stone_block"
}
}
}
@@ -1,17 +0,0 @@
{
"result": {
"item": "appliedenergistics2:sky_stone_brick_stairs",
"count": 4
},
"type": "minecraft:crafting_shaped",
"pattern": [
"a ",
"aa ",
"aaa"
],
"key": {
"a": {
"item": "appliedenergistics2:sky_stone_brick"
}
}
}
@@ -1,17 +0,0 @@
{
"result": {
"item": "appliedenergistics2:sky_stone_small_brick_stairs",
"count": 4
},
"type": "minecraft:crafting_shaped",
"pattern": [
"a ",
"aa ",
"aaa"
],
"key": {
"a": {
"item": "appliedenergistics2:sky_stone_small_brick"
}
}
}
@@ -1,17 +0,0 @@
{
"result": {
"item": "appliedenergistics2:smooth_sky_stone_stairs",
"count": 4
},
"type": "minecraft:crafting_shaped",
"pattern": [
"a ",
"aa ",
"aaa"
],
"key": {
"a": {
"item": "appliedenergistics2:smooth_sky_stone_block"
}
}
}
@@ -5,8 +5,7 @@
},
"result": {
"primary": {
"item": "minecraft:dye",
"data": 15,
"item": "minecraft:bone_meal",
"count": 4
}
},
@@ -5,7 +5,7 @@
},
"result": {
"primary": {
"part": "material.fluix_dust"
"item": "appliedenergistics2:fluix_dust"
}
},
"turns": 8
@@ -5,7 +5,7 @@
},
"result": {
"primary": {
"part": "material.sky_dust"
"item": "appliedenergistics2:sky_dust"
}
},
"turns": 8
@@ -2,7 +2,7 @@
"type": "appliedenergistics2:inscriber",
"mode": "press",
"result": {
"part": "material.engineering_processor"
"item": "appliedenergistics2:engineering_processor"
},
"ingredients": {
"top": {
@@ -2,7 +2,7 @@
"type": "appliedenergistics2:inscriber",
"mode": "inscribe",
"result": {
"part": "material.calculation_processor_press"
"item": "appliedenergistics2:calculation_processor_press"
},
"ingredients": {
"top": {
@@ -2,7 +2,7 @@
"type": "appliedenergistics2:inscriber",
"mode": "inscribe",
"result": {
"part": "material.calculation_processor_print"
"item": "appliedenergistics2:calculation_processor_print"
},
"ingredients": {
"top": {
@@ -2,7 +2,7 @@
"type": "appliedenergistics2:inscriber",
"mode": "press",
"result": {
"part": "material.calculation_processor"
"item": "appliedenergistics2:calculation_processor"
},
"ingredients": {
"top": {
@@ -2,7 +2,7 @@
"type": "appliedenergistics2:inscriber",
"mode": "inscribe",
"result": {
"part": "material.engineering_processor_press"
"item": "appliedenergistics2:engineering_processor_press"
},
"ingredients": {
"top": {
@@ -2,7 +2,7 @@
"type": "appliedenergistics2:inscriber",
"mode": "inscribe",
"result": {
"part": "material.engineering_processor_print"
"item": "appliedenergistics2:engineering_processor_print"
},
"ingredients": {
"top": {
@@ -2,7 +2,7 @@
"type": "appliedenergistics2:inscriber",
"mode": "press",
"result": {
"part": "material.logic_processor"
"item": "appliedenergistics2:logic_processor"
},
"ingredients": {
"top": {
@@ -2,7 +2,7 @@
"type": "appliedenergistics2:inscriber",
"mode": "inscribe",
"result": {
"part": "material.logic_processor_press"
"item": "appliedenergistics2:logic_processor_press"
},
"ingredients": {
"top": {
@@ -2,7 +2,7 @@
"type": "appliedenergistics2:inscriber",
"mode": "inscribe",
"result": {
"part": "material.logic_processor_print"
"item": "appliedenergistics2:logic_processor_print"
},
"ingredients": {
"top": {
@@ -2,7 +2,7 @@
"type": "appliedenergistics2:inscriber",
"mode": "inscribe",
"result": {
"part": "material.silicon_press"
"item": "appliedenergistics2:silicon_press"
},
"ingredients": {
"top": {
@@ -2,7 +2,7 @@
"type": "appliedenergistics2:inscriber",
"mode": "inscribe",
"result": {
"part": "material.silicon_print"
"item": "appliedenergistics2:silicon_print"
},
"ingredients": {
"top": {
@@ -1,16 +1,15 @@
{
"conditions": [
{
"type": "appliedenergistics2:material_exists",
"material": "material.advanced_card"
"type": "appliedenergistics2:feature",
"features": ["ADVANCED_CARDS"]
}
],
"result": {
"type": "appliedenergistics2:part",
"part": "material.advanced_card",
"item": "appliedenergistics2:advanced_card",
"count": 2
},
"type": "appliedenergistics2:part_shaped",
"type": "minecraft:crafting_shaped",
"pattern": [
"ab ",
"cdb",
@@ -1,16 +1,15 @@
{
"conditions": [
{
"type": "appliedenergistics2:material_exists",
"material": "material.annihilation_core"
"type": "appliedenergistics2:feature",
"features": ["CORES"]
}
],
"result": {
"type": "appliedenergistics2:part",
"part": "material.annihilation_core",
"item": "appliedenergistics2:annihilation_core",
"count": 2
},
"type": "appliedenergistics2:part_shaped",
"type": "minecraft:crafting_shaped",
"pattern": [
"abc"
],
@@ -1,16 +1,15 @@
{
"conditions": [
{
"type": "appliedenergistics2:material_exists",
"material": "material.basic_card"
"type": "appliedenergistics2:feature",
"features": ["BASIC_CARDS"]
}
],
"result": {
"type": "appliedenergistics2:part",
"part": "material.basic_card",
"item": "appliedenergistics2:basic_card",
"count": 2
},
"type": "appliedenergistics2:part_shaped",
"type": "minecraft:crafting_shaped",
"pattern": [
"ab ",
"cdb",
@@ -1,14 +1,14 @@
{
"conditions": [
{
"type": "appliedenergistics2:material_exists",
"material": "material.card_capacity"
"type": "appliedenergistics2:feature",
"features": ["BASIC_CARDS"]
}
],
"result": {
"item": "appliedenergistics2:card_capacity"
"item": "appliedenergistics2:capacity_card"
},
"type": "appliedenergistics2:part_shapeless",
"type": "minecraft:crafting_shapeless",
"ingredients": [
{
"tag": "appliedenergistics2:crystals/certus"
@@ -1,14 +1,14 @@
{
"conditions": [
{
"type": "appliedenergistics2:material_exists",
"material": "material.card_crafting"
"type": "appliedenergistics2:feature",
"features": ["ADVANCED_CARDS", "CRAFTING_CPU"]
}
],
"result": {
"item": "appliedenergistics2:card_crafting"
"item": "appliedenergistics2:crafting_card"
},
"type": "appliedenergistics2:part_shapeless",
"type": "minecraft:crafting_shapeless",
"ingredients": [
{
"tag": "appliedenergistics2:workbench"
@@ -1,14 +1,14 @@
{
"conditions": [
{
"type": "appliedenergistics2:material_exists",
"material": "material.card_fuzzy"
"type": "appliedenergistics2:feature",
"features": ["ADVANCED_CARDS"]
}
],
"result": {
"item": "appliedenergistics2:card_fuzzy"
"item": "appliedenergistics2:fuzzy_card"
},
"type": "appliedenergistics2:part_shapeless",
"type": "minecraft:crafting_shapeless",
"ingredients": [
{
"item": "appliedenergistics2:advanced_card"
@@ -1,14 +1,14 @@
{
"conditions": [
{
"type": "appliedenergistics2:material_exists",
"material": "material.card_inverter"
"type": "appliedenergistics2:feature",
"features": ["ADVANCED_CARDS"]
}
],
"result": {
"item": "appliedenergistics2:card_inverter"
"item": "appliedenergistics2:inverter_card"
},
"type": "appliedenergistics2:part_shapeless",
"type": "minecraft:crafting_shapeless",
"ingredients": [
{
"item": "minecraft:redstone_torch"
@@ -1,14 +1,14 @@
{
"conditions": [
{
"type": "appliedenergistics2:material_exists",
"material": "material.card_redstone"
"type": "appliedenergistics2:feature",
"features": ["BASIC_CARDS"]
}
],
"result": {
"item": "appliedenergistics2:card_redstone"
"item": "appliedenergistics2:redstone_card"
},
"type": "appliedenergistics2:part_shapeless",
"type": "minecraft:crafting_shapeless",
"ingredients": [
{
"item": "minecraft:redstone_torch"
@@ -1,14 +1,14 @@
{
"conditions": [
{
"type": "appliedenergistics2:material_exists",
"material": "material.card_speed"
"type": "appliedenergistics2:feature",
"features": ["ADVANCED_CARDS"]
}
],
"result": {
"item": "appliedenergistics2:card_speed"
"item": "appliedenergistics2:speed_card"
},
"type": "appliedenergistics2:part_shapeless",
"type": "minecraft:crafting_shapeless",
"ingredients": [
{
"item": "appliedenergistics2:advanced_card"
@@ -1,16 +1,15 @@
{
"conditions": [
{
"type": "appliedenergistics2:material_exists",
"material": "material.formation_core"
"type": "appliedenergistics2:feature",
"features": ["CORES"]
}
],
"result": {
"type": "appliedenergistics2:part",
"part": "material.formation_core",
"item": "appliedenergistics2:formation_core",
"count": 2
},
"type": "appliedenergistics2:part_shaped",
"type": "minecraft:crafting_shaped",
"pattern": [
"abc"
],
@@ -1,16 +1,9 @@
{
"conditions": [
{
"type": "appliedenergistics2:material_exists",
"material": "material.certus_quartz_crystal"
}
],
"result": {
"type": "appliedenergistics2:part",
"part": "material.certus_quartz_crystal",
"item": "appliedenergistics2:certus_quartz_crystal",
"count": 4
},
"type": "appliedenergistics2:part_shapeless",
"type": "minecraft:crafting_shapeless",
"ingredients": [
{
"item": "appliedenergistics2:chiseled_quartz_block"
@@ -1,16 +1,9 @@
{
"conditions": [
{
"type": "appliedenergistics2:material_exists",
"material": "material.certus_quartz_crystal"
}
],
"result": {
"type": "appliedenergistics2:part",
"part": "material.certus_quartz_crystal",
"item": "appliedenergistics2:certus_quartz_crystal",
"count": 4
},
"type": "appliedenergistics2:part_shapeless",
"type": "minecraft:crafting_shapeless",
"ingredients": [
{
"item": "appliedenergistics2:quartz_block"
@@ -1,16 +1,9 @@
{
"conditions": [
{
"type": "appliedenergistics2:material_exists",
"material": "material.certus_quartz_crystal"
}
],
"result": {
"type": "appliedenergistics2:part",
"part": "material.certus_quartz_crystal",
"item": "appliedenergistics2:certus_quartz_crystal",
"count": 4
},
"type": "appliedenergistics2:part_shapeless",
"type": "minecraft:crafting_shapeless",
"ingredients": [
{
"item": "appliedenergistics2:quartz_pillar"
@@ -1,16 +1,9 @@
{
"conditions": [
{
"type": "appliedenergistics2:material_exists",
"material": "material.fluix_crystal"
}
],
"result": {
"type": "appliedenergistics2:part",
"part": "material.fluix_crystal",
"item": "appliedenergistics2:fluix_crystal",
"count": 4
},
"type": "appliedenergistics2:part_shapeless",
"type": "minecraft:crafting_shapeless",
"ingredients": [
{
"item": "appliedenergistics2:fluix_block"
@@ -1,14 +1,8 @@
{
"conditions": [
{
"type": "appliedenergistics2:material_exists",
"material": "material.fluix_pearl"
}
],
"result": {
"item": "appliedenergistics2:fluix_pearl"
},
"type": "appliedenergistics2:part_shaped",
"type": "minecraft:crafting_shaped",
"pattern": [
"aba",
"bcb",
@@ -1,14 +1,14 @@
{
"conditions": [
{
"type": "appliedenergistics2:material_exists",
"material": "material.wooden_gear"
"type": "appliedenergistics2:feature",
"features": ["GRIND_STONE"]
}
],
"result": {
"item": "appliedenergistics2:wooden_gear"
},
"type": "appliedenergistics2:part_shaped",
"type": "minecraft:crafting_shaped",
"pattern": [
" a ",
"a a",
@@ -13,7 +13,7 @@
"tag": "forge:ingots/iron"
},
"b": {
"item": "appliedenergistics2:certus_quartz_crystal_charged"
"item": "appliedenergistics2:charged_certus_quartz_crystal"
}
}
}
@@ -1,10 +1,9 @@
{
"result": {
"type": "appliedenergistics2:part",
"part": "crystal_seed.certus",
"item": "appliedenergistics2:certus_crystal_seed",
"count": 2
},
"type": "appliedenergistics2:part_shapeless",
"type": "minecraft:crafting_shapeless",
"ingredients": [
{
"tag": "forge:sand"
@@ -1,10 +1,9 @@
{
"result": {
"type": "appliedenergistics2:part",
"part": "crystal_seed.fluix",
"item": "appliedenergistics2:fluix_crystal_seed",
"count": 2
},
"type": "appliedenergistics2:part_shapeless",
"type": "minecraft:crafting_shapeless",
"ingredients": [
{
"tag": "forge:sand"
@@ -1,10 +1,9 @@
{
"result": {
"type": "appliedenergistics2:part",
"part": "crystal_seed.nether",
"item": "appliedenergistics2:nether_crystal_seed",
"count": 2
},
"type": "appliedenergistics2:part_shapeless",
"type": "minecraft:crafting_shapeless",
"ingredients": [
{
"tag": "forge:sand"
@@ -16,7 +16,7 @@
"tag": "forge:ingots/iron"
},
"b": {
"item": "appliedenergistics2:fluix_cable_glass"
"item": "appliedenergistics2:fluix_glass_cable"
},
"d": {
"item": "appliedenergistics2:fluix_block"
@@ -2,7 +2,7 @@
"result": {
"item": "appliedenergistics2:cable_fluid_interface"
},
"type": "appliedenergistics2:part_shapeless",
"type": "minecraft:crafting_shapeless",
"ingredients": [
{
"item": "appliedenergistics2:fluid_interface"
@@ -2,7 +2,7 @@
"result": {
"item": "appliedenergistics2:cable_interface"
},
"type": "appliedenergistics2:part_shapeless",
"type": "minecraft:crafting_shapeless",
"ingredients": [
{
"item": "appliedenergistics2:interface"
@@ -22,7 +22,7 @@
"item": "appliedenergistics2:logic_processor"
},
"c": {
"item": "appliedenergistics2:fluix_cable_glass"
"item": "appliedenergistics2:fluix_glass_cable"
}
}
}
@@ -13,7 +13,7 @@
"item": "appliedenergistics2:engineering_processor"
},
"e": {
"item": "appliedenergistics2:fluix_cable_dense_smart"
"item": "appliedenergistics2:fluix_smart_dense_cable"
},
"a": {
"tag": "forge:ingots/iron"
@@ -22,7 +22,7 @@
"tag": "forge:ingots/iron"
},
"c": {
"item": "appliedenergistics2:fluix_cable_glass"
"item": "appliedenergistics2:fluix_glass_cable"
}
}
}
@@ -22,7 +22,7 @@
"item": "appliedenergistics2:io_port"
},
"b": {
"item": "appliedenergistics2:fluix_cable_glass"
"item": "appliedenergistics2:fluix_glass_cable"
}
}
}
@@ -16,7 +16,7 @@
"tag": "appliedenergistics2:dusts/fluix"
},
"b": {
"item": "appliedenergistics2:fluix_cable_glass"
"item": "appliedenergistics2:fluix_glass_cable"
},
"d": {
"tag": "appliedenergistics2:crystals/fluix"
@@ -19,7 +19,7 @@
"tag": "forge:ingots/iron"
},
"c": {
"item": "appliedenergistics2:fluix_cable_glass"
"item": "appliedenergistics2:fluix_glass_cable"
},
"e": {
"tag": "appliedenergistics2:crystals/fluix"
@@ -16,7 +16,7 @@
"tag": "forge:ingots/iron"
},
"c": {
"item": "appliedenergistics2:fluix_cable_glass"
"item": "appliedenergistics2:fluix_glass_cable"
}
}
}
@@ -1,10 +1,9 @@
{
"result": {
"type": "appliedenergistics2:part",
"part": "cable_covered.black",
"item": "appliedenergistics2:black_covered_cable",
"count": 8
},
"type": "appliedenergistics2:part_shaped",
"type": "minecraft:crafting_shaped",
"pattern": [
"aaa",
"aba",
@@ -12,7 +11,7 @@
],
"key": {
"a": {
"item": "appliedenergistics2:fluix_cable_covered"
"item": "appliedenergistics2:fluix_covered_cable"
},
"b": {
"tag": "forge:dyes/black"
@@ -1,10 +1,9 @@
{
"result": {
"type": "appliedenergistics2:part",
"part": "cable_covered.blue",
"item": "appliedenergistics2:blue_covered_cable",
"count": 8
},
"type": "appliedenergistics2:part_shaped",
"type": "minecraft:crafting_shaped",
"pattern": [
"aaa",
"aba",
@@ -12,7 +11,7 @@
],
"key": {
"a": {
"item": "appliedenergistics2:fluix_cable_covered"
"item": "appliedenergistics2:fluix_covered_cable"
},
"b": {
"tag": "forge:dyes/blue"
@@ -1,10 +1,9 @@
{
"result": {
"type": "appliedenergistics2:part",
"part": "cable_covered.brown",
"item": "appliedenergistics2:brown_covered_cable",
"count": 8
},
"type": "appliedenergistics2:part_shaped",
"type": "minecraft:crafting_shaped",
"pattern": [
"aaa",
"aba",
@@ -15,7 +14,7 @@
"tag": "forge:dyes/brown"
},
"a": {
"item": "appliedenergistics2:fluix_cable_covered"
"item": "appliedenergistics2:fluix_covered_cable"
}
}
}
@@ -1,10 +1,9 @@
{
"result": {
"type": "appliedenergistics2:part",
"part": "cable_covered.cyan",
"item": "appliedenergistics2:cyan_covered_cable",
"count": 8
},
"type": "appliedenergistics2:part_shaped",
"type": "minecraft:crafting_shaped",
"pattern": [
"aaa",
"aba",
@@ -15,7 +14,7 @@
"tag": "forge:dyes/cyan"
},
"a": {
"item": "appliedenergistics2:fluix_cable_covered"
"item": "appliedenergistics2:fluix_covered_cable"
}
}
}
@@ -1,14 +1,14 @@
{
"result": {
"item": "appliedenergistics2:fluix_cable_covered"
"item": "appliedenergistics2:fluix_covered_cable"
},
"type": "appliedenergistics2:part_shapeless",
"type": "minecraft:crafting_shapeless",
"ingredients": [
{
"tag": "appliedenergistics2:wool"
},
{
"item": "appliedenergistics2:fluix_cable_glass"
"item": "appliedenergistics2:fluix_glass_cable"
}
]
}
@@ -1,8 +1,8 @@
{
"result": {
"item": "appliedenergistics2:fluix_cable_covered"
"item": "appliedenergistics2:fluix_covered_cable"
},
"type": "appliedenergistics2:part_shapeless",
"type": "minecraft:crafting_shapeless",
"ingredients": [
{
"tag": "appliedenergistics2:covered_cable"
@@ -1,10 +1,9 @@
{
"result": {
"type": "appliedenergistics2:part",
"part": "cable_covered.gray",
"item": "appliedenergistics2:gray_covered_cable",
"count": 8
},
"type": "appliedenergistics2:part_shaped",
"type": "minecraft:crafting_shaped",
"pattern": [
"aaa",
"aba",
@@ -15,7 +14,7 @@
"tag": "forge:dyes/gray"
},
"a": {
"item": "appliedenergistics2:fluix_cable_covered"
"item": "appliedenergistics2:fluix_covered_cable"
}
}
}
@@ -1,10 +1,9 @@
{
"result": {
"type": "appliedenergistics2:part",
"part": "cable_covered.green",
"item": "appliedenergistics2:green_covered_cable",
"count": 8
},
"type": "appliedenergistics2:part_shaped",
"type": "minecraft:crafting_shaped",
"pattern": [
"aaa",
"aba",
@@ -15,7 +14,7 @@
"tag": "forge:dyes/green"
},
"a": {
"item": "appliedenergistics2:fluix_cable_covered"
"item": "appliedenergistics2:fluix_covered_cable"
}
}
}
@@ -1,10 +1,9 @@
{
"result": {
"type": "appliedenergistics2:part",
"part": "cable_covered.light_blue",
"item": "appliedenergistics2:light_blue_covered_cable",
"count": 8
},
"type": "appliedenergistics2:part_shaped",
"type": "minecraft:crafting_shaped",
"pattern": [
"aaa",
"aba",
@@ -12,7 +11,7 @@
],
"key": {
"a": {
"item": "appliedenergistics2:fluix_cable_covered"
"item": "appliedenergistics2:fluix_covered_cable"
},
"b": {
"tag": "forge:dyes/light_blue"

Some files were not shown because too many files have changed in this diff Show More