use of minechem.item.augment.IAugmentedItem in project Minechem by iopleke.
the class AugmentRecipe method getCraftingResult.
@Override
public ItemStack getCraftingResult(InventoryCrafting crafting) {
ItemStack augment = getAugmentable(crafting);
if (augment == null) {
return null;
}
ItemStack item = getItem(crafting);
if (item == null) {
return null;
}
ItemStack result = augment.copy();
((IAugmentedItem) result.getItem()).setAugment(result, item);
return result;
}
use of minechem.item.augment.IAugmentedItem in project Minechem by iopleke.
the class AugmentLight method onBlockHarvest.
@SubscribeEvent
public void onBlockHarvest(BlockEvent.HarvestDropsEvent event) {
if (event.harvester != null) {
ItemStack stack = event.harvester.getHeldItem();
if (stack != null && stack.getItem() instanceof IAugmentedItem) {
IAugmentedItem augmentedItem = (IAugmentedItem) stack.getItem();
int level = augmentedItem.getAugmentLevel(stack, this);
if (level > -1 && event.world.getBlockLightValue(event.x, event.y, event.z) < 8) {
consumeAugment(stack, level);
event.world.setBlock(event.x, event.y, event.z, BlockRegistry.blockLight, level, 3);
}
}
}
}
use of minechem.item.augment.IAugmentedItem in project Minechem by iopleke.
the class AugmentRecipe method matches.
@Override
public boolean matches(InventoryCrafting crafting, World world) {
ItemStack augmented = getAugmentable(crafting);
if (augmented == null) {
return false;
}
ItemStack augmentItem = getItem(crafting);
if (augmentItem == null) {
return false;
}
return ((IAugmentedItem) augmented.getItem()).canHaveAugment(augmented, AugmentRegistry.getAugment(augmentItem));
}
Aggregations