Ignore some Items in JEI

This commit is contained in:
Ellpeck 2016-01-22 18:52:38 +01:00
parent 6edab422c4
commit 0b3201bcf9
2 changed files with 21 additions and 5 deletions

View file

@ -55,13 +55,18 @@ public class BlockPlant extends BlockCrops{
List<ItemStack> drops = getDrops(world, pos, state, 0); List<ItemStack> drops = getDrops(world, pos, state, 0);
boolean deductedSeedSize = false; boolean deductedSeedSize = false;
for(ItemStack stack : drops){ for(ItemStack stack : drops){
if(stack != null && stack.getItem() == this.seedItem && !deductedSeedSize){ if(stack != null){
if(stack.getItem() == this.seedItem && !deductedSeedSize){
stack.stackSize--; stack.stackSize--;
deductedSeedSize = true; deductedSeedSize = true;
} }
EntityItem entity = new EntityItem(world, pos.getX()+.5, pos.getY()+.5, pos.getZ()+.5, stack);
if(stack.stackSize > 0){
EntityItem entity = new EntityItem(world, pos.getX()+0.5, pos.getY()+0.5, pos.getZ()+0.5, stack);
world.spawnEntityInWorld(entity); world.spawnEntityInWorld(entity);
} }
}
}
world.setBlockState(pos, getStateFromMeta(0)); world.setBlockState(pos, getStateFromMeta(0));
} }

View file

@ -11,6 +11,7 @@
package de.ellpeck.actuallyadditions.mod.jei; package de.ellpeck.actuallyadditions.mod.jei;
import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks;
import de.ellpeck.actuallyadditions.mod.items.InitItems; import de.ellpeck.actuallyadditions.mod.items.InitItems;
import de.ellpeck.actuallyadditions.mod.jei.booklet.BookletRecipeCategory; import de.ellpeck.actuallyadditions.mod.jei.booklet.BookletRecipeCategory;
import de.ellpeck.actuallyadditions.mod.jei.booklet.BookletRecipeHandler; import de.ellpeck.actuallyadditions.mod.jei.booklet.BookletRecipeHandler;
@ -20,7 +21,9 @@ import de.ellpeck.actuallyadditions.mod.jei.crusher.CrusherRecipeCategory;
import de.ellpeck.actuallyadditions.mod.jei.crusher.CrusherRecipeHandler; import de.ellpeck.actuallyadditions.mod.jei.crusher.CrusherRecipeHandler;
import de.ellpeck.actuallyadditions.mod.jei.reconstructor.ReconstructorRecipeCategory; import de.ellpeck.actuallyadditions.mod.jei.reconstructor.ReconstructorRecipeCategory;
import de.ellpeck.actuallyadditions.mod.jei.reconstructor.ReconstructorRecipeHandler; import de.ellpeck.actuallyadditions.mod.jei.reconstructor.ReconstructorRecipeHandler;
import de.ellpeck.actuallyadditions.mod.util.Util;
import mezz.jei.api.*; import mezz.jei.api.*;
import net.minecraft.item.ItemStack;
@JEIPlugin @JEIPlugin
public class JEIActuallyAdditionsPlugin implements IModPlugin{ public class JEIActuallyAdditionsPlugin implements IModPlugin{
@ -69,6 +72,14 @@ public class JEIActuallyAdditionsPlugin implements IModPlugin{
ignoreList.ignoreNbtTagNames(InitItems.itemBatteryTriple, "Energy"); ignoreList.ignoreNbtTagNames(InitItems.itemBatteryTriple, "Energy");
ignoreList.ignoreNbtTagNames(InitItems.itemBatteryQuadruple, "Energy"); ignoreList.ignoreNbtTagNames(InitItems.itemBatteryQuadruple, "Energy");
ignoreList.ignoreNbtTagNames(InitItems.itemBatteryQuintuple, "Energy"); ignoreList.ignoreNbtTagNames(InitItems.itemBatteryQuintuple, "Energy");
IItemBlacklist blacklist = this.helpers.getItemBlacklist();
blacklist.addItemToBlacklist(new ItemStack(InitBlocks.blockRice));
blacklist.addItemToBlacklist(new ItemStack(InitBlocks.blockCanola));
blacklist.addItemToBlacklist(new ItemStack(InitBlocks.blockFlax));
blacklist.addItemToBlacklist(new ItemStack(InitBlocks.blockCoffee));
blacklist.addItemToBlacklist(new ItemStack(InitBlocks.blockWildPlant, 1, Util.WILDCARD));
blacklist.addItemToBlacklist(new ItemStack(InitBlocks.blockColoredLampOn, 1, Util.WILDCARD));
} }
@Override @Override