mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-12-22 19:39:24 +01:00
Added crystallized canola seeds to make crystal oil
This commit is contained in:
parent
015e5121e2
commit
9007ccadee
6 changed files with 36 additions and 3 deletions
|
@ -20,7 +20,6 @@ import de.ellpeck.actuallyadditions.api.recipe.*;
|
|||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
|
|
@ -48,7 +48,7 @@ public final class InitFluids{
|
|||
FluidRegistry.registerFluid(fluid);
|
||||
FluidRegistry.addBucketForFluid(fluid);
|
||||
|
||||
return fluid;
|
||||
return FluidRegistry.getFluid(fluid.getName());
|
||||
}
|
||||
|
||||
private static Block registerFluidBlock(Fluid fluid, Material material, String name){
|
||||
|
|
|
@ -11,14 +11,21 @@
|
|||
package de.ellpeck.actuallyadditions.mod.items;
|
||||
|
||||
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
||||
import de.ellpeck.actuallyadditions.mod.fluids.InitFluids;
|
||||
import de.ellpeck.actuallyadditions.mod.items.base.ItemBase;
|
||||
import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems;
|
||||
import de.ellpeck.actuallyadditions.mod.util.StringUtil;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.IFluidBlock;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
|
@ -66,4 +73,26 @@ public class ItemMisc extends ItemBase{
|
|||
ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this, 1, i), new ResourceLocation(name), "inventory");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onEntityItemUpdate(EntityItem entity){
|
||||
if(!entity.worldObj.isRemote){
|
||||
ItemStack stack = entity.getEntityItem();
|
||||
if(stack != null && stack.getItemDamage() == TheMiscItems.CRYSTALLIZED_CANOLA_SEED.ordinal()){
|
||||
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){
|
||||
entity.setDead();
|
||||
entity.worldObj.setBlockState(pos, InitFluids.blockCrystalOil.getDefaultState());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return super.onEntityItemUpdate(entity);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,6 +40,7 @@ public final class LensRecipeHandler{
|
|||
public static LensConversionRecipe recipeLeather;
|
||||
public static LensConversionRecipe recipeNetherWart;
|
||||
public static LensConversionRecipe recipePrismarine;
|
||||
public static LensConversionRecipe recipeCrystallizedCanolaSeed;
|
||||
|
||||
public static void init(){
|
||||
//Crystal Blocks
|
||||
|
@ -99,6 +100,9 @@ public final class LensRecipeHandler{
|
|||
recipePrismarine = RecipeUtil.lastReconstructorRecipe();
|
||||
}
|
||||
|
||||
ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(InitItems.itemCanolaSeed), new ItemStack(InitItems.itemMisc, 1, TheMiscItems.CRYSTALLIZED_CANOLA_SEED.ordinal()), 2000);
|
||||
recipeCrystallizedCanolaSeed = RecipeUtil.lastReconstructorRecipe();
|
||||
|
||||
ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Blocks.QUARTZ_BLOCK), new ItemStack(InitBlocks.blockTestifiBucksWhiteWall), 10);
|
||||
recipeWhiteWall = RecipeUtil.lastReconstructorRecipe();
|
||||
ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Blocks.QUARTZ_BLOCK, 1, 1), new ItemStack(InitBlocks.blockTestifiBucksGreenWall), 10);
|
||||
|
@ -113,7 +117,6 @@ public final class LensRecipeHandler{
|
|||
ActuallyAdditionsAPI.addReconstructorLensColorChangeItem(Item.getItemFromBlock(Blocks.CARPET), changer);
|
||||
ActuallyAdditionsAPI.addReconstructorLensColorChangeItem(Item.getItemFromBlock(InitBlocks.blockColoredLamp), changer);
|
||||
ActuallyAdditionsAPI.addReconstructorLensColorChangeItem(Item.getItemFromBlock(InitBlocks.blockColoredLampOn), changer);
|
||||
|
||||
}
|
||||
|
||||
public static ArrayList<LensConversionRecipe> getRecipesFor(ItemStack input){
|
||||
|
|
|
@ -38,6 +38,7 @@ public enum TheMiscItems{
|
|||
SPAWNER_SHARD("SpawnerShard", EnumRarity.EPIC),
|
||||
BIOMASS("Biomass", EnumRarity.UNCOMMON),
|
||||
BIOCOAL("Biocoal", EnumRarity.RARE),
|
||||
CRYSTALLIZED_CANOLA_SEED("CrystallizedCanolaSeed", EnumRarity.UNCOMMON),
|
||||
YOUTUBE_ICON("YoutubeIcon", Util.FALLBACK_RARITY);
|
||||
|
||||
public final String name;
|
||||
|
|
|
@ -504,6 +504,7 @@ item.actuallyadditions.itemPlayerProbe.name=Player Probe
|
|||
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
|
||||
|
||||
#Tooltips
|
||||
tooltip.actuallyadditions.onSuffix.desc=On
|
||||
|
|
Loading…
Reference in a new issue