Added recipe for empowered oil

This commit is contained in:
Ellpeck 2016-09-13 20:40:26 +02:00
parent 541410be5e
commit 820f097c12
4 changed files with 17 additions and 9 deletions

View file

@ -78,16 +78,19 @@ public class ItemMisc extends ItemBase{
public boolean onEntityItemUpdate(EntityItem entity){
if(!entity.worldObj.isRemote){
ItemStack stack = entity.getEntityItem();
if(stack != null && stack.getItemDamage() == TheMiscItems.CRYSTALLIZED_CANOLA_SEED.ordinal()){
if(stack != null){
boolean isEmpowered = stack.getItemDamage() == TheMiscItems.EMPOWERED_CANOLA_SEED.ordinal();
if(stack.getItemDamage() == TheMiscItems.CRYSTALLIZED_CANOLA_SEED.ordinal() || isEmpowered){
BlockPos pos = entity.getPosition();
IBlockState state = entity.worldObj.getBlockState(pos);
Block block = state.getBlock();
if(block instanceof IFluidBlock && block.getMetaFromState(state) == 0){
Fluid fluid = ((IFluidBlock)block).getFluid();
if(fluid != null && fluid == InitFluids.fluidOil){
if(fluid != null && fluid == (isEmpowered ? InitFluids.fluidCrystalOil : InitFluids.fluidOil)){
entity.setDead();
entity.worldObj.setBlockState(pos, InitFluids.blockCrystalOil.getDefaultState());
entity.worldObj.setBlockState(pos, (isEmpowered ? InitFluids.blockEmpoweredOil : InitFluids.blockCrystalOil).getDefaultState());
}
}
}
}

View file

@ -39,6 +39,7 @@ public enum TheMiscItems{
BIOMASS("Biomass", EnumRarity.UNCOMMON),
BIOCOAL("Biocoal", EnumRarity.RARE),
CRYSTALLIZED_CANOLA_SEED("CrystallizedCanolaSeed", EnumRarity.UNCOMMON),
EMPOWERED_CANOLA_SEED("EmpoweredCanolaSeed", EnumRarity.RARE),
YOUTUBE_ICON("YoutubeIcon", Util.FALLBACK_RARITY);
public final String name;

View file

@ -43,6 +43,9 @@ public final class EmpowererHandler{
for(ItemStack ball : balls){
addCrystalEmpowering(TheCrystals.EMERALD, new ItemStack(Items.DYE, 1, EnumDyeColor.LIME.getDyeDamage()), new ItemStack(Blocks.TALLGRASS, 1, 1), new ItemStack(Blocks.SAPLING), ball.copy());
}
ItemStack seed = new ItemStack(InitItems.itemCanolaSeed);
ActuallyAdditionsAPI.addEmpowererRecipe(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.CRYSTALLIZED_CANOLA_SEED.ordinal()), new ItemStack(InitItems.itemMisc, 1, TheMiscItems.EMPOWERED_CANOLA_SEED.ordinal()), seed, seed, seed, seed, 1000, 30, new float[]{1F, 91F/255F, 76F/255F});
}
private static void addCrystalEmpowering(TheCrystals type, ItemStack modifier1, ItemStack modifier2, ItemStack modifier3, ItemStack modifier4){

View file

@ -505,6 +505,7 @@ item.actuallyadditions.itemWorm.name=Worm
item.actuallyadditions.itemBag.name=Traveler's Sack
item.actuallyadditions.itemVoidBag.name=Void Sack
item.actuallyadditions.itemMiscCrystallizedCanolaSeed.name=Crystallized Canola Seed
item.actuallyadditions.itemMiscEmpoweredCanolaSeed.name=Empowered Canola Seed
#Tooltips
tooltip.actuallyadditions.onSuffix.desc=On