Fixed mushrooms creating nether wart infinitely with the Reconstructor

This commit is contained in:
Ellpeck 2016-08-17 03:49:29 +02:00
parent 81f743f03d
commit e203b14f8d

View file

@ -145,16 +145,20 @@ public class MethodHandler implements IMethodHandler{
List<ItemStack> outputs = RecipeUtil.getConversionLensOutputs(recipe);
if(outputs != null && !outputs.isEmpty()){
ItemStack output = outputs.get(0);
if(output.getItem() instanceof ItemBlock){
if(output != null){
if(!ConfigBoolValues.LESS_BLOCK_BREAKING_EFFECTS.isEnabled()){
tile.getWorldObject().playEvent(2001, pos, Block.getStateId(tile.getWorldObject().getBlockState(pos)));
}
if(output.getItem() instanceof ItemBlock){
tile.getWorldObject().setBlockState(pos, Block.getBlockFromItem(output.getItem()).getStateFromMeta(output.getItemDamage()), 2);
}
else{
EntityItem item = new EntityItem(tile.getWorldObject(), pos.getX()+0.5, pos.getY()+0.5, pos.getZ()+0.5, output.copy());
tile.getWorldObject().spawnEntityInWorld(item);
tile.getWorldObject().setBlockToAir(pos);
}
tile.extractEnergy(recipe.energyUse);
break;
}
@ -163,6 +167,7 @@ public class MethodHandler implements IMethodHandler{
}
}
}
}
//Converting the Items
ArrayList<EntityItem> items = (ArrayList<EntityItem>)tile.getWorldObject().getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(hitBlock.getX()-range, hitBlock.getY()-range, hitBlock.getZ()-range, hitBlock.getX()+range, hitBlock.getY()+range, hitBlock.getZ()+range));