Applied-Energistics-2-tiler.../src/api/java/appeng/api/definitions/IBlockDefinition.java
thatsIch 03f9436ef9 Fixes #1331: Happened on deactivating features for intermediate crafting components
If a feature dependency of ItemMultiMaterial was disabled, the returned value was never assigned with the constructed. Pulling out the construction and setting it before checking it, prevents the NPE and also matches the behaviour in ItemMultiPart, where parts are constructed, but never registered.
2015-05-01 17:52:23 +02:00

35 lines
777 B
Java

package appeng.api.definitions;
import net.minecraft.block.Block;
import net.minecraft.item.ItemBlock;
import net.minecraft.world.IBlockAccess;
import com.google.common.base.Optional;
public interface IBlockDefinition extends IItemDefinition
{
/**
* @return the {@link Block} implementation if applicable
*/
Optional<Block> maybeBlock();
/**
* @return the {@link ItemBlock} implementation if applicable
*/
Optional<ItemBlock> maybeItemBlock();
/**
* Compare Block with world.
*
* @param world world of block
* @param x x pos of block
* @param y y pos of block
* @param z z pos of block
*
* @return if the block is placed in the world at the specific location.
*/
boolean isSameAs( IBlockAccess world, int x, int y, int z );
}