Compare commits
11 Commits
rv2.stable.3
...
rv2
| Author | SHA1 | Date | |
|---|---|---|---|
| c345826641 | |||
| 9c3ca0e3d7 | |||
| 52d62b8202 | |||
| 643f559186 | |||
| 09ed06e47f | |||
| 741b5bee1f | |||
| c1c3655db6 | |||
| b05796e62b | |||
| 200e56a509 | |||
| 9540bbce49 | |||
| c6d932da04 |
+1
-1
@@ -33,7 +33,7 @@ fmp_version=1.1.1.324
|
|||||||
code_chicken_lib_version=1.1.3.127
|
code_chicken_lib_version=1.1.3.127
|
||||||
code_chicken_core_version=1.0.4.35
|
code_chicken_core_version=1.0.4.35
|
||||||
nei_version=1.0.4.90
|
nei_version=1.0.4.90
|
||||||
bc_version=6.4.6
|
bc_version=7.0.9
|
||||||
|
|
||||||
#########################################################
|
#########################################################
|
||||||
# Self Compiled APIs #
|
# Self Compiled APIs #
|
||||||
|
|||||||
@@ -45,10 +45,16 @@ repositories {
|
|||||||
url = "http://maven.tterrag.com/"
|
url = "http://maven.tterrag.com/"
|
||||||
}
|
}
|
||||||
|
|
||||||
maven {
|
maven {
|
||||||
name = "RX14 Proxy"
|
name = "RX14 Proxy"
|
||||||
url = "http://mvn.rx14.co.uk/repo/"
|
url = "http://mvn.rx14.co.uk/repo/"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ivy {
|
||||||
|
name "BuildCraft"
|
||||||
|
artifactPattern "http://www.mod-buildcraft.com/releases/BuildCraft/[revision]/[module]-[revision]-[classifier].[ext]"
|
||||||
|
}
|
||||||
|
|
||||||
// CurseForge DNS for TE is not available or I am just being unlucky, code part can stay since this is applicable to any other curseforge mod though
|
// CurseForge DNS for TE is not available or I am just being unlucky, code part can stay since this is applicable to any other curseforge mod though
|
||||||
// ivy {
|
// ivy {
|
||||||
// name = "CoFHLib"
|
// name = "CoFHLib"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* This file is part of Applied Energistics 2.
|
* This file is part of Applied Energistics 2.
|
||||||
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
|
* Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
|
||||||
*
|
*
|
||||||
* Applied Energistics 2 is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@@ -29,7 +29,6 @@ import net.minecraft.item.ItemStack;
|
|||||||
import net.minecraft.util.MathHelper;
|
import net.minecraft.util.MathHelper;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.oredict.OreDictionary;
|
|
||||||
|
|
||||||
import appeng.api.AEApi;
|
import appeng.api.AEApi;
|
||||||
import appeng.api.exceptions.MissingDefinition;
|
import appeng.api.exceptions.MissingDefinition;
|
||||||
@@ -67,12 +66,6 @@ public class OreQuartz extends AEBaseBlock
|
|||||||
return RenderQuartzOre.class;
|
return RenderQuartzOre.class;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void postInit()
|
|
||||||
{
|
|
||||||
OreDictionary.registerOre( "oreCertusQuartz", new ItemStack( this ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getMixedBrightnessForBlock( IBlockAccess par1iBlockAccess, int par2, int par3, int par4 )
|
public int getMixedBrightnessForBlock( IBlockAccess par1iBlockAccess, int par2, int par3, int par4 )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* This file is part of Applied Energistics 2.
|
* This file is part of Applied Energistics 2.
|
||||||
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
|
* Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
|
||||||
*
|
*
|
||||||
* Applied Energistics 2 is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@@ -44,7 +44,7 @@ import codechicken.lib.data.MCDataOutput;
|
|||||||
import codechicken.lib.raytracer.IndexedCuboid6;
|
import codechicken.lib.raytracer.IndexedCuboid6;
|
||||||
import codechicken.lib.vec.Cuboid6;
|
import codechicken.lib.vec.Cuboid6;
|
||||||
import codechicken.lib.vec.Vector3;
|
import codechicken.lib.vec.Vector3;
|
||||||
import codechicken.multipart.IRedstonePart;
|
import codechicken.multipart.IMaskedRedstonePart;
|
||||||
import codechicken.multipart.JCuboidPart;
|
import codechicken.multipart.JCuboidPart;
|
||||||
import codechicken.multipart.JNormalOcclusion;
|
import codechicken.multipart.JNormalOcclusion;
|
||||||
import codechicken.multipart.NormalOcclusionTest;
|
import codechicken.multipart.NormalOcclusionTest;
|
||||||
@@ -83,24 +83,41 @@ import appeng.util.Platform;
|
|||||||
*
|
*
|
||||||
* TSlottedPart,ISidedHollowConnect
|
* TSlottedPart,ISidedHollowConnect
|
||||||
*/
|
*/
|
||||||
public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IRedstonePart, AEMultiTile
|
public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IMaskedRedstonePart, AEMultiTile
|
||||||
{
|
{
|
||||||
|
|
||||||
public static final ThreadLocal<Boolean> DISABLE_FACADE_OCCLUSION = new ThreadLocal<Boolean>();
|
public static final ThreadLocal<Boolean> DISABLE_FACADE_OCCLUSION = new ThreadLocal<Boolean>();
|
||||||
|
|
||||||
|
private static final double SHORTER = 6.0 / 16.0;
|
||||||
|
private static final double LONGER = 10.0 / 16.0;
|
||||||
|
private static final double MIN_DIRECTION = 0;
|
||||||
|
private static final double MAX_DIRECTION = 1.0;
|
||||||
private static final Cuboid6[] SIDE_TESTS = new Cuboid6[] {
|
private static final Cuboid6[] SIDE_TESTS = new Cuboid6[] {
|
||||||
|
|
||||||
new Cuboid6( 6.0 / 16.0, 0, 6.0 / 16.0, 10.0 / 16.0, 6.0 / 16.0, 10.0 / 16.0 ), // DOWN(0, -1, 0),
|
// DOWN(0, -1, 0),
|
||||||
|
new Cuboid6( SHORTER, MIN_DIRECTION, SHORTER, LONGER, SHORTER, LONGER ),
|
||||||
|
|
||||||
new Cuboid6( 6.0 / 16.0, 10.0 / 16.0, 6.0 / 16.0, 10.0 / 16.0, 1.0, 10.0 / 16.0 ), // UP(0, 1, 0),
|
// UP(0, 1, 0),
|
||||||
|
new Cuboid6( SHORTER, LONGER, SHORTER, LONGER, MAX_DIRECTION, LONGER ),
|
||||||
|
|
||||||
new Cuboid6( 6.0 / 16.0, 6.0 / 16.0, 0.0, 10.0 / 16.0, 10.0 / 16.0, 6.0 / 16.0 ),// NORTH(0, 0, -1),
|
// NORTH(0, 0, -1),
|
||||||
|
new Cuboid6( SHORTER, SHORTER, MIN_DIRECTION, LONGER, LONGER, SHORTER ),
|
||||||
|
|
||||||
new Cuboid6( 6.0 / 16.0, 6.0 / 16.0, 10.0 / 16.0, 10.0 / 16.0, 10.0 / 16.0, 1.0 ),// SOUTH(0, 0, 1),
|
// SOUTH(0, 0, 1),
|
||||||
|
new Cuboid6( SHORTER, SHORTER, LONGER, LONGER, LONGER, MAX_DIRECTION ),
|
||||||
|
|
||||||
new Cuboid6( 0.0, 6.0 / 16.0, 6.0 / 16.0, 6.0 / 16.0, 10.0 / 16.0, 10.0 / 16.0 ),// WEST(-1, 0, 0),
|
// WEST(-1, 0, 0),
|
||||||
|
new Cuboid6( MIN_DIRECTION, SHORTER, SHORTER, SHORTER, LONGER, LONGER ),
|
||||||
|
|
||||||
new Cuboid6( 10.0 / 16.0, 6.0 / 16.0, 6.0 / 16.0, 1.0, 10.0 / 16.0, 10.0 / 16.0 ),// EAST(1, 0, 0),
|
// EAST(1, 0, 0),
|
||||||
|
new Cuboid6( LONGER, SHORTER, SHORTER, MAX_DIRECTION, LONGER, LONGER ),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Mask for {@link IMaskedRedstonePart#getConnectionMask(int)}
|
||||||
|
*
|
||||||
|
* the bits are derived from the rotation, where 4 is the center
|
||||||
|
*/
|
||||||
|
private static final int CONNECTION_MASK = 0x000010;
|
||||||
public CableBusContainer cb = new CableBusContainer( this );
|
public CableBusContainer cb = new CableBusContainer( this );
|
||||||
boolean canUpdate = false;
|
boolean canUpdate = false;
|
||||||
|
|
||||||
@@ -559,15 +576,6 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IReds
|
|||||||
public void clearContainer()
|
public void clearContainer()
|
||||||
{
|
{
|
||||||
this.cb = new CableBusContainer( this );
|
this.cb = new CableBusContainer( this );
|
||||||
} @Override
|
|
||||||
public Iterable<Cuboid6> getCollisionBoxes()
|
|
||||||
{
|
|
||||||
LinkedList<Cuboid6> l = new LinkedList<Cuboid6>();
|
|
||||||
for( AxisAlignedBB b : this.cb.getSelectedBoundingBoxesFromPool( false, true, null, true ) )
|
|
||||||
{
|
|
||||||
l.add( new Cuboid6( b.minX, b.minY, b.minZ, b.maxX, b.maxY, b.maxZ ) );
|
|
||||||
}
|
|
||||||
return l;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -579,7 +587,11 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IReds
|
|||||||
}
|
}
|
||||||
|
|
||||||
DISABLE_FACADE_OCCLUSION.set( true );
|
DISABLE_FACADE_OCCLUSION.set( true );
|
||||||
boolean blocked = !this.tile().canAddPart( new NormallyOccludedPart( SIDE_TESTS[side.ordinal()] ) );
|
|
||||||
|
final int ordinal = side.ordinal();
|
||||||
|
final Cuboid6 sideTest = SIDE_TESTS[ordinal];
|
||||||
|
final NormallyOccludedPart occludedPart = new NormallyOccludedPart( sideTest );
|
||||||
|
boolean blocked = !this.tile().canAddPart( occludedPart );
|
||||||
DISABLE_FACADE_OCCLUSION.remove();
|
DISABLE_FACADE_OCCLUSION.remove();
|
||||||
|
|
||||||
return blocked;
|
return blocked;
|
||||||
@@ -627,15 +639,6 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IReds
|
|||||||
public Set<LayerFlags> getLayerFlags()
|
public Set<LayerFlags> getLayerFlags()
|
||||||
{
|
{
|
||||||
return this.cb.getLayerFlags();
|
return this.cb.getLayerFlags();
|
||||||
} @Override
|
|
||||||
public Iterable<IndexedCuboid6> getSubParts()
|
|
||||||
{
|
|
||||||
LinkedList<IndexedCuboid6> l = new LinkedList<IndexedCuboid6>();
|
|
||||||
for( Cuboid6 c : this.getCollisionBoxes() )
|
|
||||||
{
|
|
||||||
l.add( new IndexedCuboid6( 0, c ) );
|
|
||||||
}
|
|
||||||
return l;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -664,7 +667,31 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IReds
|
|||||||
return this.cb.isInWorld();
|
return this.cb.isInWorld();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Iterable<Cuboid6> getCollisionBoxes()
|
||||||
|
{
|
||||||
|
LinkedList<Cuboid6> l = new LinkedList<Cuboid6>();
|
||||||
|
for( AxisAlignedBB b : this.cb.getSelectedBoundingBoxesFromPool( false, true, null, true ) )
|
||||||
|
{
|
||||||
|
l.add( new Cuboid6( b.minX, b.minY, b.minZ, b.maxX, b.maxY, b.maxZ ) );
|
||||||
|
}
|
||||||
|
return l;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Iterable<IndexedCuboid6> getSubParts()
|
||||||
|
{
|
||||||
|
LinkedList<IndexedCuboid6> l = new LinkedList<IndexedCuboid6>();
|
||||||
|
for( Cuboid6 c : this.getCollisionBoxes() )
|
||||||
|
{
|
||||||
|
l.add( new IndexedCuboid6( 0, c ) );
|
||||||
|
}
|
||||||
|
return l;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getConnectionMask( int side )
|
||||||
|
{
|
||||||
|
return CONNECTION_MASK;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* This file is part of Applied Energistics 2.
|
* This file is part of Applied Energistics 2.
|
||||||
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
|
* Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
|
||||||
*
|
*
|
||||||
* Applied Energistics 2 is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@@ -27,7 +27,7 @@ public enum IntegrationType
|
|||||||
|
|
||||||
RC( IntegrationSide.BOTH, "Railcraft", "Railcraft" ),
|
RC( IntegrationSide.BOTH, "Railcraft", "Railcraft" ),
|
||||||
|
|
||||||
BC( IntegrationSide.BOTH, "BuildCraft", "BuildCraft|Silicon" ),
|
BC( IntegrationSide.BOTH, "BuildCraft", "BuildCraft|Core" ),
|
||||||
|
|
||||||
RF( IntegrationSide.BOTH, "RedstoneFlux Power - Tiles", "CoFHAPI" ),
|
RF( IntegrationSide.BOTH, "RedstoneFlux Power - Tiles", "CoFHAPI" ),
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* This file is part of Applied Energistics 2.
|
* This file is part of Applied Energistics 2.
|
||||||
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
|
* Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
|
||||||
*
|
*
|
||||||
* Applied Energistics 2 is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@@ -31,10 +31,14 @@ import net.minecraftforge.common.util.ForgeDirection;
|
|||||||
|
|
||||||
import cpw.mods.fml.common.event.FMLInterModComms;
|
import cpw.mods.fml.common.event.FMLInterModComms;
|
||||||
|
|
||||||
|
import buildcraft.BuildCraftCore;
|
||||||
import buildcraft.BuildCraftEnergy;
|
import buildcraft.BuildCraftEnergy;
|
||||||
import buildcraft.BuildCraftTransport;
|
import buildcraft.BuildCraftTransport;
|
||||||
import buildcraft.api.blueprints.BuilderAPI;
|
import buildcraft.api.blueprints.BuilderAPI;
|
||||||
|
import buildcraft.api.blueprints.IBuilderContext;
|
||||||
import buildcraft.api.blueprints.ISchematicRegistry;
|
import buildcraft.api.blueprints.ISchematicRegistry;
|
||||||
|
import buildcraft.api.blueprints.SchematicBlock;
|
||||||
|
import buildcraft.api.blueprints.SchematicTile;
|
||||||
import buildcraft.api.facades.IFacadeItem;
|
import buildcraft.api.facades.IFacadeItem;
|
||||||
import buildcraft.api.tools.IToolWrench;
|
import buildcraft.api.tools.IToolWrench;
|
||||||
import buildcraft.api.transport.IInjectable;
|
import buildcraft.api.transport.IInjectable;
|
||||||
@@ -68,9 +72,21 @@ public final class BC extends BaseModule implements IBC
|
|||||||
|
|
||||||
public BC()
|
public BC()
|
||||||
{
|
{
|
||||||
this.testClassExistence( IPipeConnection.class );
|
this.testClassExistence( BuildCraftEnergy.class );
|
||||||
this.testClassExistence( ItemFacade.class );
|
this.testClassExistence( BuildCraftTransport.class );
|
||||||
|
this.testClassExistence( BuilderAPI.class );
|
||||||
|
this.testClassExistence( IBuilderContext.class );
|
||||||
|
this.testClassExistence( ISchematicRegistry.class );
|
||||||
|
this.testClassExistence( IFacadeItem.class );
|
||||||
this.testClassExistence( IToolWrench.class );
|
this.testClassExistence( IToolWrench.class );
|
||||||
|
this.testClassExistence( IInjectable.class );
|
||||||
|
this.testClassExistence( IPipeConnection.class );
|
||||||
|
this.testClassExistence( IPipeTile.class );
|
||||||
|
this.testClassExistence( ItemFacade.class );
|
||||||
|
this.testClassExistence( PipeIconProvider.class );
|
||||||
|
this.testClassExistence( SchematicTile.class );
|
||||||
|
this.testClassExistence( SchematicBlock.class );
|
||||||
|
this.testClassExistence( IPipeTile.PipeType.class );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -166,9 +182,9 @@ public final class BC extends BaseModule implements IBC
|
|||||||
public void registerPowerP2P()
|
public void registerPowerP2P()
|
||||||
{
|
{
|
||||||
IP2PTunnelRegistry reg = AEApi.instance().registries().p2pTunnel();
|
IP2PTunnelRegistry reg = AEApi.instance().registries().p2pTunnel();
|
||||||
reg.addNewAttunement( new ItemStack( BuildCraftEnergy.engineBlock, 1, 0 ), TunnelType.RF_POWER );
|
reg.addNewAttunement( new ItemStack( BuildCraftCore.engineBlock, 1, 0 ), TunnelType.RF_POWER );
|
||||||
reg.addNewAttunement( new ItemStack( BuildCraftEnergy.engineBlock, 1, 1 ), TunnelType.RF_POWER );
|
reg.addNewAttunement( new ItemStack( BuildCraftCore.engineBlock, 1, 1 ), TunnelType.RF_POWER );
|
||||||
reg.addNewAttunement( new ItemStack( BuildCraftEnergy.engineBlock, 1, 2 ), TunnelType.RF_POWER );
|
reg.addNewAttunement( new ItemStack( BuildCraftCore.engineBlock, 1, 2 ), TunnelType.RF_POWER );
|
||||||
reg.addNewAttunement( new ItemStack( BuildCraftTransport.pipePowerCobblestone ), TunnelType.RF_POWER );
|
reg.addNewAttunement( new ItemStack( BuildCraftTransport.pipePowerCobblestone ), TunnelType.RF_POWER );
|
||||||
reg.addNewAttunement( new ItemStack( BuildCraftTransport.pipePowerDiamond ), TunnelType.RF_POWER );
|
reg.addNewAttunement( new ItemStack( BuildCraftTransport.pipePowerDiamond ), TunnelType.RF_POWER );
|
||||||
reg.addNewAttunement( new ItemStack( BuildCraftTransport.pipePowerGold ), TunnelType.RF_POWER );
|
reg.addNewAttunement( new ItemStack( BuildCraftTransport.pipePowerGold ), TunnelType.RF_POWER );
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* This file is part of Applied Energistics 2.
|
* This file is part of Applied Energistics 2.
|
||||||
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
|
* Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
|
||||||
*
|
*
|
||||||
* Applied Energistics 2 is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@@ -21,8 +21,10 @@ package appeng.integration.modules;
|
|||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
|
import com.google.common.base.Optional;
|
||||||
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.item.crafting.CraftingManager;
|
import net.minecraft.item.crafting.CraftingManager;
|
||||||
import net.minecraft.item.crafting.IRecipe;
|
import net.minecraft.item.crafting.IRecipe;
|
||||||
@@ -32,95 +34,173 @@ import cpw.mods.fml.relauncher.ReflectionHelper;
|
|||||||
import uristqwerty.CraftGuide.CraftGuideLog;
|
import uristqwerty.CraftGuide.CraftGuideLog;
|
||||||
import uristqwerty.CraftGuide.DefaultRecipeTemplate;
|
import uristqwerty.CraftGuide.DefaultRecipeTemplate;
|
||||||
import uristqwerty.CraftGuide.RecipeGeneratorImplementation;
|
import uristqwerty.CraftGuide.RecipeGeneratorImplementation;
|
||||||
|
import uristqwerty.CraftGuide.api.ChanceSlot;
|
||||||
import uristqwerty.CraftGuide.api.CraftGuideAPIObject;
|
import uristqwerty.CraftGuide.api.CraftGuideAPIObject;
|
||||||
import uristqwerty.CraftGuide.api.CraftGuideRecipe;
|
|
||||||
import uristqwerty.CraftGuide.api.ItemSlot;
|
import uristqwerty.CraftGuide.api.ItemSlot;
|
||||||
import uristqwerty.CraftGuide.api.RecipeGenerator;
|
import uristqwerty.CraftGuide.api.RecipeGenerator;
|
||||||
import uristqwerty.CraftGuide.api.RecipeProvider;
|
import uristqwerty.CraftGuide.api.RecipeProvider;
|
||||||
import uristqwerty.CraftGuide.api.RecipeTemplate;
|
import uristqwerty.CraftGuide.api.RecipeTemplate;
|
||||||
import uristqwerty.CraftGuide.api.Slot;
|
import uristqwerty.CraftGuide.api.Slot;
|
||||||
import uristqwerty.CraftGuide.api.SlotType;
|
import uristqwerty.CraftGuide.api.SlotType;
|
||||||
import uristqwerty.CraftGuide.api.StackInfo;
|
|
||||||
import uristqwerty.CraftGuide.api.StackInfoSource;
|
|
||||||
import uristqwerty.gui_craftguide.texture.DynamicTexture;
|
import uristqwerty.gui_craftguide.texture.DynamicTexture;
|
||||||
import uristqwerty.gui_craftguide.texture.TextureClip;
|
import uristqwerty.gui_craftguide.texture.TextureClip;
|
||||||
|
|
||||||
|
import appeng.api.AEApi;
|
||||||
|
import appeng.api.IAppEngApi;
|
||||||
|
import appeng.api.definitions.IBlocks;
|
||||||
import appeng.api.exceptions.MissingIngredientError;
|
import appeng.api.exceptions.MissingIngredientError;
|
||||||
import appeng.api.exceptions.RegistrationError;
|
import appeng.api.exceptions.RegistrationError;
|
||||||
|
import appeng.api.features.IGrinderEntry;
|
||||||
|
import appeng.api.features.IInscriberRecipe;
|
||||||
import appeng.api.recipes.IIngredient;
|
import appeng.api.recipes.IIngredient;
|
||||||
|
import appeng.helpers.Reflected;
|
||||||
import appeng.integration.IIntegrationModule;
|
import appeng.integration.IIntegrationModule;
|
||||||
import appeng.recipes.game.ShapedRecipe;
|
import appeng.recipes.game.ShapedRecipe;
|
||||||
import appeng.recipes.game.ShapelessRecipe;
|
import appeng.recipes.game.ShapelessRecipe;
|
||||||
|
|
||||||
|
|
||||||
public class CraftGuide extends CraftGuideAPIObject implements IIntegrationModule, RecipeProvider, StackInfoSource, RecipeGenerator
|
public final class CraftGuide extends CraftGuideAPIObject implements IIntegrationModule, RecipeProvider
|
||||||
{
|
{
|
||||||
|
private static final int SLOT_SIZE = 16;
|
||||||
|
private static final int TEXTURE_WIDTH = 79;
|
||||||
|
private static final int TEXTURE_HEIGHT = 58;
|
||||||
|
private static final int GRINDER_RATIO = 10000;
|
||||||
|
|
||||||
|
private static final Slot[] GRINDER_SLOTS = new ItemSlot[] {
|
||||||
|
new ItemSlot( 3, 21, SLOT_SIZE, SLOT_SIZE ).drawOwnBackground(),
|
||||||
|
new ItemSlot( 41, 21, SLOT_SIZE, SLOT_SIZE, true ).drawOwnBackground().setSlotType( SlotType.OUTPUT_SLOT ),
|
||||||
|
new ChanceSlot( 59, 12, SLOT_SIZE, SLOT_SIZE, true ).setRatio( GRINDER_RATIO ).setFormatString( " (%1$.2f%% chance)" ).drawOwnBackground().setSlotType( SlotType.OUTPUT_SLOT ),
|
||||||
|
new ChanceSlot( 59, 30, SLOT_SIZE, SLOT_SIZE, true ).setRatio( GRINDER_RATIO ).setFormatString( " (%1$.2f%% chance)" ).drawOwnBackground().setSlotType( SlotType.OUTPUT_SLOT ),
|
||||||
|
new ItemSlot( 22, 12, SLOT_SIZE, SLOT_SIZE ).setSlotType( SlotType.MACHINE_SLOT ),
|
||||||
|
new ItemSlot( 22, 30, SLOT_SIZE, SLOT_SIZE ).setSlotType( SlotType.MACHINE_SLOT )
|
||||||
|
};
|
||||||
|
private static final Slot[] INSCRIBER_SLOTS = new ItemSlot[] {
|
||||||
|
new ItemSlot( 12, 21, SLOT_SIZE, SLOT_SIZE ).drawOwnBackground(),
|
||||||
|
new ItemSlot( 21, 3, SLOT_SIZE, SLOT_SIZE ).drawOwnBackground(),
|
||||||
|
new ItemSlot( 21, 39, SLOT_SIZE, SLOT_SIZE ).drawOwnBackground(),
|
||||||
|
new ItemSlot( 50, 21, SLOT_SIZE, SLOT_SIZE, true ).drawOwnBackground().setSlotType( SlotType.OUTPUT_SLOT ),
|
||||||
|
new ItemSlot( 31, 21, SLOT_SIZE, SLOT_SIZE ).setSlotType( SlotType.MACHINE_SLOT )
|
||||||
|
};
|
||||||
|
private static final Slot[] SHAPELESS_CRAFTING_SLOTS = new ItemSlot[] {
|
||||||
|
new ItemSlot( 3, 3, SLOT_SIZE, SLOT_SIZE ),
|
||||||
|
new ItemSlot( 21, 3, SLOT_SIZE, SLOT_SIZE ),
|
||||||
|
new ItemSlot( 39, 3, SLOT_SIZE, SLOT_SIZE ),
|
||||||
|
new ItemSlot( 3, 21, SLOT_SIZE, SLOT_SIZE ),
|
||||||
|
new ItemSlot( 21, 21, SLOT_SIZE, SLOT_SIZE ),
|
||||||
|
new ItemSlot( 39, 21, SLOT_SIZE, SLOT_SIZE ),
|
||||||
|
new ItemSlot( 3, 39, SLOT_SIZE, SLOT_SIZE ),
|
||||||
|
new ItemSlot( 21, 39, SLOT_SIZE, SLOT_SIZE ),
|
||||||
|
new ItemSlot( 39, 39, SLOT_SIZE, SLOT_SIZE ),
|
||||||
|
new ItemSlot( 59, 21, SLOT_SIZE, SLOT_SIZE, true ).setSlotType( SlotType.OUTPUT_SLOT ),
|
||||||
|
};
|
||||||
|
private static final Slot[] CRAFTING_SLOTS_OWN_BG = new ItemSlot[] {
|
||||||
|
new ItemSlot( 3, 3, SLOT_SIZE, SLOT_SIZE ).drawOwnBackground(),
|
||||||
|
new ItemSlot( 21, 3, SLOT_SIZE, SLOT_SIZE ).drawOwnBackground(),
|
||||||
|
new ItemSlot( 39, 3, SLOT_SIZE, SLOT_SIZE ).drawOwnBackground(),
|
||||||
|
new ItemSlot( 3, 21, SLOT_SIZE, SLOT_SIZE ).drawOwnBackground(),
|
||||||
|
new ItemSlot( 21, 21, SLOT_SIZE, SLOT_SIZE ).drawOwnBackground(),
|
||||||
|
new ItemSlot( 39, 21, SLOT_SIZE, SLOT_SIZE ).drawOwnBackground(),
|
||||||
|
new ItemSlot( 3, 39, SLOT_SIZE, SLOT_SIZE ).drawOwnBackground(),
|
||||||
|
new ItemSlot( 21, 39, SLOT_SIZE, SLOT_SIZE ).drawOwnBackground(),
|
||||||
|
new ItemSlot( 39, 39, SLOT_SIZE, SLOT_SIZE ).drawOwnBackground(),
|
||||||
|
new ItemSlot( 59, 21, SLOT_SIZE, SLOT_SIZE, true ).setSlotType( SlotType.OUTPUT_SLOT ).drawOwnBackground(),
|
||||||
|
};
|
||||||
|
private static final Slot[] SMALL_CRAFTING_SLOTS_OWN_BG = new ItemSlot[] {
|
||||||
|
new ItemSlot( 12, 12, SLOT_SIZE, SLOT_SIZE ).drawOwnBackground(),
|
||||||
|
new ItemSlot( 30, 12, SLOT_SIZE, SLOT_SIZE ).drawOwnBackground(),
|
||||||
|
new ItemSlot( 12, 30, SLOT_SIZE, SLOT_SIZE ).drawOwnBackground(),
|
||||||
|
new ItemSlot( 30, 30, SLOT_SIZE, SLOT_SIZE ).drawOwnBackground(),
|
||||||
|
new ItemSlot( 59, 21, SLOT_SIZE, SLOT_SIZE, true ).setSlotType( SlotType.OUTPUT_SLOT ).drawOwnBackground(),
|
||||||
|
};
|
||||||
|
private static final Slot[] CRTAFTING_SLOTS = new ItemSlot[] {
|
||||||
|
new ItemSlot( 3, 3, SLOT_SIZE, SLOT_SIZE ),
|
||||||
|
new ItemSlot( 21, 3, SLOT_SIZE, SLOT_SIZE ),
|
||||||
|
new ItemSlot( 39, 3, SLOT_SIZE, SLOT_SIZE ),
|
||||||
|
new ItemSlot( 3, 21, SLOT_SIZE, SLOT_SIZE ),
|
||||||
|
new ItemSlot( 21, 21, SLOT_SIZE, SLOT_SIZE ),
|
||||||
|
new ItemSlot( 39, 21, SLOT_SIZE, SLOT_SIZE ),
|
||||||
|
new ItemSlot( 3, 39, SLOT_SIZE, SLOT_SIZE ),
|
||||||
|
new ItemSlot( 21, 39, SLOT_SIZE, SLOT_SIZE ),
|
||||||
|
new ItemSlot( 39, 39, SLOT_SIZE, SLOT_SIZE ),
|
||||||
|
new ItemSlot( 59, 21, SLOT_SIZE, SLOT_SIZE, true ).setSlotType( SlotType.OUTPUT_SLOT ),
|
||||||
|
};
|
||||||
|
private static final Slot[] SMALL_CRAFTING_SLOTS = new ItemSlot[] {
|
||||||
|
new ItemSlot( 12, 12, SLOT_SIZE, SLOT_SIZE ),
|
||||||
|
new ItemSlot( 30, 12, SLOT_SIZE, SLOT_SIZE ),
|
||||||
|
new ItemSlot( 12, 30, SLOT_SIZE, SLOT_SIZE ),
|
||||||
|
new ItemSlot( 30, 30, SLOT_SIZE, SLOT_SIZE ),
|
||||||
|
new ItemSlot( 59, 21, SLOT_SIZE, SLOT_SIZE, true ).setSlotType( SlotType.OUTPUT_SLOT ),
|
||||||
|
};
|
||||||
|
|
||||||
|
@Reflected
|
||||||
public static CraftGuide instance;
|
public static CraftGuide instance;
|
||||||
|
|
||||||
private final Slot[] shapelessCraftingSlots = new ItemSlot[] { new ItemSlot( 3, 3, 16, 16 ), new ItemSlot( 21, 3, 16, 16 ), new ItemSlot( 39, 3, 16, 16 ), new ItemSlot( 3, 21, 16, 16 ), new ItemSlot( 21, 21, 16, 16 ), new ItemSlot( 39, 21, 16, 16 ), new ItemSlot( 3, 39, 16, 16 ), new ItemSlot( 21, 39, 16, 16 ), new ItemSlot( 39, 39, 16, 16 ), new ItemSlot( 59, 21, 16, 16, true ).setSlotType( SlotType.OUTPUT_SLOT ), };
|
|
||||||
|
|
||||||
private final Slot[] craftingSlotsOwnBackground = new ItemSlot[] { new ItemSlot( 3, 3, 16, 16 ).drawOwnBackground(), new ItemSlot( 21, 3, 16, 16 ).drawOwnBackground(), new ItemSlot( 39, 3, 16, 16 ).drawOwnBackground(), new ItemSlot( 3, 21, 16, 16 ).drawOwnBackground(), new ItemSlot( 21, 21, 16, 16 ).drawOwnBackground(), new ItemSlot( 39, 21, 16, 16 ).drawOwnBackground(), new ItemSlot( 3, 39, 16, 16 ).drawOwnBackground(), new ItemSlot( 21, 39, 16, 16 ).drawOwnBackground(), new ItemSlot( 39, 39, 16, 16 ).drawOwnBackground(), new ItemSlot( 59, 21, 16, 16, true ).setSlotType( SlotType.OUTPUT_SLOT ).drawOwnBackground(), };
|
|
||||||
|
|
||||||
private final Slot[] smallCraftingSlotsOwnBackground = new ItemSlot[] { new ItemSlot( 12, 12, 16, 16 ).drawOwnBackground(), new ItemSlot( 30, 12, 16, 16 ).drawOwnBackground(), new ItemSlot( 12, 30, 16, 16 ).drawOwnBackground(), new ItemSlot( 30, 30, 16, 16 ).drawOwnBackground(), new ItemSlot( 59, 21, 16, 16, true ).setSlotType( SlotType.OUTPUT_SLOT ).drawOwnBackground(), };
|
|
||||||
|
|
||||||
private final Slot[] craftingSlots = new ItemSlot[] { new ItemSlot( 3, 3, 16, 16 ), new ItemSlot( 21, 3, 16, 16 ), new ItemSlot( 39, 3, 16, 16 ), new ItemSlot( 3, 21, 16, 16 ), new ItemSlot( 21, 21, 16, 16 ), new ItemSlot( 39, 21, 16, 16 ), new ItemSlot( 3, 39, 16, 16 ), new ItemSlot( 21, 39, 16, 16 ), new ItemSlot( 39, 39, 16, 16 ), new ItemSlot( 59, 21, 16, 16, true ).setSlotType( SlotType.OUTPUT_SLOT ), };
|
|
||||||
|
|
||||||
private final Slot[] smallCraftingSlots = new ItemSlot[] { new ItemSlot( 12, 12, 16, 16 ), new ItemSlot( 30, 12, 16, 16 ), new ItemSlot( 12, 30, 16, 16 ), new ItemSlot( 30, 30, 16, 16 ), new ItemSlot( 59, 21, 16, 16, true ).setSlotType( SlotType.OUTPUT_SLOT ), };
|
|
||||||
|
|
||||||
private final Slot[] furnaceSlots = new ItemSlot[] { new ItemSlot( 13, 21, 16, 16 ), new ItemSlot( 50, 21, 16, 16, true ).setSlotType( SlotType.OUTPUT_SLOT ), };
|
|
||||||
RecipeGenerator parent;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getInfo( ItemStack itemStack )
|
|
||||||
{
|
|
||||||
// :P
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void generateRecipes( RecipeGenerator generator )
|
public void generateRecipes( RecipeGenerator generator )
|
||||||
{
|
{
|
||||||
this.parent = generator;
|
final RecipeTemplate craftingTemplate;
|
||||||
|
final RecipeTemplate smallTemplate;
|
||||||
RecipeTemplate craftingTemplate;
|
|
||||||
RecipeTemplate smallCraftingTemplate;
|
|
||||||
|
|
||||||
if( uristqwerty.CraftGuide.CraftGuide.newerBackgroundStyle )
|
if( uristqwerty.CraftGuide.CraftGuide.newerBackgroundStyle )
|
||||||
{
|
{
|
||||||
craftingTemplate = generator.createRecipeTemplate( this.craftingSlotsOwnBackground, null );
|
craftingTemplate = generator.createRecipeTemplate( CRAFTING_SLOTS_OWN_BG, null );
|
||||||
smallCraftingTemplate = generator.createRecipeTemplate( this.smallCraftingSlotsOwnBackground, null );
|
smallTemplate = generator.createRecipeTemplate( SMALL_CRAFTING_SLOTS_OWN_BG, null );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
craftingTemplate = new DefaultRecipeTemplate( this.craftingSlots, RecipeGeneratorImplementation.workbench, new TextureClip( DynamicTexture.instance( "recipe_backgrounds" ), 1, 1, 79, 58 ), new TextureClip( DynamicTexture.instance( "recipe_backgrounds" ), 82, 1, 79, 58 ) );
|
final TextureClip craftingBG = new TextureClip( DynamicTexture.instance( "recipe_backgrounds" ), 1, 1, TEXTURE_WIDTH, TEXTURE_HEIGHT );
|
||||||
|
final TextureClip craftingSelected = new TextureClip( DynamicTexture.instance( "recipe_backgrounds" ), 82, 1, TEXTURE_WIDTH, TEXTURE_HEIGHT );
|
||||||
|
craftingTemplate = new DefaultRecipeTemplate( CRTAFTING_SLOTS, RecipeGeneratorImplementation.workbench, craftingBG, craftingSelected );
|
||||||
|
|
||||||
smallCraftingTemplate = new DefaultRecipeTemplate( this.smallCraftingSlots, RecipeGeneratorImplementation.workbench, new TextureClip( DynamicTexture.instance( "recipe_backgrounds" ), 1, 61, 79, 58 ), new TextureClip( DynamicTexture.instance( "recipe_backgrounds" ), 82, 61, 79, 58 ) );
|
final TextureClip smallBG = new TextureClip( DynamicTexture.instance( "recipe_backgrounds" ), 1, 61, TEXTURE_WIDTH, TEXTURE_HEIGHT );
|
||||||
|
final TextureClip smallSelected = new TextureClip( DynamicTexture.instance( "recipe_backgrounds" ), 82, 61, TEXTURE_WIDTH, TEXTURE_HEIGHT );
|
||||||
|
smallTemplate = new DefaultRecipeTemplate( SMALL_CRAFTING_SLOTS, RecipeGeneratorImplementation.workbench, smallBG, smallSelected );
|
||||||
}
|
}
|
||||||
|
|
||||||
RecipeTemplate shapelessTemplate = new DefaultRecipeTemplate( this.shapelessCraftingSlots, RecipeGeneratorImplementation.workbench, new TextureClip( DynamicTexture.instance( "recipe_backgrounds" ), 1, 121, 79, 58 ), new TextureClip( DynamicTexture.instance( "recipe_backgrounds" ), 82, 121, 79, 58 ) );
|
final TextureClip shapelessBG = new TextureClip( DynamicTexture.instance( "recipe_backgrounds" ), 1, 121, TEXTURE_WIDTH, TEXTURE_HEIGHT );
|
||||||
|
final TextureClip shapelessSelected = new TextureClip( DynamicTexture.instance( "recipe_backgrounds" ), 82, 121, TEXTURE_WIDTH, TEXTURE_HEIGHT );
|
||||||
|
final RecipeTemplate shapelessTemplate = new DefaultRecipeTemplate( SHAPELESS_CRAFTING_SLOTS, RecipeGeneratorImplementation.workbench, shapelessBG, shapelessSelected );
|
||||||
|
|
||||||
RecipeTemplate furnaceTemplate = new DefaultRecipeTemplate( this.furnaceSlots, new ItemStack( Blocks.furnace ), new TextureClip( DynamicTexture.instance( "recipe_backgrounds" ), 1, 181, 79, 58 ), new TextureClip( DynamicTexture.instance( "recipe_backgrounds" ), 82, 181, 79, 58 ) );
|
this.addCraftingRecipes( craftingTemplate, smallTemplate, shapelessTemplate, generator );
|
||||||
|
|
||||||
this.addCraftingRecipes( craftingTemplate, smallCraftingTemplate, shapelessTemplate, this );
|
final IAppEngApi api = AEApi.instance();
|
||||||
this.addGrinderRecipes( furnaceTemplate, this );
|
final IBlocks aeBlocks = api.definitions().blocks();
|
||||||
this.addInscriberRecipes( furnaceTemplate, this );
|
final Optional<ItemStack> grindstone = aeBlocks.grindStone().maybeStack( 1 );
|
||||||
|
final Optional<ItemStack> inscriber = aeBlocks.inscriber().maybeStack( 1 );
|
||||||
|
|
||||||
|
if( grindstone.isPresent() )
|
||||||
|
{
|
||||||
|
this.addGrinderRecipes( api, grindstone.get(), generator );
|
||||||
|
}
|
||||||
|
|
||||||
|
if( inscriber.isPresent() )
|
||||||
|
{
|
||||||
|
this.addInscriberRecipes( api, inscriber.get(), generator );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings( "unchecked" )
|
||||||
|
private List<IRecipe> getUncheckedRecipes()
|
||||||
|
{
|
||||||
|
return (List<IRecipe>) CraftingManager.getInstance().getRecipeList();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addCraftingRecipes( RecipeTemplate template, RecipeTemplate templateSmall, RecipeTemplate templateShapeless, RecipeGenerator generator )
|
private void addCraftingRecipes( RecipeTemplate template, RecipeTemplate templateSmall, RecipeTemplate templateShapeless, RecipeGenerator generator )
|
||||||
{
|
{
|
||||||
List recipes = CraftingManager.getInstance().getRecipeList();
|
final List<IRecipe> recipes = this.getUncheckedRecipes();
|
||||||
|
|
||||||
int errCount = 0;
|
int errCount = 0;
|
||||||
|
|
||||||
for( Object o : recipes )
|
for( IRecipe recipe : recipes )
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
IRecipe recipe = (IRecipe) o;
|
final Object[] items = this.getCraftingRecipe( recipe, true );
|
||||||
|
|
||||||
Object[] items = generator.getCraftingRecipe( recipe, true );
|
|
||||||
|
|
||||||
|
if( items == null )
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if( items.length == 5 )
|
if( items.length == 5 )
|
||||||
{
|
{
|
||||||
generator.addRecipe( templateSmall, items );
|
generator.addRecipe( templateSmall, items );
|
||||||
@@ -138,8 +218,7 @@ public class CraftGuide extends CraftGuideAPIObject implements IIntegrationModul
|
|||||||
{
|
{
|
||||||
if( errCount >= 5 )
|
if( errCount >= 5 )
|
||||||
{
|
{
|
||||||
CraftGuideLog.log( "CraftGuide DefaultRecipeProvider: Stack trace limit reached, further stack traces from this invocation will not be logged to the console. They will still be logged to (.minecraft)/config/CraftGuide/CraftGuide.log", true );
|
CraftGuideLog.log( "AppEng CraftGuide integration: Stack trace limit reached, further stack traces from this invocation will not be logged to the console. They will still be logged to (.minecraft)/config/CraftGuide/CraftGuide.log", true );
|
||||||
errCount = -1;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -152,61 +231,49 @@ public class CraftGuide extends CraftGuideAPIObject implements IIntegrationModul
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addGrinderRecipes( RecipeTemplate template, RecipeGenerator generator )
|
private void addGrinderRecipes( IAppEngApi api, ItemStack grindstone, RecipeGenerator generator )
|
||||||
{
|
{
|
||||||
|
final ItemStack handle = api.definitions().blocks().crankHandle().maybeStack( 1 ).orNull();
|
||||||
|
final RecipeTemplate grinderTemplate = generator.createRecipeTemplate( GRINDER_SLOTS, grindstone );
|
||||||
|
|
||||||
|
for( IGrinderEntry recipe : api.registries().grinder().getRecipes() )
|
||||||
|
{
|
||||||
|
generator.addRecipe( grinderTemplate, new Object[] {
|
||||||
|
recipe.getInput(),
|
||||||
|
recipe.getOutput(),
|
||||||
|
new Object[] {
|
||||||
|
recipe.getOptionalOutput(),
|
||||||
|
(int) ( recipe.getOptionalChance() * GRINDER_RATIO )
|
||||||
|
},
|
||||||
|
new Object[] {
|
||||||
|
recipe.getSecondOptionalOutput(),
|
||||||
|
(int) ( recipe.getOptionalChance() * GRINDER_RATIO )
|
||||||
|
},
|
||||||
|
handle,
|
||||||
|
grindstone
|
||||||
|
} );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addInscriberRecipes( RecipeTemplate template, RecipeGenerator generator )
|
private void addInscriberRecipes( IAppEngApi api, ItemStack inscriber, RecipeGenerator generator )
|
||||||
{
|
{
|
||||||
|
final RecipeTemplate inscriberTemplate = generator.createRecipeTemplate( INSCRIBER_SLOTS, inscriber );
|
||||||
|
|
||||||
|
for( IInscriberRecipe recipe : api.registries().inscriber().getRecipes() )
|
||||||
|
{
|
||||||
|
generator.addRecipe( inscriberTemplate, new Object[] {
|
||||||
|
recipe.getInputs(),
|
||||||
|
recipe.getTopOptional().orNull(),
|
||||||
|
recipe.getBottomOptional().orNull(),
|
||||||
|
recipe.getOutput(),
|
||||||
|
inscriber
|
||||||
|
} );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
private Object[] getCraftingShapelessRecipe( List<?> items, ItemStack recipeOutput )
|
||||||
public RecipeTemplate createRecipeTemplate( Slot[] slots, ItemStack craftingType )
|
|
||||||
{
|
{
|
||||||
return this.parent.createRecipeTemplate( slots, craftingType );
|
final Object[] output = new Object[10];
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public RecipeTemplate createRecipeTemplate( Slot[] slots, ItemStack craftingType, String backgroundTexture, int backgroundX, int backgroundY, int backgroundSelectedX, int backgroundSelectedY )
|
|
||||||
{
|
|
||||||
return this.parent.createRecipeTemplate( slots, craftingType, backgroundTexture, backgroundX, backgroundY, backgroundSelectedX, backgroundSelectedY );
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public RecipeTemplate createRecipeTemplate( Slot[] slots, ItemStack craftingType, String backgroundTexture, int backgroundX, int backgroundY, String backgroundSelectedTexture, int backgroundSelectedX, int backgroundSelectedY )
|
|
||||||
{
|
|
||||||
return this.parent.createRecipeTemplate( slots, craftingType, backgroundTexture, backgroundX, backgroundY, backgroundSelectedTexture, backgroundSelectedX, backgroundSelectedY );
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void addRecipe( RecipeTemplate template, Object[] crafting )
|
|
||||||
{
|
|
||||||
this.parent.addRecipe( template, crafting );
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void addRecipe( CraftGuideRecipe recipe, ItemStack craftingType )
|
|
||||||
{
|
|
||||||
this.parent.addRecipe( recipe, craftingType );
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setDefaultTypeVisibility( ItemStack type, boolean visible )
|
|
||||||
{
|
|
||||||
this.parent.setDefaultTypeVisibility( type, visible );
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Object[] getCraftingRecipe( IRecipe recipe )
|
|
||||||
{
|
|
||||||
return this.getCraftingRecipe( recipe, true );
|
|
||||||
}
|
|
||||||
|
|
||||||
Object[] getCraftingShapelessRecipe( List items, ItemStack recipeOutput )
|
|
||||||
{
|
|
||||||
Object[] output = new Object[10];
|
|
||||||
|
|
||||||
for( int i = 0; i < items.size(); i++ )
|
for( int i = 0; i < items.size(); i++ )
|
||||||
{
|
{
|
||||||
@@ -235,18 +302,19 @@ public class CraftGuide extends CraftGuideAPIObject implements IIntegrationModul
|
|||||||
}
|
}
|
||||||
|
|
||||||
output[9] = recipeOutput;
|
output[9] = recipeOutput;
|
||||||
|
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
Object[] getSmallShapedRecipe( int width, int height, Object[] items, ItemStack recipeOutput )
|
private Object[] getSmallShapedRecipe( int width, int height, Object[] items, ItemStack recipeOutput )
|
||||||
{
|
{
|
||||||
Object[] output = new Object[5];
|
final Object[] output = new Object[5];
|
||||||
|
|
||||||
for( int y = 0; y < height; y++ )
|
for( int y = 0; y < height; y++ )
|
||||||
{
|
{
|
||||||
for( int x = 0; x < width; x++ )
|
for( int x = 0; x < width; x++ )
|
||||||
{
|
{
|
||||||
int i = y * 2 + x;
|
final int i = y * 2 + x;
|
||||||
output[i] = items[y * width + x];
|
output[i] = items[y * width + x];
|
||||||
|
|
||||||
if( output[i] instanceof ItemStack[] )
|
if( output[i] instanceof ItemStack[] )
|
||||||
@@ -273,18 +341,19 @@ public class CraftGuide extends CraftGuideAPIObject implements IIntegrationModul
|
|||||||
}
|
}
|
||||||
|
|
||||||
output[4] = recipeOutput;
|
output[4] = recipeOutput;
|
||||||
|
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
Object[] getCraftingShapedRecipe( int width, int height, Object[] items, ItemStack recipeOutput )
|
private Object[] getCraftingShapedRecipe( int width, int height, Object[] items, ItemStack recipeOutput )
|
||||||
{
|
{
|
||||||
Object[] output = new Object[10];
|
final Object[] output = new Object[10];
|
||||||
|
|
||||||
for( int y = 0; y < height; y++ )
|
for( int y = 0; y < height; y++ )
|
||||||
{
|
{
|
||||||
for( int x = 0; x < width; x++ )
|
for( int x = 0; x < width; x++ )
|
||||||
{
|
{
|
||||||
int i = y * 3 + x;
|
final int i = y * 3 + x;
|
||||||
output[i] = items[y * width + x];
|
output[i] = items[y * width + x];
|
||||||
|
|
||||||
if( output[i] instanceof ItemStack[] )
|
if( output[i] instanceof ItemStack[] )
|
||||||
@@ -311,12 +380,13 @@ public class CraftGuide extends CraftGuideAPIObject implements IIntegrationModul
|
|||||||
}
|
}
|
||||||
|
|
||||||
output[9] = recipeOutput;
|
output[9] = recipeOutput;
|
||||||
|
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Object toCG( ItemStack[] itemStackSet )
|
private Object toCG( ItemStack[] itemStackSet )
|
||||||
{
|
{
|
||||||
List<ItemStack> list = Arrays.asList( itemStackSet );
|
final List<ItemStack> list = Arrays.asList( itemStackSet );
|
||||||
|
|
||||||
for( int x = 0; x < list.size(); x++ )
|
for( int x = 0; x < list.size(); x++ )
|
||||||
{
|
{
|
||||||
@@ -330,19 +400,20 @@ public class CraftGuide extends CraftGuideAPIObject implements IIntegrationModul
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Nullable
|
||||||
public Object[] getCraftingRecipe( IRecipe recipe, boolean allowSmallGrid )
|
private Object[] getCraftingRecipe( IRecipe recipe, boolean allowSmallGrid )
|
||||||
{
|
{
|
||||||
if( recipe instanceof ShapelessRecipe )
|
if( recipe instanceof ShapelessRecipe )
|
||||||
{
|
{
|
||||||
List items = ReflectionHelper.getPrivateValue( ShapelessRecipe.class, (ShapelessRecipe) recipe, "input" );
|
final List<Object> items = ReflectionHelper.getPrivateValue( ShapelessRecipe.class, (ShapelessRecipe) recipe, "input" );
|
||||||
|
|
||||||
return this.getCraftingShapelessRecipe( items, recipe.getRecipeOutput() );
|
return this.getCraftingShapelessRecipe( items, recipe.getRecipeOutput() );
|
||||||
}
|
}
|
||||||
else if( recipe instanceof ShapedRecipe )
|
else if( recipe instanceof ShapedRecipe )
|
||||||
{
|
{
|
||||||
int width = ReflectionHelper.getPrivateValue( ShapedRecipe.class, (ShapedRecipe) recipe, "width" );
|
final int width = ReflectionHelper.getPrivateValue( ShapedRecipe.class, (ShapedRecipe) recipe, "width" );
|
||||||
int height = ReflectionHelper.getPrivateValue( ShapedRecipe.class, (ShapedRecipe) recipe, "height" );
|
final int height = ReflectionHelper.getPrivateValue( ShapedRecipe.class, (ShapedRecipe) recipe, "height" );
|
||||||
Object[] items = ReflectionHelper.getPrivateValue( ShapedRecipe.class, (ShapedRecipe) recipe, "input" );
|
final Object[] items = ReflectionHelper.getPrivateValue( ShapedRecipe.class, (ShapedRecipe) recipe, "input" );
|
||||||
|
|
||||||
if( allowSmallGrid && width < 3 && height < 3 )
|
if( allowSmallGrid && width < 3 && height < 3 )
|
||||||
{
|
{
|
||||||
@@ -360,7 +431,6 @@ public class CraftGuide extends CraftGuideAPIObject implements IIntegrationModul
|
|||||||
@Override
|
@Override
|
||||||
public void init() throws Throwable
|
public void init() throws Throwable
|
||||||
{
|
{
|
||||||
StackInfo.addSource( this );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -27,8 +27,8 @@ import net.minecraft.item.ItemStack;
|
|||||||
* Part ItemStack provider for WAILA
|
* Part ItemStack provider for WAILA
|
||||||
*
|
*
|
||||||
* @author TheJulianJES
|
* @author TheJulianJES
|
||||||
* @version rv3
|
* @version rv2
|
||||||
* @since rv3
|
* @since rv2
|
||||||
*/
|
*/
|
||||||
public class PartStackWailaDataProvider extends BasePartWailaDataProvider {
|
public class PartStackWailaDataProvider extends BasePartWailaDataProvider {
|
||||||
|
|
||||||
@@ -39,4 +39,4 @@ public class PartStackWailaDataProvider extends BasePartWailaDataProvider {
|
|||||||
return partStack;
|
return partStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,7 +71,8 @@ public class GridNode implements IGridNode, IPathItem
|
|||||||
private Object visitorIterationNumber = null;
|
private Object visitorIterationNumber = null;
|
||||||
// connection criteria
|
// connection criteria
|
||||||
private int compressedData = 0;
|
private int compressedData = 0;
|
||||||
private int channelData = 0;
|
private int usedChannels = 0;
|
||||||
|
private int lastUsedChannels = 0;
|
||||||
|
|
||||||
public GridNode( IGridBlock what )
|
public GridNode( IGridBlock what )
|
||||||
{
|
{
|
||||||
@@ -90,7 +91,7 @@ public class GridNode implements IGridNode, IPathItem
|
|||||||
|
|
||||||
public int usedChannels()
|
public int usedChannels()
|
||||||
{
|
{
|
||||||
return this.channelData >> 8;
|
return this.lastUsedChannels;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Class<? extends IGridHost> getMachineClass()
|
public Class<? extends IGridHost> getMachineClass()
|
||||||
@@ -358,7 +359,7 @@ public class GridNode implements IGridNode, IPathItem
|
|||||||
@Override
|
@Override
|
||||||
public boolean meetsChannelRequirements()
|
public boolean meetsChannelRequirements()
|
||||||
{
|
{
|
||||||
return ( !this.gridProxy.getFlags().contains( GridFlags.REQUIRE_CHANNEL ) || this.getUsedChannels() > 0 );
|
return( !this.gridProxy.getFlags().contains( GridFlags.REQUIRE_CHANNEL ) || this.getUsedChannels() > 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -384,7 +385,7 @@ public class GridNode implements IGridNode, IPathItem
|
|||||||
|
|
||||||
public int getUsedChannels()
|
public int getUsedChannels()
|
||||||
{
|
{
|
||||||
return this.channelData & 0xff;
|
return this.usedChannels;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void FindConnections()
|
public void FindConnections()
|
||||||
@@ -581,7 +582,8 @@ public class GridNode implements IGridNode, IPathItem
|
|||||||
public void setGridStorage( GridStorage s )
|
public void setGridStorage( GridStorage s )
|
||||||
{
|
{
|
||||||
this.myStorage = s;
|
this.myStorage = s;
|
||||||
this.channelData = 0;
|
this.usedChannels = 0;
|
||||||
|
this.lastUsedChannels = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -600,7 +602,7 @@ public class GridNode implements IGridNode, IPathItem
|
|||||||
{
|
{
|
||||||
if( zeroOut )
|
if( zeroOut )
|
||||||
{
|
{
|
||||||
this.channelData &= ~0xff;
|
this.usedChannels = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int idx = this.connections.indexOf( fast );
|
int idx = this.connections.indexOf( fast );
|
||||||
@@ -631,7 +633,7 @@ public class GridNode implements IGridNode, IPathItem
|
|||||||
@Override
|
@Override
|
||||||
public void incrementChannelCount( int usedChannels )
|
public void incrementChannelCount( int usedChannels )
|
||||||
{
|
{
|
||||||
this.channelData += usedChannels;
|
this.usedChannels += usedChannels;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -650,8 +652,7 @@ public class GridNode implements IGridNode, IPathItem
|
|||||||
|
|
||||||
if( this.getLastUsedChannels() != this.getUsedChannels() )
|
if( this.getLastUsedChannels() != this.getUsedChannels() )
|
||||||
{
|
{
|
||||||
this.channelData &= 0xff;
|
this.lastUsedChannels = this.usedChannels;
|
||||||
this.channelData |= this.channelData << 8;
|
|
||||||
|
|
||||||
if( this.getInternalGrid() != null )
|
if( this.getInternalGrid() != null )
|
||||||
{
|
{
|
||||||
@@ -662,7 +663,7 @@ public class GridNode implements IGridNode, IPathItem
|
|||||||
|
|
||||||
public int getLastUsedChannels()
|
public int getLastUsedChannels()
|
||||||
{
|
{
|
||||||
return ( this.channelData >> 8 ) & 0xff;
|
return lastUsedChannels;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class MachineSecurityBreak implements Callable<Void>
|
private static class MachineSecurityBreak implements Callable<Void>
|
||||||
@@ -683,7 +684,6 @@ public class GridNode implements IGridNode, IPathItem
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static class ConnectionComparator implements Comparator<IGridConnection>
|
private static class ConnectionComparator implements Comparator<IGridConnection>
|
||||||
{
|
{
|
||||||
private final IGridNode gn;
|
private final IGridNode gn;
|
||||||
|
|||||||
@@ -86,7 +86,10 @@ public class MEMonitorIInventory implements IMEMonitor<IAEItemStack>
|
|||||||
out = this.adaptor.addItems( input.getItemStack() );
|
out = this.adaptor.addItems( input.getItemStack() );
|
||||||
}
|
}
|
||||||
|
|
||||||
this.onTick();
|
if( type == Actionable.MODULATE )
|
||||||
|
{
|
||||||
|
this.onTick();
|
||||||
|
}
|
||||||
|
|
||||||
if( out == null )
|
if( out == null )
|
||||||
{
|
{
|
||||||
@@ -122,7 +125,10 @@ public class MEMonitorIInventory implements IMEMonitor<IAEItemStack>
|
|||||||
IAEItemStack o = request.copy();
|
IAEItemStack o = request.copy();
|
||||||
o.setStackSize( out.stackSize );
|
o.setStackSize( out.stackSize );
|
||||||
|
|
||||||
this.onTick();
|
if( type == Actionable.MODULATE )
|
||||||
|
{
|
||||||
|
this.onTick();
|
||||||
|
}
|
||||||
|
|
||||||
return o;
|
return o;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ ore=mc:stained_hardened_clay:* -> blockStainedHardenedClay
|
|||||||
ore=ae2:ItemMaterial.NetherQuartzDust -> dustNetherQuartz
|
ore=ae2:ItemMaterial.NetherQuartzDust -> dustNetherQuartz
|
||||||
ore=ae2:ItemMaterial.CertusQuartzDust -> dustCertusQuartz
|
ore=ae2:ItemMaterial.CertusQuartzDust -> dustCertusQuartz
|
||||||
ore=ae2:ItemMaterial.FluixDust -> dustFluix
|
ore=ae2:ItemMaterial.FluixDust -> dustFluix
|
||||||
|
ore=ae2:tile.OreQuartz -> oreCertusQuartz
|
||||||
|
ore=ae2:tile.OreQuartzCharged -> oreCertusQuartz
|
||||||
|
|
||||||
group= mc:iron_ingot oredictionary:ingotCopper oredictionary:ingotTin oredictionary:ingotSilver oredictionary:ingotLead oredictionary:ingotBronze oredictionary:ingotBrass oredictionary:ingotNickel oredictionary:ingotInvar oredictionary:ingotAluminium -> metalIngots
|
group= mc:iron_ingot oredictionary:ingotCopper oredictionary:ingotTin oredictionary:ingotSilver oredictionary:ingotLead oredictionary:ingotBronze oredictionary:ingotBrass oredictionary:ingotNickel oredictionary:ingotInvar oredictionary:ingotAluminium -> metalIngots
|
||||||
group= oredictionary:dustEnder oredictionary:dustEnderPearl -> dustEnder
|
group= oredictionary:dustEnder oredictionary:dustEnderPearl -> dustEnder
|
||||||
|
|||||||
Reference in New Issue
Block a user